Area-based screen tint

Half-Life HL
Area-based screen tint by Mota
Posted 1 year 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
1 year ago2022-10-02 22:19:23 UTC
Updated
1 year ago2022-10-02 22:19:23 UTC
Views
1031
Downloads
207
Comments
3
Rating
5.00 (2)

Legend has it, in American films and TV, scenes taking place in Mexico always have a sepia color filter on top of it. 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 (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 retriggered 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 if the player can move freely between areas like in this example.
For the smooth transition, I used:
  • A second env_fade (screen_tint_start) with "Fade From" disabled
  • A second trigger_multiple (mexico_border) at the threshold between areas with a 0.5 second delay before trigger
  • Two pairs of trigger_changetarget, named change1 and 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, as 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

Possible uses

  • A room that fills up with toxic gas, that the player has to escape from
  • A portal that shades the player's vision greener and greener as they approach
  • Simulating a "psychic attack", like that scene with the Advisor in Episode 1
  • Recreating your favorite episode of Breaking Bad

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!
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 1 year 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 1 year ago2022-10-07 06:09:40 UTC Comment #104838
This is really neat, thanks for the tutorial!
Commented 1 year 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.