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 07-07-15, 12:32   #1
AkyV
Moderator
 
Join Date: Dec 2011
Location: Hungary
Posts: 2,505
Default TRNG – Rollingball and Spikes special

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 Byte Alfa1, 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.

Command:
Adjust Y speed for X Rollingball in Z direction

This command is a great tool to make the ball roll down slow in a sharp slope or to shoot it out fast on a totally horizontal floor like a cannonball etc.

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

You need a continous activation. If you stop it, then the the ball will roll 'according to the rules of physics'.
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.

Z values are:
15 – north/south speed (Room Editor facing)
16 – east/west speed (Room Editor facing)

Y values are:
Positive numbers (south/east direction), negative numbers (north/west direction), 0 (no speed). (Approximately?) each 512 means the speed of the ball is just enough for a one square long travel.
So eg. 512 means the chafe between the ball and the floor will slow down the ball that will stop after further one square long travel - except, naturally, if the ball gets on a slope down (that makes the speed bigger) or encounter an obstacle (that stops or slows down the ball) in the meantime.
Another example: -1792=-3,5x512 means: in the given moment the speed of the ball - rolling in the north or west direction - is just enough for a 3,5 squares long travel, before the chafe stops the ball.

Notes:
- The command is useless if the ball isn’t triggered (activated).
- If an obstacle should stop the ball, then the ball will be stuck there, rolling with the forced speed. This is unreal, naturally, so you should place a HEAVY trigger on that square, that stops the continuous activation with F192 or F109.
- Naturally the command is recommended mostly if the ball moves in one of the main (north, south, east, west) directions. If the ball moves eg. northwestwards, then the real speed of the ball is a bit complicated, based on the Pythagorean theorem:
Real speed on the second power equals with north/south speed on the second power plus east/west speed on the second power.

Condition:
If the speed of X Rollingball is Z exactly/less/more than Y in V direction

V: if the ball moves northwards (Room Editor facing):

TriggerGroup= 1, $5000, X, $36, > ; defining the rollingball with its X ID code you see in Room Editor
$9000, X, $30E,> ; if X rollingball is active (or else the condition will be true even if the ball has not been activated yet – if you force a speed on the ball before its activation)
$2000, 256, $1510, > ; put the actual speed into Global Short Alfa1 (GSA1) variable
$2000, 284, $10, > ; turn the sign in GSA1
$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
Parameters= PARAM_BIG_NUMBERS, Y

V: if the ball moves southwards (Room Editor facing):

TriggerGroup= 1, $5000, X, $36, > ; defining the rollingball with its X ID code you see in Room Editor
$9000, X, $30E,> ; if X rollingball is active (or else the condition will be true even if the ball has not been activated yet – if you force a speed on the ball before its activation)
$2000, 256, $1510, > ; put the actual speed 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
Parameters= PARAM_BIG_NUMBERS, Y

V: if the ball moves westwards (Room Editor facing):

TriggerGroup= 1, $5000, X, $36, > ; defining the rollingball with its X ID code you see in Room Editor
$9000, X, $30E,> ; if X rollingball is active (or else the condition will be true even if the ball has not been activated yet – if you force a speed on the ball before its activation)
$2000, 256, $1610, > ; put the actual speed into Global Short Alfa1 (GSA1) variable
$2000, 284, $10, > ; turn the sign in GSA1
$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
Parameters= PARAM_BIG_NUMBERS, Y

V: if the ball moves eastwards (Room Editor facing):

TriggerGroup= 1, $5000, X, $36, > ; defining the rollingball with its X ID code you see in Room Editor
$9000, X, $30E,> ; if X rollingball is active (or else the condition will be true even if the ball has not been activated yet – if you force a speed on the ball before its activation)
$2000, 256, $1610, > ; put the actual speed 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
Parameters= PARAM_BIG_NUMBERS, Y

See Y values above.

If Y is negative, then turn the sign in PARAM_BIG_NUMBERS! (So eg. if Y=-1024, then type 1024 in PARAM_BIG_NUMBERS.) – It is important, because PARAM_BIG_NUMBERS doesn’t like conditions with negative numbers.

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

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 Rollingball is just moving in Y direction

