Animation Script Command
Syntax: Animation=AnimIndex , KEY1_ , KEY2_ , FAN_ flags , ENV_ Environment , Distance for Env , Extra , StateId or AnimationId array (...)
Scope: to use in [Level] section
With Animation command you can perform new animation for lara when player hit some key.
(This command is suggested only for advanced level builders to add new moves for Lara)
Other to set the number of animation and hot key used to engage in game the animation, you should set also some condition about when this new lara command will be permitted, because perform an animation, for example a kick, while lara is underwater or hanged to rope it should be weird.
AnimIndex field
Here you type the number you see in Animation Editor of Wad Merger program.
Remark:
If you type a negative number the Animation command will work in diagnostic mode.
In this situation no animation will be performed, of course, but you'll be able to see on screen an info about WHEN the animation could be performed.
Pratically you'll see a text like "Anim-1=no" or "Anim-1=YES"
This diagnostic mode is useful to test the condition you set in Animation command to verify if the animation should start in correct moment, as position or keystroke command.
Note: to see these infos on screen you have to enabled the diagnostic with command "Diagnostic=ENABLED" typed in [Options] section of script.txt.
Key1 and Key2 fields.
In these fields you can set a code (or two) to identify the activation key of your new animation.
Remark: the special value KEY1_RELEASED may be added to Key1 field to invert condition about keys. When KEY1_RELEASED is present the condition is true only when the specified keys are NOT down.
You can set two kinds of value in Key fields.
Keyboard scancodes or Keyboard game commands.
Both types identify a key of keyboard but there are some differences:
- ScanCodes permit to choose any key (or almost) of keyboard, while Game commands are only the prefixed keys you see in Option screen tomb raider game.
- By other hand, the Game commands have the advantage to be activated also by joystick and if player changes the setting in Option screen of tomb4, your command will continue to work.
Another difference is the way to type the valeus in Key1 and Key2 fields.
If you use Scancodes you should copy the value from Keyboard Scancode list of Reference panel of NG Center program.
While if you want to use preformatted game commands, you can use the constant KEY1_... and KEY2_ ... you find in MNEMONIC CONSTANTS of Reference panel.
When you use game commands remember you have to place the value in Key1 field or in Key2 field in according with prefix KEY1_ and KEY2_.
Differently if you use scancodes you can assign a new key, usually non used by tomb4, for example the scancode for F8 key, or for "Q" literal.
You can also set two different scancodes, writting the first in Key1 and second in Key2. In this case the animation will be performed only when both key are hit in some moment.
For example.
Animation=500, 42, 11, ...
Since 42 = (Shift left) and 11= (Number 0), the animation will be started when player hit in same moment SHIFT + 0 (zero)
Remark: if you want to use scan codes you have to add the flag FAN_KEYS_AS_SCANCODE in FAN_ field.
Note that it's a bit different when you use KeyBoard Game Commands.
With KeyBoard Game command you can insert two or more code in same Key field, just type the sum of these valuese.
For example:
You can require two or more game command in same moment, adding the constant value KEY1_ with other KEY1_.. and KEY2 with other KEY2.
For example to have the combination of game commands Action Jump and Dash, you'll have to insert in key1 field "KEY1_JUMP+KEY1_ACTION" while in Key field the valye "KEY2_DASH".
Remark: If you don't use some of Key1/2 field you should type IGNORE to signal that it is not used.
FAN_ Flags fields
You can set one or more flags FAN_ to to set the behavior of animation command.
Read the FAN_ constant values in section _MNEMONIC CONSTANTS of Reference Panel of NG_Center to get info about FAN_ values.
ENV_ Environment field
In Environment field you can set a single very spefic condition about the environment around to Lara.
You should use this field only when your animation requires a correct environment around lara like: climbable walls, holes, walls ect.
Remarks:
* Differently by FAN_ flags you can not type the sum of any ENV_ values, you can choose only a single ENV_ condition and you can add to it only ENV_POS_.. flags or ENV_NON_TRUE flag to inverse the mean of condition.
* If you don't want set any Environment you can type IGNORE in this field.
See description of ENV_ constants in MNEMONIC CONSTANTS sectio of Reference panel for usage of ENV_ values.
Distance for Env field
If you set a value different by IGNORE in above field named Environment, you can set in this Distance field a number to specify some size or height or range about specific ENV_ condition you set in Environment field.
The common situation is Distance hosts the height/depth of wall/hole.
The units to use are 1024 for 1 sector, so 1 click = 256 and half sector is 512.
It's different the units when Distance field hosts a range, like for Environment named ENV_MONKEY_CEILING. See description of ENV_MONKEY_CEILING value about how set the Distance field in that case.
Remark: you can always type in this field IGNORE and trng engine will use a default value ideal for current ENV_ condition you chose.
Extra field
This field may host different values in according with FAN flags or ENV_ conditions.
You find what type in this field reading the descriptions of FAN_... flags or ENV_ conditions you find in Reference panel of NG_Center in section "MNEMONIC_CONSTANTS"
StateId or AnimationId array fields
After Extra field you can type one or more values to set State-ids or Animation indices to use as condition to start your special animation.
The special animation will be performed only if at least one of given state is, and one of animation indices, is currently active for Lara in game in that moment that player hit the correct keystroke.
Remark: to recognize State id from Animation indices, you have to use positive values for State-IDs, while negative values for Animation Indices.
For example: the list: "96, 112, -28, -42"
Will be read as: "Perform my animation only if state id of lara is currently = 96 or 112, and, in same moment, the current animation of Lara is 28 or 42 index.
You can use also type a constant STATE_ .. to type StateId values. You find all STATE_ values in MNEMONIC_LIST of Reference panel .
If you don't understand what is a "state-id" or Animation index you can interpret then like a number to signal what lara is doing in a more general way of specific animation.
The state-ids you type are used by engine to understand when your animation is allowed and when it's not.
Normally you'll set as state id the value "2" or "STATE_STOP" in this way your animation will be enabled only if lara is still, on land and in stand up position.
But you could create particular animation to perform only when lara is climbing a wall, in this case you should type all values for climbing:
STATE_CLIMB_UP
STATE_CLIMB_DOWN
STATE_CLIMB_END
STATE_CLIMB_LEFT
STATE_CLIMB_RIGHT
STATE_CLIMB_START_AND_STANDING
or only some of above values.