www.tombraiderforums.com

Go Back   www.tombraiderforums.com > Tomb Raider Modding > Tomb Raider Level Editor > Tomb Raider Level Editor Tutorials

Closed Thread
 
Thread Tools
Old 02-06-08, 17:36   #1
Titak
Moderator
 
Titak's Avatar
 
Join Date: Jul 2003
Location: Drenthe, The Netherlands
Posts: 29,336
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  
Old 02-06-08, 17:40   #2
Titak
Moderator
 
Titak's Avatar
 
Join Date: Jul 2003
Location: Drenthe, The Netherlands
Posts: 29,336
Default

WHAT DO THE COMMAND/CONDITION FIELDS MEAN?
-------------------------------------------------------------------


Iíve made a short description about the required fields you need to fill in the Animation= command line. To give you a bit of a starter. J
For more detailed information you need to read the help file, as described above.


AnimIndex
This is the field where you put the number of the animation you want Lara to perform.
You can find the correct animation number using WADMerger Animation Editor.


KEY1_
This is where you put the key the player needs to press to make Lara perform the animation.
You can put more than one key in this field.
So if you want Lara to perform the animation only when the player presses arrow up and jump at the same time, you need to put KEY1_UP + KEY1_JUMP in this field.

In this tutorial Iím only using the default keyboard buttons.
You can also assign other keys, but this requires some extra scripting.

Possible keys for this field are:
KEY1_ACTION
KEY1_DOWN
KEY1_DRAW_WEAPON
KEY1_LEFT
KEY1_LOOK
KEY1_RELEASED
KEY1_RIGHT
KEY1_ROLL
KEY1_UP
KEY1_WALK

NOTE1:
The special value KEY1_RELEASED may be added to Key1 field to invert key conditions. When KEY1_RELEASED is present, the condition is true only when the specified keys are NOT down.
So you could use this to make Lara perform a certain animation when she is hanging onto something and the player lets go of Action.


KEY2_
Basically the same as the KEY1_ field but you can only put a small number of keys in this field:

KEY2_DASH
KEY2_DUCK
KEY2_USE_FLARE


FAN_ flags
You can set one or more flags FAN_ to set the behavior of the animation command.

An example of a FAN_flag is FAN_SET_FREE_HANDS.
This flag performs a specific action to inform the game engine that Laraís hands are free and she will therfore be able to hang, climb and pick up objects or weapons.


ENV_ Environment
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.

A few examples of ENV_ Environment conditions are:

ENV_HOLE_FLOOR_IN_FRONT
This ensures that Lara will only perform the animation when there is a hole in the floor in front of her.

ENV_FRAME_NUMBER
This can be used to ensure that the custom move will only start playing when Lara is at a specified frame number of a certain animation.
The framenumber should be inserted in the Distance for Env field.
The animationnumber (or StateID fo that animation) should be inserted in the StateId or AnimationId array field.

ENV_MONKEY_CEILING
This condition is true when lara is below monkeybars.
You can then set the distance to the monkeybars in the Distance for Env field.
The value that needs to be typed in the Distance for Env field is calculated with the following formula: MinClick + MaxClick * 256

For example if you want the condition to be true when the monkeybars are enclosed in range 3 (min) clicks upto 4 (max) click, you'll have to type the value
(3 + 4*256) = 1027 in the disctance field.
(This particular value is actually needed to make Lara perform the ladder-to-monkey move.)


Distance for Env
In this field you insert the values needed for some of the ENV_Environment conditions.
See also some of the examples in the ENV_Environment


Extra
This field may host different values in according with FAN flags.


StateId or AnimationId array
After the 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.

For example following table shows the most important state-id's:
Climbing: $38 , $39, $3A, $3B, $3C, $3d
Falling: $09, $1d
Jumping: $19, $1A, $1b, $1C, $03
Moing on all fours: $50, $51, $47, $48
Rolling: 5
Running: 1
Walking: 0
Monkey: $4b, $4c, $4d, $4e, $4f, $52, $53
Still, stand up: 2

