View Single Post
Old 02-06-08, 17:36   #1
Titak
Moderator
 
Titak's Avatar
 
Join Date: Jul 2003
Location: Drenthe, The Netherlands
Posts: 32,750
Default TRNG - Animation scripting

INTRODUCTION
-------------------------------------------------------------------

Since TRNG is not compatible with TREP new moves for Lara need to be scripted.

Remember that you have to use NG Center to create the scripts!!
Otherwise the new scriptcommands like the Animation= commands will not work ingame.

You can basically make whaterver moves you want for Lara with this script command!
But it is quite complicated to get things to work flawless but, as with many things, practice makes perfect.
Trail and error is often needed to learn how to use the many different conditions that can or need to be set in the Animation= command to make a certain new move work perfectly.

In this tutorial I’ll try to explain the basics of animation scripting.
I have also included some scripts to make some of the TREP moves possible.

(In this tutorial I'm assuming you know how to change and build your script in NG Center.)

IN GENERAL
SCRIPTING TIP
WHAT DO THE COMMAND/CONDITION FIELDS MEAN?
EXAMPLE 1 - LADDER TO MONKEY
EXAMPLE 2 - 180 DEGREE TURN ON MONKEYBARS
EXAMPLE 3 - ROLL IN CRAWLSPACE
EXAMPLE 4 - LEDGE JUMPS
EXAMPLE 5 - ROLL OUT OF CRAWLSPACE
EXAMPLE 6 - LADDER TO CRAWLSPACE
EXAMPLE 7 - STUMBLE_TO_RUN AFTER A FALL
EXAMPLE 8 - WATER TO LADDER



IN GENERAL
-------------------------------------------------------------------

To make new moves possible for Lara, you need to use the Animation= command in your script.

The general syntax is:
Animation= AnimIndex, KEY1_ , KEY2_ , FAN_ flags, ENV_ Environment,
Distance for Env, Extra, StateId or AnimationId array


This command should be placed in the [Level] section.
This means that you will have to put the command in every level of your game if you want Lara to be able to perform this move in every level of your game!

Command/condition fields
As you can see the Animation= command contains several fields divided by comma’s.
The number of fields should stay the same at all times!
In several cases you can add more commands/conditions to one field. The conditions should then be divided by a +.
If a field is not applicable you need to put IGNORE in it.

NG Center Help
It is wise to view the help file on the Reference tab, show SCRIPT NEW commands, in NG Center for exact explanation on what the fields mean and what conditions you can put in there. It is best to copy all the text in the green explanation box to a Word document and then print it for better viewing. Read through it carefully, because it tells you a lot about all the different conditions you can set.



Another usefull part of the Reference tab is the show _MNEMONIC CONSTANTS for new script commands box. This is where all the conditions that can be used with scriptcommands are listed. When you select one of the constants in the list, a short description will appear in the green info box.




SCRIPTING TIP
-------------------------------------------------------------------

Since a lot of the features of TRNG need to be scripted, you'll end up with a very long script block for your level, if you use a lot of those scriptable features.

My script isn't that long yet, but even now I'm starting to find it difficult to remember what each line is about, especially with all the animation= commands I'm using atm, and the MultEnvCondition= I also need to use for some of the animations.

So I added the name of the animation at the end of the scriptline, using ; before the name, like this:
Animation= 218, IGNORE, $4000, FAN_KEEP_NEXT_STATEID, ENV_MULT_CONDITION, 4, IGNORE, -222, -353, -354 ;roll in crawlspace
MultEnvCondition= 4 ,ENV_NO_BLOCK_IN_FRONT, 256, IGNORE, ENV_NON_TRUE + ENV_HOLE_FLOOR_IN_FRONT, 512, IGNORE ;roll in crawlspace
Animation= 448, KEY1_JUMP, IGNORE , IGNORE, ENV_FRAME_NUMBER, 21, IGNORE, -96 ;ledge jump up

Since ; tells the script not to use anything that comes after the ;, untill you use Enter to go to the next line,
the script still works like a charm but it becomes much easier to read what the scriptlines are about exactly.
__________________
If it walks like a duck and if it quacks like a duck, it is a duck.

Last edited by Titak; 14-05-16 at 13:10.
Titak is offline