Garry's Mod

Garry's Mod

1,373 ratings
Day/Night Cycle (Industrial17)
Content Type: Addon
Addon Type: Tool, Effects
Addon Tags: Roleplay, Scenic
Tags: misc
File Size
0.003 MB
Apr 30, 2013 @ 8:25pm
Aug 23, 2013 @ 3:23am
3 Change Notes ( view )

Subscribe to download
Day/Night Cycle (Industrial17)

Update: Version 1.2

*Updated the color values for night
*Fixed the sun never properly setting for the beach area in V1

This is the script required for the day/night cycle to function in rp_industrial17. This script is ONLY required if you're hosting or playing this map in singleplayer, and is ONLY for beta8 and future releases. But it can also be used in other maps, see below.

This script is ONLY for maps that are built to use it (such as rp_industrial17 or rp_city45_2013)

-Easy to modify script
-Changes the outdoor lightmaps to simulate day/night
-Rotates an env_sun around the map
-Uses skypaint to simulate day/night
-Random cloudy days
-Fires logic_relay entities for events depending on the time of day

-dnc_gettime (Everyone)
-dnc_length (SuperAdmin)
-dnc_settime (SuperAdmin)
-dnc_pause (SuperAdmin)

Standalone script download:
(This goes in lua/autorun/server)

This script is available for anyone to use for their own servers/maps.

I suggest downloading the standalone version to tailor it to your needs. At the top of the script you can modify how long a day in seconds (default 1 hour), how bright you want day/night to be, and the color values.

MAPPERS: To use this script, your map will need:

-Modify the field at the top of the script and change "rp_industrial17" to your maps name"
-An env_sun
-Your skybox needs to be called "painted"
-You need name your light_environment and call it "sun". To do this, turn off SmartEdit and add a new field called "targetname" and make the value "sun".
-Most of your outdoor props MUST be prop_dynamic so their lighting changes with the cycle.
-OPTIONAL: make 4 logic_relay entities. Name one dawn, one day, one dusk, one night. Whatever outputs you add to these relays will be fired at that time of day. Great for enabling/disabling streetlights at dawn/dusk!