TriggerGroup= 1, $5000, X, $36, > ; defining the rollingball with its X ID code you see in Room Editor
$2000, 256, $1510, > ; put the actual north/south speed into Global Short Alfa1 (GSA1) variable
$2000, 256, $1611, > ; put the actual east/west speed into Global Short Alfa2 (GSA2) variable
Y

Y values are:

- $8000, 16, $2A, $8000, 17, $2B; if GSA1<0 and GSA2=0: exactly northwards (Room Editor facing)
- $8000, 16, $129, $8000, 17, $2B; if GSA1>=1 and GSA2=0: exactly southwards (Room Editor facing)
- $8000, 17, $2A, $8000, 16, $2B; if GSA2<0 and GSA1=0: exactly westwards (Room Editor facing)
- $8000, 17, $129, $8000, 16, $2B; if GSA2>=1 and GSA1=0: exactly eastwards (Room Editor facing)

Command:
Adjust Y extension speed for X Teeth Spikes

TriggerGroup= 1, $5000, X, $36, > ; defining the teeth spikes 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 speed property (W0 is 0 in this example, W0 must be typed in hexadecimal format now in the trigger code)
Parameters= PARAM_BIG_NUMBERS, Y

You need a continous activation (see above, how). If you stop it, then the speed of the spikes will be 'normal'.

Y values are from 1 to (about) 850.

Notes:

- Customized teeth spikes seem less dangerous than usual. Probably you need a GlobalTrigger that hurts/kills Lara if she collides with the spikes.
- Usually teeth spikes are 'bouncing'. If you force the speed then they will not.
- If the speed is too slow (i.e. closer to 0) then the spikes will not have enough time to be drawn back totally, so they will jump up again before reaching the floor level.

Condition:
If X Teeth Spikes are totally extended

TriggerGroup= 1, $5000, X, $36, > ; defining the teeth spikes with its X ID code you see in Room Editor
$2000, 256, $1510, > ; put the actual status into Global Short Alfa1 (GSA1) variable
$8000, 16, $2B ; if GSA1=0

Note:
The spikes are 'bouncing' so they reach the top position twice at each extension.

Command:
Adjust Y tick frames for the extension time of X Teeth Spikes

'Extension time' counted from when the spikes starting drawing back after the bounce, till the spikes shoot out of the ground the next time.

Method#1

GlobalTrigger= 1, IGNORE, GT_CONDITION_GROUP, IGNORE, 1, 2, IGNORE
TriggerGroup= 1, $5000, X, $36, > ; defining the teeth spikes with its X ID code you see in Room Editor
$2000, 256, $1700, > ; put the actual time into Global Byte Alfa1 (GBA1) variable
$8000, 0, $W028 ;if GBA1 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
TriggerGroup= 2, $5000, X, $36, > ; defining the teeth spikes with its X ID code you see in Room Editor
$2000, 255, $Z17; force Value Z for the time (Z is the hexadecimal version of Value Y)
Parameters= PARAM_BIG_NUMBERS, 64

Method#2

GlobalTrigger= 1, IGNORE, GT_CONDITION_GROUP, IGNORE, 1, 2, IGNORE
TriggerGroup= 1, $5000, X, $36, > ; defining the teeth spikes with its X ID code you see in Room Editor
$2000, 256, $1510, > ; put the actual speed into Global Short Alfa1 (GSA1) variable
$8000, 16, $2B ; if GSA1=0
TriggerGroup= 2, $5000, X, $36, > ; defining the teeth spikes 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

Differences between method#1 and #2:

- Bouncing spikes:
#1: looks nicely
#2: no bouncing

- Y values are (the default is 64 tick frames):
#1: from 1 to 63 tick frames
#2: from 1 to any tick frames

Notes:

- Customized teeth spikes seem less dangerous than usual. Probably you need a GlobalTrigger that hurts/kills Lara if she collides with the spikes.
- If the time is too short (i.e. closer to 0) then the spikes will not have enough time to be drawn back totally, so they will jump up again before reaching the floor level.

