Page 6 of 9

Posted: Thu May 17, 2007 1:11 pm
by Jay
Another new thing:

Exploder/Gravity Forces - They affect all actors in a specific range and give them a Force so that it looks like an explosion or like an implosion... Hard to describe without pictures
This is done with this script command:

ExploderForce(float x, float y, float z, float range, float amount, bool interpolate);

where x, y, and z are world coordinates in relation to the pawn, range is the range in which the force will be active, amount the strenght of the force, and interpolate means that the force will be weaker the farer away an object is.

If you want an implosion you use a negative value for amount.

I have to warn you, though. It could be that it is not so framerate-friendly, especially with the interpolation on. The more actors are in your scene, the slower it gets. I will have to test it a bit before i can say anything more.

I hope i wrote clear language and not some programmer-language...

Posted: Thu May 17, 2007 4:39 pm
by jonas
Wow very nice. We are going to have all kinds off cool little feature before your done. :D Very cool.
Keep up the good work.

Posted: Thu Jun 07, 2007 1:35 pm
by Jay
Currently i am building in 'Cinematic Effects' for Cutscenes:

(Those are all HighLevel Commands since Cutscenes make more sense in HighLevel than in LowLevel)

StopScene(float time, char* soundname);
stops the whole scene for -time- seconds while playing the sound file -soundname-. Like in those films where the scene stops and the narrator explains something.

SetSceneUpdateTime(float time);
sets up the scene so that it is only updated every -time- seconds (can be values like 0.1 or similar). You know, like in those discos where they turn on the flashlight and everyones' moves look cooler.

FadeOutScene(float time, float r, float g, float b);
Fades the scene in -time- seconds to the color defined by r,g,b until the screen is totally filled with this color. The scene is not stopped during this time.

FadeInScene(float time);
Fades in the scene back in.


Also another two things (LowLevel commands):

DropWeapon(int slot, char* entityname, char* animation);
Adds the weapon in slot -slot- as a an dynamic entity to the world at the exact spot where the pawn is and gives it the animation -animation- (normally a falling/dropping animation). The weapon will have the szEntityName -entityname- and will have no collision on. But this can be solved with the next command:

SetEntityCollision(char* entityname, bool state);
If -state- is true turns on the collision for that entity, if -state- is false it turns it off.

Posted: Thu Jun 07, 2007 10:44 pm
by Spyrewolf
woah nice work again jay!

im interested in this?
SetSceneUpdateTime(float time);
sets up the scene so that it is only updated every -time- seconds (can be values like 0.1 or similar). You know, like in those discos where they turn on the flashlight and everyones' moves look cooler.
but still don't get it? would it be possible to fraps and put it up on youtube i'm guessing a slomo type of effect? or a strobe

Posted: Fri Jun 08, 2007 10:53 am
by Jay
a strobe. Like if you lower the framerate incidentically. Together with SetTimeScale(...) you can produce a slomo effect like it is sometimes shown in TV when an accident happens. Or like you make a picture with your camera every second.

Posted: Mon Jun 11, 2007 4:44 am
by darksmaster923
just a question about the dynamic entities, cuz i might use them in my game. if i place more than one than one dynamic entity and give it the same entityname, will it mess up? cuz i will use DistanceBetweenEntities(char* FromEntityName, char *ToEntityName); to check

Posted: Mon Jun 11, 2007 1:08 pm
by Jay
Yes. It is not possible to say which one will be used for the calculation of the Distance.

Posted: Wed Jun 20, 2007 4:53 pm
by fps
Is this stuff going to be in the next community release of rf?


Thanks,
fps

Posted: Mon Jul 09, 2007 3:19 pm
by Jay
Sory i haven't answered any sooner, but i didn't have anything new, and i also did not want to spam this topic full with single small answers.

But i have now:

I am implementing a feature which allows to skip the menu and load the first level at game start. This is done bey adding

skipmenu = true

in RealityFactory.ini.

Also i am trying, i repeat -trying-, to implement saving and loading via scripts. I have to test if it is working correctly.

These three may be used together to create a basic 'In-Game-Menu' when you start the game, which is, the first level is your 'menu-level' and you operate from there. So you can have a 3d menu, poeple walking around in the backround, or anything else you could do in a real level. Then when you make for example a set of pictures and you click on them and a game is loaded. Or a door where you click onto and a new game is loaded (That means, you will make a level cahnge)

btw, all of this is going to be in the next community release i will make.

Posted: Mon Jul 09, 2007 5:25 pm
by darksmaster923
omg gj jay, that allows us to have more flexible menus which was a huge problem with with rf. And you might be able to make a menu to customize scripted players controls!

Posted: Mon Jul 09, 2007 9:30 pm
by Jay
such a menu is not possible...yet. You spoke of a feature i will implement soon:

Setting 'globals' that will be stored on the harddisk in a file. A global is a string or a number (which is, essentially, a string. i.e. "4" or "5555" instead of "bla" or "blij"). This way they will persist over the end of the game and can be reused in other games.

This is very flexible in its possible use: Maybe a highscore. Or your menu to customize scripted player controls (you can store them in globals and then reuse them next time). And a feature that allows to revisit places where you already were.

Posted: Tue Sep 04, 2007 3:42 pm
by fps
when is this going to relaease?

Posted: Thu Nov 08, 2007 1:40 pm
by Jay
I will be merging the physics release with this one. So the release will be somewhere after federico is finished with his work. The last addition is something small but helpfull:

I changed the FireProjectile(...) and FireProjcetileBlind(...) lowlevel commands so that they can have an additional parameter which allows you to specify the damage the projectile does. I use this for making spells that can have different strenghts, like level 1 which does 10 damage, level 2 which does 20...all done with the same projectile.

