ID:170451
 
In my RPG, I want something like every 5 minutes or so, it syas something like, "The sun rises in the east" and stuff like that. I tried using the example from the DM Guide, but the messages never showed. I could use some help.
Seraphrevan wrote:
In my RPG, I want something like every 5 minutes or so, it syas something like, "The sun rises in the east" and stuff like that. I tried using the example from the DM Guide, but the messages never showed. I could use some help.

So:
// Varable saying if the sun is up. (aka, is it daytime)
var/sunup = 0

// Change from day-night and vice versa.
proc/MoveSun()
// If the variable sunup is anything but zero, set it to zero. Otherwise, set to one.
sunup = !sunup
// Display appropriate message...
world << "The sun [sunup ? "rises" : "sets"] in the [sunup ? "east" : "west"]."
spawn(3000)
// Do it again in 5 min.
MoveSun()

world/New()
..()
// Start the whole thing.
MoveSun()

Things you should know:
spawn() (Hit F1 in DM)
The ? operator. Evaluates whats on the left of the ?, if true, returns whats left of the :, if false, what's right of the :.