You’ve got a flickering light, but can’t change the model’s skin to match? You want it to, but can’t work out how?
Well, you can’t.
Sucks, right? But don’t worry, it can be faked (and convincingly too)!
What we’re going to do is set up timers to control the flickering instead. This is, in some ways, better than the preset because it is random rather than the same sequence repeated over and over.
What you will need:
- two
logic_timer
s with the same name (e.g.flickertimer
) - a named
light
(e.g.flickerlight
) - a named
prop_dynamic
(e.g.flickerprop
) for the light with an on and off skin
Set one of the timer’s properties to be:
Start Disabled | No |
---|---|
Use Random Time | Yes |
Minimum Random Interval | 0.05 |
Maximum Random Interval | 0.5 |
And the other to be
Start Disabled | Yes |
---|---|
Use Random Time | Yes |
Minimum Random Interval | 0.3 |
Maximum Random Interval | 0.8 |
You can change the times if you want, but this is what works well in my opinion. The first set of times controls how long the light is turned off for, the second set how long it is on.
Now the important part, the outputs.
For the first one that controls how long the light will be off:
Output | Target entity | Input | Parameter |
---|---|---|---|
OnTimer | flickerlight | TurnOn | |
OnTimer | flickerprop | Skin | 1 |
OnTimer | flickertimer | Toggle |
Note: Delays are all 0.00, Only Once is No. Replace the targetnames with whatever you’re using and change the skin to whatever the model’s on skin is. It should be TurnOn, since these outputs will fire AFTER the timer is done.
For the second timer that controls how long the light will be on:
Output | Target entity | Input | Parameter |
---|---|---|---|
OnTimer | flickerlight | TurnOff | |
OnTimer | flickerprop | Skin | 0 |
OnTimer | flickertimer | Toggle |
Set this up and you’ll have a nice flickering effect on your lights, easy!
Greg says:
October 6, 2019
Hi, Great Tutorial. Make others tutorials on Hammer pleaaaase…
Your technical settings are very useful to create a good map.
Joe says:
April 1, 2021
How do you make the actual light flicker? This only makes the prop flicker and I would like for the light to turn on and off as well.
kazitor says:
April 1, 2021
You need to give the light a targetname, and fire its TurnOn and TurnOff inputs as appropriate. The usual caveats to named lights apply.
If you’ve done that, I’m not sure what specific problem you might be having. Perhaps the wrong entity selected for the light?
onomatopoeia says:
September 5, 2021
Damn, thanks a lot man, was going through 100s of tutorials but never found one as specific as this, or any that work as well at least.