Area-based screen tint
Legend has it that, in American films and TV, scenes taking place in Mexico always have a sepia color filter on top of them. Now you can bring the Mexican Filterâ„¢ to your own maps!
This example demonstrates three things:
- How to use
env_fade
's "Modulate" and "Fade From" flags to create a color overlay (tint) effect on the player's screen
- How to make the effect stay on for as long as the player remains inside a certain area
- How to make the transition in and out of the tint smooth(er)
Explanation
The tint effect is achieved by having an
env_fade
(named
screen_tint) repeatedly triggered by a
trigger_multiple
(
mexico) covering the whole area it's supposed to affect.
Both the fade's "Hold Fade" time and the trigger's
delay before reset are set to 1 second, so the fade gets re-triggered every second while the player stays inside the trigger.
That would be enough for a continuous tint that fades away when the player leaves the area, but if you also want it to fade in smoothly, it'll need a more complex setup -- especially when the player can move freely between areas like in this example.
For the smooth transition, I added these to the setup:
- A second
env_fade
(
screen_tint_start) with the "Fade From" flag disabled
- A second
trigger_multiple
(
mexico_border) at the threshold between areas with a 0.5 second
delay before trigger
- Four
trigger_changetarget
, one pair named
change1 and another pair named
change2
When the player crosses the border, this is what happens:
- The threshold's
trigger_multiple
(
mexico_border) targets the pair of
trigger_changetarget
called
change1 after a delay of 0.5s
- Meanwhile, the area's
trigger_multiple
,
mexico, targets
screen_tint_start, since that is its initial target
- The
change1 pair activates, making it so
mexico now targets
screen_tint every second from now on, and
mexico_border now targets the
change2 pair
If the player walks back through the border,
mexico_border will now trigger the
change2 pair, which reset both
mexico and
mexico_border to their initial targets so this whole sequence can be repeated.
Usage suggestions
Notes
- Going in and back out through the threshold too quickly will break the effect; find a way to slow the player down, or don't let them back out the way they came in
- Probably there are better/simpler ways of achieving this effect, so experiment!
Updates
- 2025/02/18: Improved readme and Vault description slightly
Lastly, I'd like to thank you fine people of TWHL, I wouldn't have learned so much about mapping without the resources and information available here. You guys rock!
-- Mota