NOTE 2:
The '$' sign means "hexadecimal value". You can use the Windows calculator in scientific mode to convert hex to decimal. You can also type the numbers in decimal but then you have to type the negative number, so animation 164 should be typed as -164.
The state-ids or animationnumbers you type in this field are used by the engine to determine when your animation is allowed and when it's not.
__________________
If it walks like a duck and if it quacks like a duck, it is a duck.
Titak is offline  
Old 02-06-08, 17:46   #3
Titak
Moderator
 
Titak's Avatar
 
Join Date: Jul 2003
Location: Drenthe, The Netherlands
Posts: 29,336
Default

I have tried to recreate some of the TREP moves using the scriptcommand Animation=, to get those moves to work with TRNG, since TRNG is not compatible with TREP.
You may freely use the scripts of the examples I will post.


EXAMPLE 1 - LADDER TO MONKEY
-------------------------------------------------------------------

This move allows Lara to grab a monkeybar ceiling above her, when she is on a clicmbable wall.


Download animation

446-ladder-to-monkey.zip

This animation was originally created by Geckokid.
The script I made works with this animation.


Script command

Animation= 446, KEY1_ACTION + KEY1_UP, IGNORE, IGNORE, ENV_MONKEY_CEILING, 1027, IGNORE, -164


What does it all mean?

446
This is the animationnumber of the ladder-to-monkey animation.

KEY1_ACTION + KEY1_UP
To activate the animation you have to press Action and arrow up.

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_MONKEY_CEILING
Since it is the ladder-to-monkey move, it should only be performed when Lara is below a monkeybar ceiling.

1027
This is the Distance for Env fvalue to make sure that Lara can only grab the monkeybars when she is right below them.

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

-164
This is the animationnumber of Lara climbing on a wall.
It is the animation when she is hanging still with her legs pulled up.

Note that if you use an animationnumber instead of a StateID, you have to use the negative number!!


Screenshot

__________________
If it walks like a duck and if it quacks like a duck, it is a duck.

Last edited by Titak; 30-12-14 at 11:00.
Titak is offline  
Old 02-06-08, 17:49   #4
Titak
Moderator
 
Titak's Avatar
 
Join Date: Jul 2003
Location: Drenthe, The Netherlands
Posts: 29,336
Default

EXAMPLE 2 - 180 DEGREE TURN ON MONKEYBARS
-------------------------------------------------------------------

This move allows Lara to make a 180 degree turn while hanging still from monkeybars.


Download animation

257-180-degree-turn-on-monkey.zip

This animation was originally created by Geckokid.
The script I made works with this animation.


Script command

Animation= 257, KEY1_ROLL, IGNORE, IGNORE, IGNORE, IGNORE, IGNORE, -234


What does it all mean?

257
This is the number of 180-degree-on-monkeybars animation.

When you view this slot in WADMerger’s animation Editor you’ll see that there actually is a very simple turning around animation in there.
That’s why this slot can be used for this move without having to create extra animation slots.

KEY1_ROLL
To make Lara perform the move, you need to press the ROLL button.

IGNORE, IGNORE, IGNORE, IGNORE, IGNORE
No KEY2_ is assigned, no FAN_flags are needed, no ENV_Environment conditions are needed, no Distance for Env is needed and no Extra values are needed, so that’s why IGNORE is put in all these fields.

-234
The number of the animation from which Lara should perform the move.
It is the number of the hanging-still-on-monkeybars animation.

NOTE:
The thing I noticed with this animation is that there’s a delay.
You need to press the ROLL button for about a second before Lara performs the move.


Screenshot



NOTE:
If you are also using FLEP, you can tick the patch "Monkeyswing: 180 turn (stop)" and no scripting for this move is required.
__________________
If it walks like a duck and if it quacks like a duck, it is a duck.

Last edited by Titak; 08-12-16 at 15:07.
Titak is offline  
Old 02-06-08, 17:53   #5
Titak
Moderator
 
Titak's Avatar
 
Join Date: Jul 2003
Location: Drenthe, The Netherlands
Posts: 29,336
Default

EXAMPLE 3 - ROLL IN CRAWLSPACE
-------------------------------------------------------------------

Lara can perform a quick roll in a crawlspace, which makes her move forward much quicker than regular crawling.

The animations for it are already present in the Lara object of one of the Revised wads, so there’s no need to add it.


Script command

