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 11-05-15, 15:11   #1
AkyV
Moderator
 
Join Date: Dec 2011
Location: Hungary
Posts: 2,376
Default TRNG – Earthquake 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 Beta1) 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.


Classic earthquakes

If you activate an EARTHQUAKE object (placed anywhere in the map) then that will perform a continuous, murmuring (with Sound ID107: EARTHQUAKE_LOOP) earthquake in the whole map – till the deactivation of the object.
Some other situations will also perform some quake: see eg. some classic WADMerger AnimCommands or eg. a SQUISHY_BLOCK2 when falling down etc.

But there are more classic FLIPEFFECT triggers too, to perform quakes:

a, F1: a soft, short, dumb earthquake (single trigger).
b, F7: a harder, dumb earthquake:

- If the activator is Lara or some other activator, then it is a multiple trigger (so the quake is constantly at the maximum, till the conditions are all true. If one of them goes false, then the intensity will start decreasing at once).
- With some other activators, it is a single trigger (so the quake will start decreasing at once).

c, F11: it will perform a short quake with an “explosion” sound (Sound ID105: EXPLOSION1).

Known bugs:

- An active EARTHQUAKE object will activate all the FLAME_EMITTER objects (with any OCB) in its room, unintentionally. (Not including other FLAME… objects.)
- Don’t place an EARTHQUAKE in your level if you want to use F7 triggers or else F7 (and “Heavy Earthquake” classic AnimCommands, too) will be buggy.
- The F11 quake works like a single trigger, its sound works like a multiple trigger. So, basically, the trigger is buggy, starting the sound continuously, while the conditions are true. That is why you should force a single method for the trigger, to fix the bug.

See more about here multiple and single triggers:

http://www.tombraiderforums.com/showthread.php?t=205371


Command:
Start a decreasing earthquake with X starting intensity

If you activate the command then an earthquake starts at once with X intensity in the whole level. The intensity starts decreasing at once, till reaching 0 - when the quake stops.

TriggerGroup= 1, $2000, 263, $W0FF, >; set the number at W0 position of PARAM_BIG_NUMBERS in Current Value variable, W0 (must be typed in hexadecimal format now in the trigger code) is 0 in this example
$2000, 284, $FF, > ; invert the sign in Current Value
$2000, 278, $5 ; adjust the value of Current Value as the earthquake intensity
Parameters= PARAM_BIG_NUMBERS, X

X could be any positive number (I recommend an X that can be divided by 5). So if X is big then the starting intensity will be big!
The bigger X is the further the quake lasts.

Activate an F118 in „single” mode for TriggerGroup#1 to start the quake.

Note:
The quake will be dumb.

Command:
Start a standard earthquake with X intensity

Use the same formula just as above.
But this time don’t use single F118, but activate the quake in another way:

- Activate an F118 in “continuous” mode for TriggerGroup#1 to start the quake. – Activate an F192 for the same TriggerGroup to make the intensity decrease till it reaches 0 and the quake stops.
- Or activate TriggerGroup#1 with a GlobalTrigger, with a continuous condition (eg. GT_ALWAYS) to start the quake. – If the condition goes false or you disable the GlobalTrigger with an F109 that will make the intensity decrease till it reaches 0 and the quake stops.

Condition:
If the intensity of the actual earthquake is Y equal/less/more than X

TriggerGroup= 1, $2000, 277, $5, > ; put the actual earthquake intensity into Current Value variable
$8000, 255, $W0Y ; if Current Value 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, X

Y values are:
26 – for a “bigger” condition (this time X must be the original X plus 1, so eg. if you want a “bigger than 50” condition, then X is 51)
27 – for a “smaller” condition
28 – for an “equal” condition (It is almost impossible to make this condition true, so it is not recommended!)

X values are different, due to the type of the quake. Here are the values of some quakes, based on my experiences:

- A quick, single quake with F1 trigger: it jumps to -60 when Lara steps on the trigger square. It starts decreasing immediately by five: -55, -50, -5, 0.
- A continuous quake with F7 trigger while Lara is on the trigger square: it jumps to a constant -145 while Lara is on the trigger square. If Lara leaves the square then it starts decreasing by five: -140, -135, -5, 0.
- F7 activated not (directly) by Lara (i.e. by switch, Heavy etc.): it uses the same -145, -140, -135, -5, 0 sequence as above. But this time the quake will be quick, without a pause at -145 intensity.
- 'Soft earthquake' animcommand: it works the similar way as F1 quake does. But the sequence could be a bit improper, for example: -56, -51, -4, 1, 0 or -53, -48, -3, 2, 0. (Be careful - if you use F1 just after a soft quake animcommand, that probably makes the F1 sequence also improper temporarily.)
- 'Heavy earthquake' animcommand: it works the same way as the 'F7 activated not (directly) by Lara' case.
- Rumbling RAISING_BLOCK (with OCB=1): this sequence: 27, 11, 27, 22, 17, 12, 7, 2, -3, 0.
- SQUISHY_BLOCK2: this sequence when rumbling: 41, 40, 39, 13, 12, 7, 2, -3, 0 and this one when hitting the floor: 91, 86, 81,11, 6, 1, -4, 0.

But be very careful - sometimes the signs will be inverted by themselves! So eg. maybe a heavy earthquake will run in a 145, 140, 135, 5, 0 sequence, not in a -145, -140, -135, -5, 0 one. (So test carefully your earthquakes under the actual settings of the level if you use this condition!)

If you find another quake type then you can get the intensity values in the way you read here:
Hidden Triggers tutorial, Chapter I-17 (about Diagnostics and Log).

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.

Note:
F284 (between the two original triggers of the formula) will invert the sign in Current Value if the value is negative.
If a sequence can have two signs, then we won't study the unimportant part. Eg. at 'soft earthquakes' the 'unimportant part' is the positive one: 2. So we'll study only the negative part, changing the sign, using F284. If you want to study the positive part of a sequence, then don’t use F284. You can’t study both the positive and negative parts now.

Command:
Make X earthquake object start a decreasing quake with Y starting intensity

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

The usual intensity of an earthquake object is randomly between 1 and 109 (usually being at near the maximum or the minimum, but including a sharp but short increasing and a sharp but short decreasing intensity part between them). If you force a value in that interval, then that won't have any important effect. That's why you will force a value above 109 - that will start decreasing (continuously) at once to the 1-109 random interval.
So Y must be 110 or bigger.

Activate an F118 in „single” mode for TriggerGroup#1 to start the quake.

Note:
The command is useful only if the object is active.

Command:
Make X earthquake object start a standard quake with Y intensity

Use the same formula just as above.
But this time don’t use single F118, but activate the quake in another way:

- Activate an F118 in “continuous” mode for TriggerGroup#1 to start the quake. – After that. activate an F192 for the same TriggerGroup to make the quake act as if you just started that formula just above.
- Or activate TriggerGroup#1 with a GlobalTrigger, with a continuous condition (eg. GT_ALWAYS) to start the quake. – After that, if the condition goes false or you disable the GlobalTrigger with an F109 that will make the quake act as if you just started that formula just above.

Condition:
If the quake intensity of X earthquake object is Z equal/less/more than Y

TriggerGroup= 1, $5000, X, $36, > ; defining the object with its X ID code you see in Room Editor
$2000, 256, $1510, > ; put the actual intensity 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
$8000, 16, $129 ; if GSA1 >=1 (or else the „smaller” condition will be true even if the object is inactive)
Parameters= PARAM_BIG_NUMBERS, Y

See Y values above.

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

Note:
How a nice idea to activate a rollingball if the quake intensity is big, saying “the quake has made the boulder lose its balance”.

Condition:
If the intensity phase of X earthquake object is Y

TriggerGroup= 1, $5000, X, $36, > ; defining the object with its X ID code you see in Room Editor
$2000, 256, $1600, > ; put the actual phase into Global Byte Alfa1 (GBA1) variable
Y

Y values are:
- $8000, 0, $142B: if GBA1=20 - the intensity is decreasing or fluctuating around the minimum
- $8000, 0, $1529: if GBA1>=21 - the intensity is increasing or fluctuating around the maximum

Command:
Make actual intensity phase of X earthquake object be performed for further Y tick frames

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

Y is the required frame number. (Maximum for about 18 minutes.)

The longest time interval is about 200 frames originally. So if you force a definitely bigger number than 200 that will keep the intensity permanently at the minimum (in decreasing phase) or at the maximum (in increasing phase).

Activate an F118 in „single” mode for TriggerGroup#1 to force the phase.

Note:
The earthquakes start with a pretty short 'fluctuating around the maximum' part before it starts decreasing. So if you activate the command before activating the earthquake object then - activating the earthquake object - the command will affect always the increasing phase.

Command:
Start actual intensity phase of X earthquake object being held forever

Use the same formula just as above.
But this time don’t use single F118, but force the phase in another way:

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

Condition:
If X earthquake object keeps actual intensity phase for further Y tick frames

TriggerGroup= 1, $5000, X, $36, > ; defining the object with its X ID code you see in Room Editor
$2000, 256, $1710, > ; put the actual frame into Global Short Beta1 (GSB1) variable
$8000, 18, $W028 ;if GSB1 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

Note:
The solution will be buggy if you use this condition in the first second after triggering the earthquake.

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 03:04.


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