ID:1343135
 
(See the best response by DarkCampainger.)
Could anyone help with a day/night cycle involving shadowdarke's dynamic area lighting, ive tried many times and no matter what i do it will not change between day and night.
Best response
Can you show us what you tried so we can get an idea of where you're struggling?
Oh course srry, basicly im using sd's demodaysystem that is WITHIN his lib,
var
daytime = "" // Used by mob/Stat() to disply the time of day

world
New()
..()
#if DM_VERSION>=400
// Only use the alpha blended icon if supported
sd_SetDarkIcon('sd_dark_alpha7.dmi',4)
#endif
// kick off the daylight cycles
spawn() DemoDayCycle()

proc/DemoDayCycle()
// a simple day/night cycle
var
time = 10 // how long it stays in this light state
light = 0 // how much light there is outside
d = 1 // amount of light increase
while(1) // keep doing until the program ends
sleep(time) // wait time ticks
time = 10 // set time to the default
light += d // shift the light amount

// if light level is outside the allowed range
if((light < 0) || (light > 4))
d = -d // switch the direction of light changes
light += d // put light back where it was
time = 100 // make this light period last longer

// just sets the time of day for the stat display
switch(d*light)
if(-4,4)
daytime = "Day"
if(-3,-2,-1)
daytime = "Dusk"
if(0)
daytime = "Night"
if(1,2,3)
daytime = "Dawn"

sd_OutsideLight(light)

It was edited but i deleted everything pertaining to this day/night cycle because of it not working, so this is fresh
Reading your posts on the library's hub, it sounds like you have everything set up correctly. The only thing I can think of is if you have world/New() defined somewhere else in your code, and you forgot to call ..() to let the other world/New() definitions run.

Search your code for any other instances of world/New(), and/or try putting a debug statement like world.log << "TRIGGERED" to see if your DemoDayCycle() is even being started (by default, world.log will output to the Options & Messages window, accessible by pressing F1 in the game).
In response to DarkCampainger
DarkCampainger wrote:
Reading your posts on the library's hub, it sounds like you have everything set up correctly. The only thing I can think of is if you have world/New() defined somewhere else in your code, and you forgot to call ..() to let the other world/New() definitions run.

Search your code for any other instances of world/New(), and/or try putting a debug statement like world.log << "TRIGGERED" to see if your DemoDayCycle() is even being started (by default, world.log will output to the Options & Messages window, accessible by pressing F1 in the game).

Yes, world/new was being triggered earlier xD thank you very much