ID:161243
 
Some of you may remember me asking for help on creating aweather system and data created the one below how would i add another factor to this?? i would like to add a Day and Night system to intergrat with it. Im new to the Luminosity varable, so how would i make it work with that????

P.S. The Weather System doesnt work anyway.........

area
outside //outside areas: these are affected by weather
layer = FLY_LAYER + 1
var
zone = 1 //the weather is different per zone. zones could be different planets, countries, cities, ...
weather = "clear" //this can be used to determine exactly what the weather is in this area.\
different weather = different problems? (rain would affect armor, snow would affect movement, ...)


world/New()
.=..()
for(var/area/outside/A) if(!(A.zone in zones)) zones += A.zone
//this step has to be repeated everytime a new zone is created

var/list/zones = new/list()
proc
WeatherLoop()
while(1)
for(var/zone in zones)
var/image/I = image(icon = 'icons/Weather.dmi', icon_state = pick("clear", "rain", "snow"))
for(var/area/outside/A)
if(A.zone == zone)
A.icon = I
A.weather = I.icon_state
sleep(1200) //change the weather every 2 minutes
All you need to do to make the area around the player light or dark is change the luminosity value of the /area. So if you want your day night cycle to swap every 1200 ticks, then you could just throw something like this in there:

for(var/area/outside/A)
if(A.luminosity)
A.luminosity = 0 // Make it dark outside.
else
A.luminosity = 6 // Make it light outside.