I want to do this for day and night and maybe for tides rising and falling. Previously I ran into problems adding day and night because turfs that had a turf on them, for example a floor turf with a chair on the floor would not get changed when I did a for(var/turf/t in world), only the chair would change.
I was wondering as far as memopry usage goes, if there are any pros or cons to starting the day night cycle in turf/New() as I did below.
turf
New()
..()
if(z==1)
Daynight()
proc
Daynight()
if(icon=='dayturf.dmi')
icon='nightturf.dmi'
if(icon=='nightturf.dmi')
icon='dayturf.dmi'
spawn(50000)
Daynight()
Copyright © 2025 BYOND Software.
All rights reserved.
Personally, I would make it more like this:
With this method, you would simply use the instance editor to set on the cycle_state variable for turfs on the first z-level, which is much nicer than having an if to determine that.