Game Development Community

Help!!

by Ihuoma Nwagwu · in Torque Game Engine · 08/26/2002 (2:18 pm) · 1 replies

The player.cs file in fps has this line of code:

-$PlayerDeathAnim::TorsoFrontFallForward = 1;

1. Is the $PlayerDeathAnim a global engine variable? 2. When and why should someone use the this global variable?
3. How does this variable relate to the datablock PlayerData?

#1
08/27/2002 (8:59 pm)
$ in the Torque script language means a global-focus variable. Any function can call it. Any datablock can use it, if it has been defined or not. They are mostly used for constants or things that are "global" as in, everything should be effected by it. The other type of Torque script variable is the %, which only exists in the function it is used in.
Note that $ and % aren't ENGINE variables. The only way you can get them into the engine is to use an engine-based function, or maybe there is a list of variables that carry over through that I havn't seen...


It is the index for that specific death animation. The way Tribes2 (many stuff from Tribes2 is in torque, torque probably has the same function!) picks deaths is if/else'ing away until they reach something that makes sense for the damage type and the damage location. Basically you will see something like
"%anim = $PlayerDeathAnim::TorsoFrontFallForward" (note its probably not %anim, this is just a guess)

The only true relation it has with playerdatablock is that it applies to an animation of the datablock's model (death1, in this case).