Area-based screen tint

Half-Life HL
Area-based screen tint by Mota
Posted 2 years ago2022-10-02 22:19:23 UTC • Examples • Half-Life
Loading...
Screenshot Thumbnail
Screenshot Thumbnail
Name
Area-based screen tint
By
Mota Mota
Type
Map
Engine
Goldsource
Game
Half-Life
Category
Examples
Included
BSP, RMF/VMF
Created
2 years ago2022-10-02 22:19:23 UTC
Updated
2 hours ago2025-02-18 20:17:42 UTC
Views
1474
Downloads
350
Comments
3
Rating
5.00 (2)

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:
  1. How to use env_fade's "Modulate" and "Fade From" flags to create a color overlay (tint) effect on the player's screen
  2. How to make the effect stay on for as long as the player remains inside a certain area
  3. 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

3 Comments

Commented 2 years ago2022-10-03 07:43:00 UTC Comment #104824
Nice! You came across the same technique I used to fake night lighting in one of my unreleased maps.
Commented 2 years ago2022-10-07 06:09:40 UTC Comment #104838
This is really neat, thanks for the tutorial!
Commented 2 years ago2023-02-04 02:46:09 UTC Comment #105069
wow impressive

You must log in to post a comment. You can login or register a new account.