Animation= 218, IGNORE, $4000, FAN_KEEP_NEXT_STATEID + FAN_SET_FREE_HANDS_TEMP, ENV_MULT_CONDITION, 4, IGNORE, -222, -353, -354
MultEnvCondition= 4 ,ENV_NO_BLOCK_IN_FRONT, 256, IGNORE, ENV_NON_TRUE + ENV_HOLE_FLOOR_IN_FRONT, 512, IGNORE



What does it all mean?
As you can see you need two different scriptcommands to make this move work properly.

Animation=
218
Number of the roll-in-crawlspace animation.

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

$4000
The hexadecimal value of the Sprint key.
You can also type KEY2_DASH instead.

Note:
The hexvalue of a certain key or condition is listed in the show _MNEMONIC CONSTANTS for new script commands list.

FAN_KEEP_NEXT_STATEID
This will make sure that Lara will go back to the stateID of her kneeling animations.

FAN_SET_FREE_HANDS_TEMP
This makes sure that Lara's hands go back to properly holding her weapons in case you perform this move with drawn weapons.

ENV_MULT_CONDITION
Since more ENV_Environment conditions are needed you have to use this condition.
It tells the engine to also use the MultEnvCondition= command where all the ENV_Environment conditions will be listed.

4
The number of the MultEnvCondition= command that should be used by the engine.

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

-222, -353, -354
These are the animationnumber of Lara’s kneeling animations.
These are the animation from which Lara can perform the move.

MultEnvCondition=
4
The number of the command, as assigned in the Animation= command.
The engine will now know to use this MultEnvCondition= in conjunction with the Animation= command.

ENV_NO_BLOCK_IN_FRONT, 256, IGNORE
ENV_Environment, Distance for ENV and Extra field for the conditions to prevent Lara from performing the roll when she is face to face with a wall/block at a distance of less than a block and a half.

ENV_NON_TRUE + ENV_HOLE_FLOOR_IN_FRONT, 512, IGNORE
ENV_Environment, Distance for ENV and Extra field for the conditions to prevent Lara from performing the roll when she is face to face with a hole in the floor which is equal to or deeper than 2 clicks.
So this move cannot be used to make Lara roll out of a crawlspace unless the crawlspace is only one click above the floor.


Screenshot

__________________
If it walks like a duck and if it quacks like a duck, it is a duck.

Last edited by Titak; 30-12-14 at 11:01.
Titak is offline  
Old 02-06-08, 17:59   #6
Titak
Moderator
 
Titak's Avatar
 
Join Date: Jul 2003
Location: Drenthe, The Netherlands
Posts: 29,336
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 and two custom animations which allow Lara to make a jump upwards to, for example, 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; 04-10-15 at 09:24.
Titak is offline  
Old 02-06-08, 18:01   #7
Titak
Moderator
 
Titak's Avatar
 
Join Date: Jul 2003
Location: Drenthe, The Netherlands
Posts: 29,336
Default

EXAMPLE 5 - ROLL OUT OF CRAWLSPACE
-------------------------------------------------------------------

This move enables Lara to quickly roll out of a crawlspace, instead of turning around first and then crawl out.

Script command

Animation= 421, KEY1_JUMP, IGNORE, FAN_SET_NEUTRAL_STATE_ID + FAN_SET_FREE_HANDS, ENV_POS_HORTOGONAL + ENV_HOLE_FLOOR_IN_FRONT + ENV_POS_STRIP_1, IGNORE, IGNORE, 80


What does it all mean?

421
This is the animationnumber of the roll-out-of-crawlspace animation.
This animation is already present in the Lara objects of the revised wads.

KEY1_JUMP
The move is activated by pressing the JUMP button when Lara is facing the exit of the crawlspace.

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

FAN_SET_NEUTRAL_STATE_ID
From the Reference List of NG_Scripter:
This value forces the engine to change the real state-id number of your animation, replacing it with a neutral state-id.
The advantage is to avoid some interference created by tomb4 engine in some circustances.

(More details are in the Reference section of NG_Scripter.)

ENV_POS_HORTOGONAL + ENV_HOLE_FLOOR_IN_FRONT + ENV_POS_STRIP_1
ENV_POS_HORTOGONAL
To make sure Lara can only perform the move when she is facing the exit of the crawlspace directly.
She will not perform the move when she is in a diagonal position , because of this condition.

