Tomb Raider Forums  

Go Back   Tomb Raider Forums > Tomb Raider Level Editor and Modding > Tomb Raider Level Editor > Tutorials and Resources

Closed Thread
 
Thread Tools
Old 29-07-15, 09:24   #1
AkyV
Moderator
 
Joined: Dec 2011
Posts: 4,881
Default TRNG – Trap miscellaneous

Instructions:

1. Copy the setup in your Script.
2. Build the Script.

Special instructions, if the Script doesn’t work/cannot be built:

1. Check TriggerGroup, and GlobalTrigger ID’s and change them if you are already using the ID in another TriggerGroup/GlobalTrigger.
2. If you already have a Parameters= PARAM_BIG_NUMBERS command at your level, then remove the same command of the setup you’ve just copied, and type the amount value of the removed command into the old command.
3. Open the Find Trigger Number window in Set Trigger Type panel, and copy-paste the underlined triggers there (one by one), to check them:

- If you changed TriggerGroup/GlobalTrigger ID’s, then you also need to change the TriggerGroup/GlobalTrigger ID in the trigger (if it is a trigger about a TriggerGroup/GlobalTrigger).
- If you removed the new Parameters= PARAM_BIG_NUMBERS command, you need to check if the big number index is still okay in the trigger (if it is a trigger about big numbers). If it is not, then choose the good one.
- Maybe you need to choose another variable, because you can’t use the variables (Global Short Alfa1, Global Short Alfa2) I used in the setups. So choose another one now (if it is a trigger about variables), if it is needed.
You are never allowed to change Current Value variable!

Export the trigger you have changed, replacing the previous trigger in the Script.
3. Build the Script.

Condition:
If the first activity status of X trap is Y

This 'first activity' condition is useful, because the 'Enemy has not been yet activated' in C14 works only with creatures. (Though 'Enemy is active' and 'Enemy is not active' are also useful with non-living objects in C14.)

The condition works only with these traps:
- Chain
- Plough
- Stargate
- Moving Blade
- Hammer
- Spikeball
- Floor4Blade
- Roof4Blade
- Bird Blade
- Seth Blade

TriggerGroup= 1, $5000, X, $36, > ; defining the trap with its X ID code you see in Room Editor
$2000, 256, $1810, > ; put the actual status into Global Short Alfa1 (GSA1) variable
Y

Y values are:
$8000, 16, $2B; GSA1 is 0: the trap has never been activated before
$8000+TGROUP_NOT, 16, $2B; GSA1 is not 0:
a, the trap is active or
b, the trap is inactive but has been activated before at least once

The meaning of Y is a bit different with Seth Blade:
$8000, 16, $2B; GSA1 is 0: the trap has never performed a strike before
$8000+TGROUP_NOT, 16, $2B; GSA1 is not 0: the trap is performing/has performed its first strike

If Seth Blade has been activated at the very first time but hasn't started moving yet then that naturally means the trap has never performed a strike before.

The easiest solutions to use the conditions:
- The TriggerGroup (1) ID is referred by a C15 trigger. There is a TRIGGER placed in the map, overlapped with the CONDITION trigger. The TRIGGER will be executed if Lara is in the trigger zone when the CONDITION is true.
- The TriggerGroup (1) ID is referred by the IdConditionTriggerGroup field of a GlobalTrigger.

Condition:
If X Hammer performs Y action*

TriggerGroup= 1, $5000, X, $36, > ; defining the hammer with its X ID code you see in Room Editor
$9000, X, $30E,> ; if X hammer is active (or else the condition will be true even if the hammer has not been activated yet)
$2000, 256, $1510, > ; put the moving direction status into Global Short Alfa1 (GSA1) variable
$2000, 256, $1711, > ; put the position status into Global Short Alfa2 (GSA2) variable
Y

Y values are:
$8000, 16, $2B, $8000, 17, $2B; GSA1 is 0, GSA2 is 0: the hammer is in the uppermost position
$8000, 16, $2B, $8000+TGROUP_NOT, 17, $2B; GSA1 is 0, GSA2 is not 0: the hammer is in the uppermost position or the hammer is just ascending
$8000+TGROUP_NOT, 16, $2B, $8000+TGROUP_NOT, 17, $2B; GSA1 is not 0, GSA2 is not 0: the hammer is just striking

Notes:

- The first part of the shiver after the strike is included in the strike.
The second part of the shiver after the strike is included in the ascension.
- You can achieve something similar, in a more complicated way, if you use animation and frame conditions for the hammer.

Condition:
If X Spikeball has Y danger status*

TriggerGroup= 1, $5000, X, $36, > ; defining the spikeball with its X ID code you see in Room Editor
$2000, 256, $1810, > ; put the actual status into Global Short Alfa1 (GSA1) variable
$8000, 16, $W028; if GSA1 is the number at W0 position of PARAM_BIG_NUMBERS, W0 (must be typed in hexadecimal format now in the trigger code)is 0 in this example
Parameters= PARAM_BIG_NUMBERS, Y

Y values are:
50: the trap is injurious - i.e. the knives are extended
150: the trap is not injurious:
- the ball is still falling down, or
- it has fallen down but the knives haven't extended yet

Note:
You can achieve something similar, in a more complicated way, if you use animation and frame conditions for the spikeball.

Condition:
If X 4Blade performs Y action*

Use it for Roof4Blade or Floor4Blade traps.

TriggerGroup= 1, $5000, X, $36, > ; defining the 4blade with its X ID code you see in Room Editor
$9000, X, $30E,> ; if X 4blade is active (or else the condition will be true even if the 4blade is not active)
$2000, 256, $1510, > ; put the harmful/harmless status into Global Short Alfa1 (GSA1) variable
$2000, 256, $1811, > ; put the first/second movement status into Global Short Alfa2 (GSA2) variable
Y

Y values are:
- $8000+TGROUP_NOT, 16, $2B, $8000, 17, $142B; GSA1 is not 0, GSA2 is 20: the blade performs the first harmful movement
- $8000, 16, $2B, $8000, 17, $142B; GSA1 is 0, GSA2 is 20: the blade performs the pause after the first harmful movement
- $8000+TGROUP_NOT, 16, $2B, $8000, 17, $1529; GSA1 is not 0, GSA2 >= 21: the blade performs the second (“the blades are clapping together”) harmful movement
- $8000, 16, $2B, $8000, 17, $1529; GSA1 is 0, GSA2 >= 21: the blade performs any action after the second harmful movement (including the idle status of the trap after all the movements). – This condition will be true till you antitriggering the trap.
- $8000+TGROUP_NOT, 16, $2B, $8000, 17, $129; GSA1 is not 0, GSA2 >= 1: the blade performs any harmful movement
- $8000, 16, $2B, $8000, 17, $129; GSA1 is 0, GSA2 >= 1: the blade is harmless (including the idle status of the trap after all the movements) – This condition will be true till you antitriggering the trap.

Note:
You can achieve something similar, in a more complicated way, if you use animation and frame conditions for the blade.

Condition:
If X Bird Blade Y works/does not work harmfully*

TriggerGroup= 1, $5000, X, $36, > ; defining the bird blade with its X ID code you see in Room Editor
$9000, X, $30E,> ; if X bird blade is active (or else the condition will be true even if the blade is not active)
$2000, 256, $1510, > ; put the actual status into Global Short Alfa1 (GSA1) variable
Y

Y values are:
$8000, 16, $2B; GSA1 is 0: the blades are just moving harmlessly up, after clapping together (including the shiver in the uppermost position)
$8000+TGROUP_NOT, 16, $2B; GSA1 is not 0: the blades are just moving down to hurt Lara (including when they clap together and the bounce after clapping together)

Note:
You can achieve something similar, in a more complicated way, if you use animation and frame conditions for the blade.

Condition:
If X Catwalk Blade/Plinth Blade Y moves/does not move*

'Moving/not moving' is not the same condition now as 'active/inactive', because:
- After all the moves, the object is idle, not inactive. You need an antitrigger to make it inactive.
- For the catwalk blade: when the blades have been activated then they won't start moving for some moments.

TriggerGroup= 1, $5000, X, $36, > ; defining the blade with its X ID code you see in Room Editor
$9000, X, $30E,> ; if X blade is active (or else the condition will be true even if the blade is not active)
$2000, 256, $1510, > ; put the actual status into Global Short Alfa1 (GSA1) variable
Y

Y values are:
$8000, 16, $2B; GSA1 is 0: the blade is not moving
$8000+TGROUP_NOT, 16, $2B; GSA1 is not 0: the blade is moving

Notes:

- In the case of plinth blades, 'moving' means the two short moves now, including the short stop between them.
- You can achieve something similar, in a more complicated way, if you use animation and frame conditions for the blade.

Command:
Make X Squishy Block2 fall down in Y tick frames

TriggerGroup= 1, $5000, X, $36, > ; defining the block with its X ID code you see in Room Editor
$2000, 261, $W015 ; put the number at W0 position of PARAM_BIG_NUMBERS into the time property (W0 is 0 in this example, W0 must be typed in hexadecimal format now in the trigger code)
Parameters= PARAM_BIG_NUMBERS, Z

Y values are from 1 to 59 tick frames.
Z must be 60 minus Y.

Activate an F118 in „single” mode for TriggerGroup#1 to modify (increasing/decreasing) the default timer that is just being counted down.

Notes:

- The command is useless if the block isn’t triggered (activated). (So I recommend first activating TriggerGroup#1 to adjust the feature and then a common trigger to activate the block with the new feature.)
- The Squishy Block2 commands and conditions in this tutorial are useless for Squishy Block slot.

Command:
W enable/disable X Squishy Block2 to fall down in Y way

Use the same formula just as above. - But this time don’t use single F118:
You need a continous activation, so the block activated will be disabled: it will shiver, but won’t fall down, using Y type of quake. (See my monster customization tutorial, the energy effect of setha attack, to understand why the quake is different with different Y values.) If you stop the continuous activation, then the block will be enabled again, it will fall in Z minus Y tick frames.

Activate an F118 in “continuous” mode for TriggerGroup#1 to start the continous activation. – Activate an F192 for the same TriggerGroup to stop the continous activation.
Or activate TriggerGroup#1 with a GlobalTrigger, with a continuous condition (eg. GT_ALWAYS) to start the continous activation. – If the condition goes false or you disable the GlobalTrigger with an F109 that will stop the continous activation.

Condition:
If X Squishy Block2 falls down in V exactly/more/less than Y tick frames

TriggerGroup= 1, $5000, X, $36, > ; defining the block with its X ID code you see in Room Editor
$2000, 256, $1510, > ; put the falling time into Global Short Alfa1 (GSA1) variable
$8000, 16, $W0V, >; if GSA1 is the number at W0 position of PARAM_BIG_NUMBERS, W0 (must be typed in hexadecimal format now in the trigger code)is 0 in this example
U
Parameters= PARAM_BIG_NUMBERS, Z, 60

See Y values above.

V values are:
26 – for a “smaller” condition (this time Y must be the original Y minus 1, so eg. if you want a “smaller than 100” condition, then Y is 99)
27 – for a “bigger” condition
28 – for an “equal” condition

U values are:
- if Y=26: $8000, 16, $W127 ; if if GSA1< than the number at W1 position of PARAM_BIG_NUMBERS, W1 (must be typed in hexadecimal format now in the trigger code)is 1 in this example. (Without this trigger, the condition will remain true even after the block has fallen.)
- if Y=27: $8000, 16, $129; if GSA1>=1. (Without this trigger, the condition will be true even before the start of the fall.)
- if Y=28: no need for U

Condition:
If X Seth Blade has Y general status*

TriggerGroup= 1, $5000, X, $36, > ; defining the blade with its X ID code you see in Room Editor
$9000, X, $30E,> ; if X blade is active (or else the condition will be true even if the blade is not active)
$2000, 256, $1510, > ; put the actual status into Global Short Alfa1 (GSA1) variable
Y

Y values are:
$8000, 16, $2B; if GSA1=0: the trap is idle in the upper position or the double blades are just moving upwards
$8000, 16, $2A; if GSA1<0: the double blades are just moving downwards
$8000, 16, $129; if GSA1>=1: the double blades just hit the ground

Note:
You can achieve something similar, in a more complicated way, if you use animation and frame conditions for the blade.

Command:
Make X Seth Blade strike in Y tick frames

TriggerGroup= 1, $5000, X, $36, > ; defining the blade with its X ID code you see in Room Editor
$2000, 261, $W017 ; put the number at W0 position of PARAM_BIG_NUMBERS into the time property (W0 is 0 in this example, W0 must be typed in hexadecimal format now in the trigger code)
Parameters= PARAM_BIG_NUMBERS, Y

Y values are from 1 or bigger tick frames.

Activate an F118 in „single” mode for TriggerGroup#1 to modify (increasing/decreasing) the default timer that is just being counted down.

Notes:

- If the blades haven't been activated when you activate the combination, then the timer starts when you activate the blades after that.
- Though it is not a general knowledge, seth blades are working not only with negative OCB numbers, but positive OCB numbers:

= As you know, a negative OCB number means the trap will start moving in a time which is defined the OCB number (as tick frames), and, after that, the trap won't move any more.
= A positive OCB number means the trap will start moving in a time which is defined the OCB number (as tick frames), and, after that, the trap will start moving again (according to that time). An antitrigger means a pause for those moves.

So Y tick frames overwrite that OCB value (only for the next strike!), but never overwrite the original meaning (one shot work or not) of the OCB value.

Command:
Remove “the trap will be reactivated when a savegame has been loaded” bug of X Seth Blade

GlobalTrigger= 1, IGNORE, GT_LOADED_SAVEGAME, IGNORE, IGNORE, 1, IGNORE
TriggerGroup= 1, $5000, X, $36, > ; defining the blade with its X ID code you see in Room Editor
$2000, 255, $17; force 0 for the trap timer

Condition:
If X Seth Blade has the next strike in Z exactly/more/less than Y tick frames

TriggerGroup= 1, $5000, X, $36, > ; defining the blade with its X ID code you see in Room Editor
$2000, 256, $1710, > ; put the timer value into Global Short Alfa1 (GSA1) variable
$8000, 16, $W0Z, >; if GSA1 is the number at W0 position of PARAM_BIG_NUMBERS, W0 (must be typed in hexadecimal format now in the trigger code)is 0 in this example
V
Parameters= PARAM_BIG_NUMBERS, Y, U

U is the actual maximum value of the timer. Always a positive number. (So eg. if you typed 60 into OCB for 60 tick frames, then U is 60.)

Z values are:
26 – for a “bigger” condition (this time Y must be the original Y plus 1, so eg. if you want a “bigger than 50” condition, then Y is 51)
27 – for a “smaller” condition
28 – for an “equal” condition

V values are:
- if Y=26: $8000, 16, $W127 ; if if GSA1< than the number at W1 position of PARAM_BIG_NUMBERS, W1 (must be typed in hexadecimal format now in the trigger code)is 1 in this example. (Without this trigger, the condition will be true even before the activation of the object.)
- if Y=27: $8000, 16, $129; if GSA1>=1. (Without this trigger, the condition will be true even if the active trap is idle in the upper position.)
- if Y=28: no need for V

-------------------------
*: If you experience bad condition results after antitriggering (and then, maybe re-triggering) the trap, then avoid the condition if you want to antitrigger the trap.
------------------

Made using TRNG 1.2.2.7.
AkyV is offline  
Closed Thread

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 17:05.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Tomb Raider Forums is not owned or operated by CDE Entertainment Ltd.
Lara Croft and Tomb Raider are trademarks of CDE Entertainment Ltd.