ID:148320
 
in my game i have a code that gives you a certain amount of time to mine,build, etc... and its not doing the world reboot code...



var/time
var/currenttime
var/overtime
proc/Minecycle()
world << "Setting up the mining game"
for(var/turf/wall/T in world)
if(T.density == 1)
if(prob(0.3))
new /obj/minerals/Bauxite(T)
for(var/turf/wall/O in oview(T,3))
if(prob(9))
new /obj/minerals/Bauxite(O)
if(prob(50))
new /obj/minerals/BauxiteLow(O)
if(prob(23))
new /obj/minerals/BauxiteMed(O)
world << "Done placing minerals"
world << "Starting Game"
var/sleeptime= pick(8000,10000,15000)
var/timecount= sleeptime/600
time = round(timecount,1)
overtime = world.realtime + sleeptime
world << "You have [time] minutes to mine!"
sleep(sleeptime)
gameOver()
sleep(50)
world.Reboot()

proc/gameOver()
world << "Game over!"
if(blueteammoney == redteammoney)
world << "Teams Tied!"
else if(blueteammoney <= redteammoney)
world << "Red team won!"
else if(redteammoney <= blueteammoney)
world << "Blue team won!"



is the cycle/timing proc

Well, your using the sleep() proc before you start world.Reboot(). It's not to nice to make the computer take a nap(sleep()) right before you make it do something such as rebooting... Hehe.. what I'm trying to say is, maybe you should try using span(3) instead of sleep(3). Im pretty sure this will solve your problem. Heh, I'm sensing a Lode Wars-like in the making. :)

-GDT
In response to GoodDoggyTreat
Im at school right now but ill try that when i get home. Its sort of a lode wars, mainly just the option of mining mode. Its for my simant game which is cool and all single player but there has to be a way to win in multiplayer so this was one of the solutions ;-).
In response to Jinjo21
You win when you kill the enemy queen. =P
In response to Garthor
MAybe its just a problem with the variable im using to show how much time is left, but its going into the negatives

var/time
var/currenttime
var/overtime
proc/Minecycle()
world << "Setting up the mining game"
for(var/turf/wall/T in world)
if(T.density == 1)
if(prob(0.3))
new /obj/minerals/Bauxite(T)
for(var/turf/wall/O in oview(T,3))
if(prob(9))
new /obj/minerals/Bauxite(O)
if(prob(50))
new /obj/minerals/BauxiteLow(O)
if(prob(23))
new /obj/minerals/BauxiteMed(O)
world << "Done placing minerals"
world << "Starting Game"
var/sleeptime= pick(8000,10000,15000)
var/timecount= sleeptime/600
time = round(timecount,1)
overtime = world.realtime + sleeptime
world << "You have [time] minutes to mine!"
sleep(sleeptime)
gameOver()
spawn(50)
world.Reboot()

proc/gameOver()
world << "Game over!"
if(blueteammoney == redteammoney)
world << "Teams Tied!"
else if(blueteammoney <= redteammoney)
world << "Red team won!"
else if(redteammoney <= blueteammoney)
world << "Blue team won!"

is the code im using for the mining cycle.

this is what im using to show how much time is left.
stat("Time Left:","[round(overtime -world.realtime,1)/600]")