Condition:
If the next extension of X Teeth Spikes is in Y tick frames

TriggerGroup= 1, $5000, X, $36, > ; defining the teeth spikes with its X ID code you see in Room Editor
$2000, 256, $1710, > ; put the actual extension time 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: see above.

Condition:
If X Teeth Spikes has never been activated before

TriggerGroup= 1, $5000, X, $36, > ; defining the teeth spikes with its X ID code you see in Room Editor
$2000, 256, $2700, > ; put the actual status into Global Byte Alfa1 (GBA1) variable
$8000, 0, $W028; if GBA1 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, 48

This condition is useful because C14 condition (which works not only with 'enemies', though the trigger name is about 'creatures') doesn't work with non-creatures in the case of 'Enemy has not been yet activated' condition.

Note:
And one more thing about C14 in the case of teeth spikes: 'Enemy is active' means 'the spikes are sticking out' and 'Enemy is not active' means 'the spikes are totally drawn back'. So teeth spikes are 'not active' even they are triggered but they are totally drawn back. So these are not 'triggered' or 'antitriggered' conditions now. - So be careful with C14 in the case of teeth spikes!
(In the cases of other non-living objects 'active' equals with 'triggered' and 'not active' equals with 'antitriggered'.)

Command:
Adjust Y rotating speed for X Joby Spike

TriggerGroup= 1, $5000, X, $36, > ; defining the joby spike with its X ID code you see in Room Editor
$2000, 256, $1510, > ; put the actual speed into Global Short Alfa1 (GSA1) variable
$8000, 16, $129,>; if GSA1>=1
$2000, 261, $W015,> ; put the number at W0 position of PARAM_BIG_NUMBERS into the speed property (W0 is 0 in this example, W0 must be typed in hexadecimal format now in the trigger code)
$8000+TGROUP_ELSE, 16, $2A,> ; if GSA1<0
$2000, 263, $10,>; put the number at W0 position of PARAM_BIG_NUMBERS into GSA1 (W0 is 0 in this example, W0 must be typed in hexadecimal format now in the trigger code)
$2000, 284, $10, > ; turn the sign in GSA1
$2000, 257, $1510; put the number in GSA1 into the speed property
Parameters= PARAM_BIG_NUMBERS, Y

When the joby spike has been triggered, first it rotates slowly, but after some seconds it reaches the maximum of its rotation speed.

Y values are:
From 1 to (about) 32000. (Above 10000, the spike rotates very fast. 4100-whatever is the default maximum value.)

Use the command in one of these ways:

- Single activation, forced speed below the maximum: the speed jumps to the new value (increasing/decreasing the actual speed) then accelerates till reaching the maximum.
- Single activation, forced speed above the maximum: the spike will apply and keep the forced speed value.
- Continuous activation, forced speed below the maximum: the spike will apply and keep the forced speed value. When stopping the activation: the speed will increase to the maximum.

If you need a single activation, then activate an F118 in „single” mode for TriggerGroup#1 to adjust the speed.
If you need a continous activation – then see above („Adjust Y speed for X Rollingball in Z direction”) what your possibilities are.

Notes:

- The TriggerGroup is a bit complicated because the direction of the rotation seems random: the game will “decide” that the spike will be activated with clockwise or anti-clockwise rotation. And the speed value is positive in anti-clockwise case, but negative in clockwise case.
- If the joby spike goes mad after you've loaded a savegame that means the game tries to perform both the clockwise and anti-clockwise directions at once. Load the savegame again (and again) to solve the problem (I can't see other solution now).
- You cannot invert or adjust the direction.

Condition:
If the rotating speed of X Joby Spike is Y

TriggerGroup= 1, $5000, X, $36, > ; defining the joby spike with its X ID code you see in Room Editor
$9000, X, $30E, > ; if X joby spike is active (or else the condition will remain true after you antitriggering the spike)
$2000, 256, $1510, > ; put the actual speed into Global Short Alfa1 (GSA1) variable
$8000, 16, $129,>; if GSA1>=1
$8000, 16, $W026, > ;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
$8000, 16, $W127, > ;if GSA1 is 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
V, > ; for anti-clockwise rotation
$8000+TGROUP_ELSE, 16, $2A,> ; if GSA1<0
$2000, 284, $10, > ; turn the sign in GSA1
$8000, 16, $W026, > ;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
$8000, 16, $W127,> ;if GSA1 is 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
V ; for clockwise rotation
Parameters= PARAM_BIG_NUMBERS, Y1, Y2