Posted: Thu Nov 08, 2007 1:58 pm
by federico
I'm quite done, really. The problem left is the simulation clock. I will need some help to solve this issue. Anyway, also I've modified the fireprojectileblind command. My hacks let you define a custom firing pitch (you can use the "Camera" parameter to use the self.camera_pitch value), and an accurancy value. The latter is useful to have different firing precision for different states (standing/walking/running).
I paste here my code so you can merge it with yours:

Code: Select all

case 53:	// else if (IS_METHOD(methodName, "FireProjectileBlind"))
		{
			PARMCHECK(6);
		
			geXForm3d Xf;
			geVec3d theRotation, Pos, Direction, Orient, TargetPoint;
			geFloat x;

			bool bone;

			strcpy(param4, arguments[0].str());
			strcpy(param0, arguments[1].str());
			strcpy(DamageAttr, arguments[5].str());

			geXForm3d_SetIdentity(&Xf);

			//changed by Federico Sept 2007 - could mess up using the setrelbonerotation command
			//if(WeaponActor)
			//	bone = geActor_GetBoneTransform(WeaponActor, param0, &Xf);
			//else
			//end changed Sept 2007
				bone = geActor_GetBoneTransform(Actor, param0, &Xf);
		
			if(!bone)
				return true;

			geVec3d_Copy(&(Xf.Translation), &Pos);
			CCD->ActorManager()->GetRotate(Actor, &theRotation);
			
			// changed QD 12/15/05
			//geXForm3d_SetIdentity(&Xf);
			//geXForm3d_RotateZ(&Xf, theRotation.Z);
			geXForm3d_SetZRotation(&Xf, theRotation.Z);

			if(arguments.entries() > 6)
			{
				int Weapon_Accurancy_X  = (int)EffectC_Frand(0, arguments[7].floatValue() );
				int Weapon_Accurancy_Y  = (int)EffectC_Frand(0, arguments[7].floatValue() );

				if(!stricmp(arguments[6].str(), "Camera"))
				{

				geXForm3d_RotateX(&Xf,-CCD->CameraManager()->GetTilt() + (Weapon_Accurancy_X * 0.0174532925199433f) );
				geXForm3d_RotateY(&Xf, CCD->CameraManager()->GetYaw() + (Weapon_Accurancy_Y * 0.0174532925199433f) );
				}
				else
				{
				geXForm3d_RotateY(&Xf, theRotation.Y);
				geXForm3d_RotateX(&Xf, arguments[6].floatValue());
				
				}
			}
			else
			{

				geXForm3d_RotateY(&Xf, theRotation.Y);
				geXForm3d_RotateX(&Xf, theRotation.X);
			}
			//geXForm3d_RotateY(&Xf, theRotation.Y);
			//geXForm3d_Translate(&Xf, Pos.X, Pos.Y, Pos.Z);

		
			geXForm3d_GetIn(&Xf, &Direction);
			geVec3d_AddScaled(&Pos, &Direction, 1000.0f, &TargetPoint);
			geVec3d_AddScaled(&Pos, &Direction, arguments[4].floatValue(), &Pos);
			
			geXForm3d_GetUp(&Xf, &Direction);
			geVec3d_AddScaled(&Pos, &Direction, arguments[3].floatValue(), &Pos);
		
			geXForm3d_GetLeft(&Xf, &Direction);
			geVec3d_AddScaled(&Pos, &Direction, arguments[2].floatValue(), &Pos);
		
			//geXForm3d_GetIn(&Xf, &Direction);
			//geVec3d_AddScaled(&Pos, &Direction, arguments[4].floatValue(), &Pos);
			
			geVec3d_Subtract(&TargetPoint, &Pos, &Orient);
			float l = geVec3d_Length(&Orient);
			
			if(l > 0.0f) 
			{
				x = Orient.X;
				// changed QD 12/15/05
				// Orient.X = (float)(GE_PI*0.5f) - (float)acos(Orient.Y / l);
				Orient.X = GE_PIOVER2 - (float)acos(Orient.Y / l);
				Orient.Y = (float)atan2(x, Orient.Z) + GE_PI;
				Orient.Z = 0.0f;	// roll is zero - always!!?
						
				CCD->Weapons()->Add_Projectile(Pos, Pos, Orient, param4, DamageAttr, DamageAttr);
			}
			return true;
		}

Posted: Thu Nov 08, 2007 5:57 pm
by federico
so for example:

Code: Select all

FireProjectileBlind(FIREAMMO,WEAPONHAND,0,0,0,DAMAGEATTRIB, "Camera", WEAPON_ACCURANCY);
the parameters are the usual ones, plus:

- firing pitch. It could be "Camera" to use the self.camera_pitch parameter, or a user defined parameter. "Camera" is good for a scripted player, so that he behaves exactly in the same way of the standard 3rd person player. If you are scripting an enemy pawn I suggest you to use self.enemy_pitch as value.

- Accurancy. A value used to compute the firing precision altering the firing direction by the value parameter in degrees. I suggest you to keep track of the running/walking/standing state of your pawn and set accordingly this value.
In my script:

Code: Select all

if((RUN_COMMMAND) and (SPEED > 0) and (Run = false) and (Reload = false) )
    {
      CROSS_index = 3;
      WEAPON_ACCURANCY = 10;
    }
    else
    {
        if(SPEED > 0)
        {
        WEAPON_ACCURANCY = 5;
        CROSS_index = 2;
        }
        else
        {
        WEAPON_ACCURANCY = 0;
        CROSS_index = 1;
        }      
    }
so I can modify the accurancy. The CROSS_index value is used to show the indexed flipbook image as crosshair. Using this trick, the firing precision of my scripted player and my pawns changes according to this runniing state and the crosshair changes as well... :wink: