Go Back   www.tombraiderforums.com > Tomb Raider Modding > Tomb Raider Level Editor > Tutorials and Resources

Closed Thread
Thread Tools
Old 07-04-21, 12:10   #1
saintjunia's Avatar
Join Date: Jul 2020
Location: Riga, Latvia
Posts: 106
Post Distance fog color change tutorial

A simple flipeffect to change the distance fog color will suffice in some cases (for example, in my level Lara is pushing a block in a tiny space, so the sudden change is not noticeable). The less the difference between the two colors, the better such effect will look. However, there is a way to create a "dynamic" for change via triggers and scripts. You need to have a basic understanding of triggers and scripting to use this, but there are many tutorials here explaining how, say, flipeffects work.

Thanks a lot to Richard_trle for explaining how organizers work and proposing this idea!

STEPS (you can do them in a different order):


Place the F224 trigger somewhere (Weather: fog, set the distance fog color), it can be the same color as the current fog, but we need this trigger to set our numeric variable. Remember that you can customize presets in FLEP. For example, I am using color #3, which is light blue by default, but with FLEP I changed it to RGB 30/40/30.


On the tile of this trigger, put another flipeffect: F232 (Variables: numeric, set & variable with E value). I am using Global Byte Alfa 1 (gba1) and the value 1. You can use different variables. Be careful if your level already uses variables not to overwrite them.

What this means: the "state" of your level when the fog is that color will be marked by this value. So for me, gba1=1 is when the fog is color #3.


Now comes the hard (and interesting) part! We have to create 2 triggergroups and 2 organizers. What we want to do is:
  • reduce for visibility
  • change the fog color "behind the scenes"
  • return fog visibility

Script (don't forget to change the IDs for your triggergroups and organizers accordingly; my numeration is a bit messed up because I have a lot of them and lost track already haha):

Triggergroup= 26, $2000,195,$0264, $2000,127,$0001, $2000,232,$0100
Triggergroup= 28, $2000,195,$0264, $2000,127,$0002, $2000,232,$0200

Organizer= 1, IGNORE, IGNORE, 3, 5, 1, 36, 3, 10 
Triggergroup= 5, $2000,224,$0004 ; change fog color to #4
Triggergroup= 36, $2000,195,$0378 ; change start fog to 0 in 3 seconds 
Triggergroup= 10,$2000,128,$0001 ; stop organizer  1

Organizer= 2, IGNORE, IGNORE, 3, 3, 1, 6, 3, 60	
Triggergroup= 3, $2000,224,$0003 ; change fog color back to #3
Triggergroup= 6, $2000,195,$0378 ; change start fog to 0 in 3 seconds 
Triggergroup= 60,$2000,128,$0002 ; stop organizer 2
Let's dissect this.


Both TGROUPS work in the same way:

$2000,195,$0264 is the F195 which changes the start fog distance to 20. This is useful for big rooms. In smaller, a distance of 16, 12 or else will do nicely (the bigger that distance, the slower it will take for the fog to "come back") ;
$2000,127,$0001 enables organizer 1;
$2000,232,$0100 sets the gba1 to 1.

The second TGROUP is the same, it only has a different change start distance (I put 12) and set gba1 to 2.


Both organizers work in the same way. Once Lara activates the TGROUP, she enables an organizer that changes the fog color (F224) after the period of time it took for the fog to "disappear". For me it was 3 seconds, so I put Organizer= 1, IGNORE, IGNORE, 3, 3, which means that after 3 seconds, TGROUP 5 with F242 will be activated.

Then, we have to return our fog (now in the new color!) by changing the start distance from 12 (or 20, or whatever you have) to 0. I chose 3 seconds for this as well. So, my TGROUP 36 contains F195 exported trigger with & (time) as 3 secs and E (value) as 0. And then we just have to stop the organizer, which is F128 placed in TGROUP 10. The second organizer works the same, it simply has a different value for the fog color and changes distance. It is something you can experiment with indefinitely!

You can find more information about organizers in this thread.


Now we have our script (don't forget to save and build it!). Time to put it into action. First, I put the triggers in Zone A, as shown in the picture:

Now, when she steps into Zone A, organizer 1 will be activated and we will have our smooth transition. Now, we want our fog to return to the previous color if she goes back:

That's all! Because of the variables, she will ignore the triggers until she steps into another zone. She can go back and forth and the organizers will be performed only then.

You can check out the effect in this video: https://youtu.be/ZVZKCS9TuS4

Remember to test everything and adjust the script as needed. And most importantly, have fun experimenting and creating effects that suit your level .
woah, das ist so philosophisch :o // working on TR: Shadows of the Past
saintjunia is offline  
Old 07-04-21, 12:45   #2
tlr online
tlr online's Avatar
Join Date: Jun 2000
Posts: 59,249

Thank you for posting saintjunia.
tlr online is online now  
Old 08-04-21, 02:49   #3
Richard_trle's Avatar
Join Date: Aug 2003
Location: Brazil
Posts: 746

Nice! Thanks for sharing this Saintjunia!

Can any mod or admin please move this to the tutorial section?
Richard_trle 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 22:20.

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