ID:172916
 
Hello in my game I have rounds, which is basicly a timer thats displayed using Stat() in the statpanel for each person. Now originally i used world.realtime to calculate it as i was not THINKING at that time. Well you see the host can start the game whenever, so obviously world.realtime is not the way..BUT I am really not good at math and therefore i really dont know what to do now.
I think i would need to use three variables for this

Currenttime=??
RoundTIMETIMMY=starttime-Currenttime

Now you see starttime is set to the time that the loop begins, but im not too sure what to do with Currenttime....and it's probably very simple, but I usually seem to have good days and bad days (EX: one day I do somthing super...somthingrather, next day I wonder how I even did it in the first place...) anyways its 9:20 PM here, and I have school tommorow so im going to sleep.
Thanks to all who read.
world.time
In response to Garthor (#1)
I dont think this is what I want because the "rounds" can start whenever because the host can decide when to host it, after s/he has changed settings (although, luckally those settings save). I need the timer to be accurate, so please any other thing I could do, or is what you pointed out correct? I have read about the time variable and it only goes up if people are active...which is closer, but not quite what I want. Thanks

<EDIT>
Dont worry I fixed it my self, and it was quite simple...Here is the proc for any one thats interested

world/proc/roundcalculation(var/TICKS)
spawn()
TICKS-=1
Currenttime=TICKS
sleep(1)
if(TICKS<=0)
return
world.roundcalculation(TICKS)

I think it's sad that I seem to have "mind blocks" as I call them...it's really annoying!

</EDIT>
In response to Wanabe (#2)
NOW
In response to Wanabecrazy (#3)
mob
var/delay = 0
var/active_round = 0

Stat()
..()
stat("Time: ", Round_Timer())

mob/proc/Round_Timer()
if (active_round)
var/round_time = world.time - delay
return round(round_time / 10)
else return 0

mob/verb/Start_Round()
delay = world.time
active_round = 1

mob/verb/Stop_Round()
active_round = 0

This should give you an idea.
In response to Wanabecrazy (#4)
You fail at the internet.