ENV_HOLE_FLOOR_IN_FRONT
To make sure Lara will only perform the move when there's a hole in the floor in front of her.

ENV_POS_STRIP_1
To make sure Lara will only perform the move when at the edge of the crawlspace, instead of on the entire tile.

IGNORE
The move can take place during the entire in-crawling-position animation, so no framenumber or other extra values needed.

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

80
StateID of Lara's crawling animation.


NOTE:
If you are also using FLEP, you can tick the patch "Enable crawlspace jump" and no scripting for this move is required.
__________________
If it walks like a duck and if it quacks like a duck, it is a duck.

Last edited by Titak; 02-11-14 at 09:42.
Titak is offline  
Old 18-01-09, 15:19   #8
Titak
Moderator
 
Titak's Avatar
 
Join Date: Jul 2003
Location: Drenthe, The Netherlands
Posts: 29,336
Default

EXAMPLE 6 - LADDER TO CRAWLSPACE
-------------------------------------------------------------------

This move enables Lara to quickly squeeze into a crawlspace, when climbing a ladder.
In TR4, you first have to let go of the ladder, quickly grab it again and while Lara is still hanging from her hands (before she pulls up her legs again) you have to press DUCK and ARROW_UP to make her crawl into the crawlspace.
With this move you don't have to do all this. All you have to do is keep pressing ARROW_UP and Lara will crawl into the crawlspace.
You can find the animation for this move in a TRC LARA object.

Script command

Animation= 445, KEY1_ACTION, KEY2_DUCK, FAN_SET_FREE_HANDS, ENV_MULT_CONDITION, 2, -164 ;ladder to crawlspace
MultEnvCondition= 2, ENV_WALL_HOLE_IN_FRONT, 8738, IGNORE, ENV_CLIMB_WALL_IN_FRONT, IGNORE, IGNORE ;ladder to crawlspace



What does it all mean?

445
This is the animationnumber of the ladder-to-crawlspace animation.
The animation for this move can be found in a TRC Lara object.

KEY1_ACTION + KEY1_UP
The move is activated by pressing the ARROW_UP button when Lara has reached the entrance of a crawlspace, while climbing a wall.
Keep ACTION pressed to prevent Lara from falling down.

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

FAN_KEEP_NEXT_STATEID + FAN_SET_FREE_HANDS
FAN_SET_FREE_HANDS indicates that Lara's hands are empty and that she can therefore do things like climbing, crawling, etc.
More details are in the Reference section of NG_Scripter.

ENV_MULT_CONDITION
More than one ENV_*** is needed in this case, so the ENV_MULT_CONDITION needs to be used.

ENV_WALL_HOLE_IN_FRONT
Perform the move only when there's a hole in the wall in front of Lara.

8738
This number specifies some conditions of the hole in the walls.
It makes sure that Lara will only perform the move when the hole in the wall has the size of a crawlspace (2 clicks high).
So when Lara reaches a 1 click high hole, she won't climb into it, and when the hole is 4 clicks high, she will perform her regular ledge climb.
See the reference section in NG_Scripter to see how this numberwas determined.

ENV_CLIMB_WALL_IN_FRONT
Perform the move only when the wall in front of Lara is climbable.
(So the move can only be performed when Lara is on a climbable wall)

2
This is the number of the ENV_MULT_CONDITION (MultEnvCondition=) that should be used when performing this move.

-164
Lara's climbing animation.


Screenshot:
__________________
If it walks like a duck and if it quacks like a duck, it is a duck.

Last edited by Titak; 30-12-14 at 11:02.
Titak is offline  
Old 15-09-14, 16:35   #9
Titak
Moderator
 
Titak's Avatar
 
Join Date: Jul 2003
Location: Drenthe, The Netherlands
Posts: 29,336
Default

EXAMPLE 7 - STUMBLE_TO_RUN AFTER A FALL
-------------------------------------------------------------------

This move will make Lara stumble into a run when you keep pressing arrow up when landing safely after a fall.


Download animation

animation-stumble.zip

This animation was originally created by Geckokid.
The script I made works with this animation.


Script command

Animation= 487, KEY1_UP, IGNORE, FAN_SET_FREE_HANDS_TEMP, ENV_MULT_CONDITION, 6, IGNORE, -24
MultEnvCondition= 6, ENV_FRAME_NUMBER, 1, IGNORE, ENV_NO_BLOCK_IN_FRONT, IGNORE, IGNORE



