View Single Post
Old 02-06-08, 17:59   #6
Titak
Moderator
 
Titak's Avatar
 
Join Date: Jul 2003
Location: Drenthe, The Netherlands
Posts: 32,752
Default

EXAMPLE 4 - LEDGE JUMPS
-------------------------------------------------------------------

This particular TREP patch allows you to add two more StateID’s to animation 96 to enable Lara to perform two extra moves when she is hanging from a ledge.

With TRNG and the Animation= scripting you can add as many moves to animation 96 as you want. Needless to say that these extra moves most likely don’t exist in the Lara object, so you will need to create your own animations for it.

As an example I’ve created two scriptcommands which allow Lara to make a jump upwards to another ledge right above her, and to make her jump backwards to a ledge behind her.

Here are two animations for both ledge-jump-up and ledge-jump-backwards made by Geckokid:
Ledge-jump animations.


LEDGE-JUMP-UP

Script command

Animation= 448, KEY1_JUMP, IGNORE , FAN_SET_FREE_HANDS, ENV_FRAME_NUMBER, 21, IGNORE, -96


What does it all mean?

448
This is the animationnumber of my ledge-jump-up animation.

KEY1_JUMP
The amove is activated by pressing the JUMP button when Lara is hanging still from a ledge (animation 96)

IGNORE
No KEY2_ is assigned, so that’s why IGNORE is put in this field.

IGNORE
No FAN_flags are needed so that’s why IGNORE is put in this field.

ENV_FRAME_NUMBER
I used this condition to ensure that Lara will only perform the move on the assigned frame of the assigned animation.

21
The framenumber from which the move should be enabled.
So as long as Lara is NOT at frame 21 of animation 96, she will not perform the move.

IGNORE
No Extra value/condition is needed so that’s why IGNORE is put in this field.

-96
Negative value of the animationnumber from which the move should be performed.


Screenshot




LEDGE-JUMP-BACKWARDS

Script command

Animation= 450, KEY1_DOWN, IGNORE , FAN_SET_FREE_HANDS, ENV_MULT_CONDITION, 1, IGNORE, -96 ;ledge jump backwards
MultEnvCondition= 1 ,ENV_DISTANCE_CEILING, $800, IGNORE, ENV_FRAME_NUMBER, 21, IGNORE ;ledge jump backwards



What does it all mean?

450, KEY1_DOWN, IGNORE
These first three fields should speak for themselves now.

FAN_SET_FREE_HANDS
I used this FAN_flag so the engine will know that Lara’s hands are free and she can therefore grab an ledge or jumpswitch or whatever when she is in midair.

ENV_MULT_CONDITION, 1
These point to the MultEnvCondition= 1 line.
This move needs to use a MultEnvCondition= line because at some point I found out that Lara could also perform the move when there was a ceiling or sloped ceiling nearby. The result was that Lara partially went through the ceiling when performing the move.
The MultEnvCondition= prevents that.
You will ofcourse need to use another indexnumber for the MultEnvCondition= if you are using more than one in your animation scripting section.

ENV_DISTANCE_CEILING, $800
This sets the condition that Lara should be 8 clicks away from the ceiling in order to be able to perform this move. You can experiment with this value to see which fits your situation best but I preferred this value.

ENV_FRAME_NUMBER, 21, IGNORE, -96
Same as with the ledge-jump-up move.
__________________
If it walks like a duck and if it quacks like a duck, it is a duck.

Last edited by Titak; 13-09-20 at 14:52.
Titak is online now