ID:261309
 
I was just wandering if any would explain how i could add day and night code.

Thanks.
I think its ShadowDark thats got one on the hub its in tutorials

<font color=yellow>Unix
Here's the easiest way of doing it.

proc
nightcycle()
for(var/area/A in world)
A.opacity=1
sleep(rand(50,100))
A.opacity=0
sleep(rand(100,300))
nightcycle()

world/New()
nightcycle()



Now, if there's a part of that code you don't get look it up.
In response to Nadrew
Nadrew wrote:
Here's the easiest way of doing it.

> proc
> nightcycle()
> for(var/area/A in world)
> A.opacity=1
> sleep(rand(50,100))
> A.opacity=0
> sleep(rand(100,300))
> nightcycle()
>
> world/New()
> nightcycle()
>

Now, if there's a part of that code you don't get look it up.

I have one that FIREking taught me, its longer than that but it is also pretty good :-D

<font color="grey">-~=</font><font color="FF0000">Lee</font><font color="grey">=~-</font>
In response to Nadrew
Altering the opacity won't allow players to carry torches or light sources. Luminosity is designed for light/dark changes.

I have a short demo available here: http://byond.com/hub/ hub.cgi?qd=hubIndex;hub=707;channel=1183

It shows two ways to do day and night, if you read the comments. The overlay version is more impressive
visually, but the luminosity version works better if you use light sources in your game. (The overlay version can also cause some flickering the first couple times the overlay changes.)
In response to Shadowdarke
Hehe, that's why I said it was simple, he didn't ask for a system that would allow tourchs etc..