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 13-02-15, 07:36   #1
AkyV
Moderator
 
Join Date: Dec 2011
Location: Hungary
Posts: 2,505
Default TRNG Sky control with variables

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.

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

Don't forget: PARAM_BIG_NUMBERS position ID in the triggers, after the $ sign, must be typed in hexadecimal format!

Command:
X enable/disable horizon

This command could be useful eg. if you use a low farview, and Lara enters a small room. If the level has a horizon, then you will see that (irrationally) on the stone room wall texture. But if you disable the horizon when Lara enters the room, then the player will see the black (or maybe colored) distance fog of the low farview on the wall. – Put another trigger on the other side of the room entrance, to enable the horizon again, if Lara leaves the room.

TriggerGroup= 1, $2000, 263, $Z0FF, > put the number at Z0 position of PARAM_BIG_NUMBERS (Z0 is 0 in this example) into Current Value variable
$2000, 278, $4 ;put the value of Current Value into the level flag field.
Parameters= PARAM_BIG_NUMBERS, Y0

Activate an F118 in “single” or “multiple” mode for TriggerGroup#1 to enable/disable the horizon.

Y0 values are:
- if X is “enable”, then Y0 is 4, plus the aggregated values of all the other existing level flags.
- if X is “disable”, then Y0 is the aggregated values of all the existing level flags. (Horizon level flag doesn’t exist now.)

Level flag values are:

1: YoungLara
2: Weather
4: Horizon
8: Layer1
16: Layer2
32: StarField
64: Lightning
128: Train
256: Pulse
512: ColAddHorizon
1024: ResetHUB
2048: LensFlare
4096: Timer
8192: Mirror
16384: RemoveAmulet
32768: NoLevel

So, for example, if it is a level for the young Lara, with Layer1 on the sky, without other existing level flags in the script, then Y0 must be 1+8+4= 13, if you want to activate an F118 to enable the horizon.
Or, if the existing flags are Train (128), ResetHUB (1024) and Horizon (4), then Y0 must be 128+1024=1152, if you want to activate an F118 to disable the horizon.

Condition:
If horizon is X enabled/disabled

TriggerGroup= 1, $2000, 277, $4, >; put the level flag field.value into Current Value variable
$8000, 255, $Y028,> ;if Current Value is the number at Y0 position of PARAM_BIG_NUMBERS (Y0=0: first position, 1: second position etc.), Y0 is 0 in this example
W ;
Parameters= PARAM_BIG_NUMBERS, X0, X1, X2 etc.

W is one or more copies of this trigger:
$8000+TGROUP_OR, 255, $YV28: if Current Value is the number at YV position of PARAM_BIG_NUMBERS. V is 1, 2 etc., so YV values are Y1 second position, Y2 third position etc.

Let’s see some examples:

Only Horizon flag exists, you want to study if that is just enabled (so if flag aggregated value is 4 or not):

TriggerGroup= 1, $2000, 277, $4, >
$8000, 255, $028
Parameters= PARAM_BIG_NUMBERS, 4

Only Horizon flag exists, you want to study if that is just disabled (so if flag aggregated value is 0 or not):

TriggerGroup= 1, $2000, 277, $4, >
$8000, 255, $028
Parameters= PARAM_BIG_NUMBERS, 0

Only Horizon, YoungLara and Layer1 flags exist, you want to study if horizon is just enabled (so if flag aggregated value is 1+8+4=13 or not):

TriggerGroup= 1, $2000, 277, $4, >
$8000, 255, $028
Parameters= PARAM_BIG_NUMBERS, 13

Only Horizon, Train and ResetHUB flags exist, you want to study if horizon is just disabled. You also want to disable Train and ResetHUB in the level, so flag aggregated values are:
- Horizon is just disabled, Train and ResetHUB are just enabled: 0+128+1024= 1152
- Horizon and Train are just disabled, ResetHUB is just enabled: 0+0+1024= 1024
- Horizon and ResetHUB are just disabled, Train is just enabled: 0+128+0= 128
- Horizon, Train and ResetHUB are all disabled: 0+0+0= 0

TriggerGroup= 1, $2000, 277, $4, >
$8000, 255, $028,>
$8000+TGROUP_OR, 255, $128, >
$8000+TGROUP_OR, 255, $228, >
$8000+TGROUP_OR, 255, $328
Parameters= PARAM_BIG_NUMBERS, 1152, 1024, 128, 0

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 layer1/2 is X enabled/disabled

See above (“Condition: If horizon is X enabled/disabled”) to understand how it works.
See above (“Command: X enable/disable horizon”) how you can choose between layer1 (now the flag is 8) and layer2 (now the flag is 16).

Notes:
- See F150 if you want to enable or disable a layer.
- Don’t forget: valid “enabled” layers must have a color defined with a trigger, if you don’t have a Layer Script command for that, so if you activated an F150 for the layer.

Condition:
If lightning is X enabled/disabled

See above (“Condition: If horizon is X enabled/disabled”) to understand how it works.
See above (“Command: X enable/disable horizon”) that you need flag value 64 for the lightning.

Note:
See F151 if you want to enable or disable the lightning.

Command:
X enable/disable ColAddHorizon

This command could be useful eg. if you swap the horizon on the level with F344 and only one of the horizons need ColAddHorizon.

See above (“Command: X enable/disable horizon”) to understand how it works. (You need flag value 512 for ColAddHorizon.)

Note:
If you enable ColAddHorizon, that will also enable the actual horizon.
But if you disable ColAddHorizon, that won’t disable the actual horizon.

Condition:
If ColAddHorizon is X enabled/disabled

See above (“Condition: If horizon is X enabled/disabled”) to understand how it works.

Command:
X enable/disable LensFlare

This command could be useful eg. if you want to “switch off” the sun disk in each room of the level, without making a flipped room for the NL button in all the rooms of the level where you can see the sun.

See above (“Command: X enable/disable horizon”) to understand how it works. (You need flag value 2048 for LensFlare.)

Important!
Now you need a LensFlare Script command everyway. (So if you want to start your level without a sun disk, that will be switched on only later, then the Script command will enable the sun, but a command like that will disable it at once, because Lara object is standing on an F118 trigger.)

Condition:
If LensFlare is X enabled/disabled

See above (“Condition: If horizon is X enabled/disabled”) to understand how it works.

Condition:
If X layer1/2 is moving in Y direction

Y: the layer is idle:

TriggerGroup= 1, $2000, 277, $X, >; put the layer direction.value into Current Value variable
$8000, 0, $30 ;if Current Value is 0

X values are:
13 – layer1
14 – layer2

Y: the layer is going northwards (Room Editor facing):

TriggerGroup= 1, $2000, 277, $X, >; put the layer direction.value into Current Value variable
$8000, 1, $2E, >; if Current Value >= 1
$8000, 128, $2F ; if Current Value < 128

Y: the layer is going southwards (Room Editor facing):

TriggerGroup= 1, $2000, 277, $X, >; put the layer direction.value into Current Value variable
$8000, 128, $2E, >; if Current Value >= 128
$8000, 256, $2F ; if Current Value < 256

Notes:
- The condition is naturally useful only if the required layer is enabled.
- See F153 for a new direction of the layers:

= 0: stop the layer
= any value between 1 and 127: going northwards (Room Editor facing)
= any value between 128 and 255: going southwards (Room Editor facing)

- If you are using both Layer1 and Layer2 at the same time, the intervals are swapped for each other: 1-127 is the south interval, and 128-255 is the north one. (But only for Layer2!)

Condition:
If X layer1/2 has Y equal/bigger/smaller speed than Z

TriggerGroup= 1, $2000, 277, $X, >; put the layer speed.value into Current Value variable
$8000, 2, $F, > ;if TriggerGroup#2 is true
$8000+TGROUP_OR, 3, $F, > ; if TriggerGroup#3 is true
$8000+TGROUP_OR, 4, $F ; if TriggerGroup#4 is true
TriggerGroup= 2, $8000, 128, $2F, > ; if Current Value < 128
$8000, Z, $Y ; if Current Value=Z
TriggerGroup= 3, $8000, 128, $2E, >; if Current Value >= 128
$8000, 255, $2F, > ; if Current Value < 255
$2000, 284, $FF, > ;turn the sign in Current Value
$2000, 231, $7FFF, > ;add 127 to Current Value
$2000, 231, $7FFF, > ;add 127 to Current Value once more
$2000, 231, $1FF, > ;add 1 to Current Value
$8000, Z, $Y ; if Current Value=Z
TriggerGroup= 4,$8000, 255, $30, > ; if Current Value=255
$2000, 233, $7FFF, > ;subtract 127 from Current Value
$2000, 233, $7FFF, > ;subtract 127 from Current Value again
$8000, Z, $30 ; if Current Value=Z

X values are:
13 – layer1
14 – layer2

Y values are:
2E – for a “bigger” condition (this time Z must be the original Z plus 1, so eg. if you want a “bigger than 100” condition, then Z is 101)
2F – for a “smaller” condition
30 – for an “equal” condition

Z values are:
0: idle
1: minimum
127: maximum
from 2 to 126: other speed

In the case of south direction, the original 128-255 speed values you adjusted are re-calculated in the condition this way:
Minus version of the speed, plus 255, so they will follow the same scale (1-127) that the north direction follows. For example, 128 south maximum speed will be -128+255= 127. Or South Speed 180 will be -180+255= 75. Etc.
There is an exception: no pair for South Speed 255 value in the north scale, so it works as if it were South Speed 254 value (i.e. North Speed 1 value).

Condition:
If volumetric FX is X enabled/disabled

TriggerGroup= 1, $2000, 277, $15, >; put the VFX status into Current Value variable
$8000, X, $30 ;if Current Value is X

X values are:
0 – enabled
1 - disabled

Made using TRNG 1.2.2.7.

Last edited by AkyV; 08-07-16 at 10:34.
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:14.


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