What does it all mean?

487
This is the animationnumber of the ladder-to-monkey animation.
You can ofcourse put the animation in another slot and then you have to change this number to the slotnumber you placed the animation in.

KEY1_UP
To activate the animation you have to press Action and arrow up.

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

IGNORE
FAN_SET_FREE_HANDS_TEMP is added to tell the game that Lara's hands are free during the animation.
So even if she is holding guns or a torch during the animation, she will move her arms properly.

ENV_MULT_CONDITION
Since more than one ENV_ command is needed, ENV_MULT_CONDITION is used. I this example it points to MultEnvCondition= 6 but if number 6 is already used, you can ofcourse change it to another number.

6
This is the ID number of the MultEnvCondition= command.
As said above, you can ofcourse change this in case ID 6 is already used.

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

-24
This is the animationnumber of Lara landing after a longer drop.


In the MultiEnvCondition=:
ENV_FRAME_NUMBER, 1, IGNORE,
Means that the animation should start at frame 1 of animation 24.

ENV_NO_BLOCK_IN_FRONT, IGNORE, IGNORE
With this ENV_ condition added, Lara won't perform the animation when she lands right in front of a block.

Note that with this script Lara will perform the move when she is on the edge of a hole in the floor. So she will fall in when you make her stumble!
This can be avoided by putting yet another ENV_ condition in the MultiEnvCondition= command, but I prefer it having this way: more realistic imo.


Screenshot

__________________
If it walks like a duck and if it quacks like a duck, it is a duck.

Last edited by Titak; 30-12-14 at 11:02.
Titak is offline  
Old 14-05-16, 12:52   #10
Titak
Moderator
 
Titak's Avatar
 
Join Date: Jul 2003
Location: Drenthe, The Netherlands
Posts: 29,336
Default

EXAMPLE 8 - WATER TO LADDER
-------------------------------------------------------------------

This move allows Lara to grab and climb onto a ladder while she is swimming/floating on the water surface


Script command
Animation= 490, KEY1_ACTION + KEY1_UP, IGNORE, FAN_SET_LARA_PLACE+FAN_ALIGN_TO_ENV_POS, ENV_MULT_CONDITION, 8, PLACE_GROUND, -110, -116, -118
MultEnvCondition= 8, ENV_CLIMB_WALL_IN_FRONT, IGNORE, IGNORE, ENV_POS_HORTOGONAL + ENV_FLOATING, IGNORE, IGNORE, ENV_CONDITION_TRIGGER_GROUP, 9, IGNORE
Triggergroup= 9, $8000, 7, $110
MultEnvCondition= 7, ENV_DISTANCE_WEST_WALL, 102, IGNORE, ENV_DISTANCE_SOUTH_WALL, 102, IGNORE, ENV_DISTANCE_NORTH_WALL, 102, IGNORE, ENV_DISTANCE_EAST_WALL, 102, IGNORE


TriggerGroup 9 is the following exported condition trigger:
; Exporting: CONDITION(16:60) for PARAMETER(6)
; <#> : MultEnvCondition= 7
; <&> : Multiple condition of <#>MultEnvCondition script command in (E)way
; (E) : in OR way. (Just a single ENV condition is true)
; Values to add in script command: $8000, 7, $110



Settings for the animation
Animation 490:
StateID= 56
Next Anim= 491

Animation 491:
491 is a single frame animation with the one frame being a copy of the last frame of animation 490.
StateID= 56
Next Anim= 164

You can ofcourse change the animations slots to whatever slots you have avilable in your own LARA object.
It depends on the animation you use whether or not you need to add a Set Position to animation 491.
For some odd reason my animation has Set Position 0, 0, 0 assigned to it... which should not make any difference since it does nto move Lara. Well, no idea but I decided to put it in the tutiorial anyway in case someone has problems with the transition to the actual ladder animation.



Screenshot
An example of a water-to-ladder animation.
__________________
If it walks like a duck and if it quacks like a duck, it is a duck.

Last edited by Titak; 20-07-16 at 18:34.
Titak is offline  
Closed Thread

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT. The time now is 19:15.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2017, vBulletin Solutions Inc.