V is the executable trigger that will be executed if the speed is the given value.

See Y values above.

I don’t use “equal” conditions, because it is hard to tip an exact speed value (if it is just not a forced speed). Use bigger+smaller conditions instead. For example: if you want to study the “exact 2000” (Y=2000) speed, then you should study an interval instead, eg. 1900-2100.
$8000, 48, $W026, > (Y1 is 1900 in W0 position)
$8000, 48, $W127 (Y2 is 2100 in W1 position)

As you see (see V), this time we need to apply everyway the executable trigger (that will be executed if the condition is true) in the formula. (As you see, this trigger is the same, independently of the direction of the rotation, but you can choose different V triggers if you want.)
That is why this time use the conditions in one of these ways:

- The TriggerGroup (1) ID is referred by a TRIGGER F118 in „single” or „multiple” mode, which is placed in the map.
- The TriggerGroup (1) ID is referred by the IdPerformTriggerGroup field of a GT_ALWAYS GlobalTrigger.

Condition:
If X Joby Spike is rotating Y clockwise/anti-clockwise

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

Y values are:

$8000, 16, $129,>; if GSA1>=1: anti-clockwise
$8000, 16, $2A,> ; if GSA1<0: clockwise

Command:
Adjust Y actual extension length for X Joby Spike

TriggerGroup= 1, $5000, X, $36, > ; defining the joby spike with its X ID code you see in Room Editor
$2000, 261, $W016 ; put the number at W0 position of PARAM_BIG_NUMBERS into the extension 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 0 to (about) 32000. (Probably Value 1260 means one square vertical distance.)

Use the command in one of these ways:

- Single, forced extension below the maximum: the extension jumps to the new value (increasing/decreasing the actual extension) then extends till reaching the maximum.
- Single, forced extension above the maximum: the spike will apply and keep the forced extension value.
- Continuous, forced extension below the maximum: the spike will apply and keep the forced extension value. When stopping it: the extension will increase to the maximum.

Note:
It works even if the spike is inactive.

Condition:
If the actual extension length of X Joby Spike is Y

TriggerGroup= 1, $5000, X, $36, > ; defining the joby spike with its X ID code you see in Room Editor
$9000, X, $30E,> ; if X joby spike is active (or else the condition will be true even if the spike is inactive)
$2000, 256, $1610, > ; put the actual length into Global Short Alfa1 (GSA1) variable
$8000, 16, $W026, > ;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
$8000, 16, $W127 ;if GSA1 is 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
Parameters= PARAM_BIG_NUMBERS, Y

See Y values above.

I don’t use “equal” conditions, because it is hard to tip an exact extension value (if it is just not a forced extension). Use bigger+smaller conditions instead. For example: if you want to study the “exact 2000” (Y=2000) extension, then you should study an interval instead, eg. 1900-2100.
$8000, 48, $W026, > (Y1 is 1900 in W0 position)
$8000, 48, $W127 (Y2 is 2100 in W1 position)

Command:
Adjust Y maximal extension length for X Joby Spike

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

The default Y maximum is when the tip of the spike extending reaches the floor.

Activate an F118 in „single” mode for TriggerGroup#1 to adjust the extension.

Condition:
If the maximal extension length of X Joby Spike is Z exactly/less/more than Y

TriggerGroup= 1, $5000, X, $36, > ; defining the joby spike with its X ID code you see in Room Editor
$2000, 256, $1810, > ; put the maximal extension 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
Parameters= PARAM_BIG_NUMBERS, Y

See Y values above.

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 1024” condition, then Y is 1025)
27 – for a “smaller” condition
28 – for an “equal” condition

Note:
The condition works even if the spike is inactive.

Made using TRNG 1.2.2.7.
AkyV 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 00:12.


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