ID:264771
 
Code:
verb/TEST()
for( var/turf/o in world )
var/icon/a = new( o.icon )
a.SetIntensity( 0.5 )
o.icon = a


Problem description:

The code posted above effectively creates a moonlight/shadow effect over all the world. However, there is a moderate delay time (5-10 seconds) that takes place during execution of the procedure. I thought I'd be able to eliminate this delay by using the spawn() proc to run the code, but the delay still existed. I recall playing some BYOND RPG games where similar moonlight effects were used, and without any significant delay. How might I correct my TEST procedure to accomplish this?
i dont know if this is bad but i reduced the time by a lot doing this :

            var/list/types=list()
for(var/turf/T in world)
if(!types.Find(T.type))
var/icon/a=new(T.icon)
a.SetIntensity(0.5)
T.icon=a
types+=T.type
types[T.type]=a
else
T.icon=types[T.type]


so new icons weren't created for turfs of the same type :P
In response to Masschaos100 (#1)
Ah, so most of the time is expended creating new icons. And since there are just a few types of icons used in the world, it works wonders. Thanks, your solution is a success!