Day and Night cycle

Ok… I’m trying to make a RP map that will eventually be a mod. I also really want to be able to change the skybox in-game.

I know it can be done! Proof:

I can only find three of these videos (the third is just an earlier version of the first one) and I still don’t know how to do it. Hoever the earlier version of the first link does say how he did it.

"Right now im only using func_brushes and timers that are linked to* math_counters that are linked to the Alpha input on the brushs. This causes the brushes of the sunrise and night sky to fade in slowly.

Im also using the input of fadetopatttern on the light_environment to cause the light to become darker."

But I’m kind of new to math_counters, logic_timers, and all of the more advanced parts of Hammer.

I know how they work but I don’t how I would use them to make a day and night cycle.

So can anyone help me out to set this up. Credit WILL be given once I release my map.

I’ve been trying to figure this out for a week with multiple google and bing searches that all failed so all help is appreciated.
Search through that thread.

i’m about to post up a WIP of a fully working Day/Night map I am working on so stay tuned to this forum

It’s not like you could have just posted the map when it was ready to be posted…

OMG… just amazing…

Yeah i’ve already searched through… it’s an in-game script… not for mapping (I think).

If it’s possible can you just send me the BSP. You can upload it to media file or you message me on steam. My username is -IA- Superw0rri0.

Anyone figure it out?

L4d2 supports vscript which is what the guy in the video uses.


If you want to do that the best you can do is use lua, or use color_correction.

well idk know lua but i’ll try color_correction.

So I was thinking of using color correction that is set on a timer with a brush that has a night sky (in the 3dsky box) with a moving env_sun and setting the light environment on a fade to pattern (or something like that)

Is this possible?

You can’t move the env_sun and I don’t think you can set a pattern on light_environment.

You can set a pattern on a light_environment. Just add the keyvalues yourself.
You need to give it a name though, so it will bake an on and off lightmap.
Probably best to use an entity logic system to fade it in and out over time and control the colour correction.
You could probably also create a custom skybox material that changes periodically with a material_modify_control entity.