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 10-04-15, 09:27   #1
AkyV
Moderator
 
Join Date: Dec 2011
Location: Hungary
Posts: 2,377
Default TRNG Fog/ambience light color conditions

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, ColorRGB and GlobalTrigger ID’s and change them if you are already using the ID in another TriggerGroup/ColorRGB/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/ColorRGB/GlobalTrigger ID’s, then you also need to change the TriggerGroup/ColorRGB/GlobalTrigger ID in the trigger (if it is a trigger about a TriggerGroup/ColorRGB/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 Long Alfa, Global Short Alfa1, Global Byte 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.

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

Condition:
If the color of the distance fog/fog bulbs is X

The condition will work for the distance fog if Volumetric FX is just disabled.
The condition will work for fog bulbs if Volumetric FX is just enabled.

Don’t use the condition if the color is defined by a Fog Script command, so use this only if the color is defined by a FLIPEFFECT trigger, with F28 (for fog bulbs) or F224 (for the distance fog).

ColorRGB= 1, X
TriggerGroup= 1, $2000, 291, $130, > ; transform ColorRGB1 color value into a big value in Global Long Alfa (GLA) variable
$2000, 244, $51FF, > ; put the actual fog color value into Current Value variable
$8000, 48, $39 ; if Current Value is equal with GLA

X is the three numbers of the required Red/Green/Blue color code you want to study.

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 Moveable object is in a room with Y darker/lighter/equal V ambience light than Z

TriggerGroup= 1, $5000, X, $36, > ; defining the object with its X ID code you see in Room Editor
$2000, 256, $V10, > ; put the actual V ambience value into Global Short Alfa1 (GSA1) variable
$2000, 256, $2604, > ; put the ambience changing status (just changing or not) into Global Byte Beta1 (GBB1)
$8000, 16, $U0Y, > ;if GSA1 is the number at U0 position of PARAM_BIG_NUMBERS, U0 is 0 in this example
$8000, 4, $2B ; if GBB1=0
Parameters= PARAM_BIG_NUMBERS, W

V is the required ambience light component:

1F – red
20 – green
21 - blue

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

W is always the eightfold of Z. So eg W=8 is Red light (Z)=1, W=512 is Red light (Z)=64, W=1024 is Red light (Z)=128 etc.

Known bug for both ambience light conditions of the tutorial:
It won't work properly until the object comes through doors (portals) between rooms at least once or twice. (Don't misunderstand: it doesn't matter how many doors the object will cross or which ones those doors are. Which matters is the number of crosses so far, but through any doors.) - But each cross matters to prevent the bug only if the given color is different on the two sides of the door!
So use the condition only if you are sure that the object has crossed at least two doors during its lifetime so far, with different colors on each side of the doors.

Note:
We should study “changing status”, because the condition result will be false if the light is just changing in the moment when the object is just going through the door. (That is why GBB1=0 means if the ambience light is not changing.)

Condition:
If V ambience light reflected on X Moveable object changes Y less/more/exactly than Z between two adjacent rooms

So, for example, the red ambience light in Room Editor in Room A is 60 and in Room B is 45. When Lara (if her object ID is X now) steps through the door (portal) between the rooms from Room A into Room B then Z becomes -15, because 45-60= -15.

If Z is positive:

TriggerGroup= 1, $5000, X, $36, > ; defining the object with its X ID code you see in Room Editor
$2000, 256, $V10, > ; put the actual V ambience value into Global Short Alfa1 (GSA1) variable
$8000, 16, $W0Y ;if GSA1 is the number at W0 position of PARAM_BIG_NUMBERS, W0 is 0 in this example
Parameters= PARAM_BIG_NUMBERS, Z

If Z is negative:

TriggerGroup= 1, $5000, X, $36, > ; defining the object with its X ID code you see in Room Editor
$2000, 256, $V10, > ; put the actual V ambience value into Global Short Alfa1 (GSA1) variable
$2000, 284, $10, > ; turn the sign in GSA1
$8000, 16, $W0Y ;if GSA1 is the number at W0 position of PARAM_BIG_NUMBERS, W0 is 0 in this example
Parameters= PARAM_BIG_NUMBERS, Z

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

Note:
The condition won't work if there is no change between two rooms. (i.e. if Z is 0.) - So don't use this condition if the required light component (eg. red) of the adjacent rooms has the same value.

V is the required ambience light component:

23 – red
24 – green
25 - blue

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

Made using TRNG 1.2.2.7.

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


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