Game Development Community

Can one find the schedule time left?

by Cramer · in General Discussion · 08/09/2004 (12:36 pm) · 6 replies

Is it possible to get the amount of time left on a schedule? Basically I'm trying to set a clock that shows how much time is left in the level (set by Game::Duration) and the GuiClock just seems to show me the amount of time since the app started with $Sim::Time.

Either I need to find out how much time is left on the schedule which was started to end the level or is there a way to adjust the GuiClock itself.

The way I know I can definately do it is with a new gui text element showing me a variable i calculate with some subtraction and whathave not but that doesn't seem the best way and would require more formatting as well.

Any info is appreciated :)

#1
08/09/2004 (3:54 pm)
Why not schedule a function for once a second that subtracts from a global variable?
#2
08/09/2004 (7:00 pm)
Record the time when the schedule starts and subtract it from the duration since the app started to find out how long it's been running, then subtract it from the length of the schedule.
#3
08/10/2004 (8:25 pm)
I've actually written a variation of GuiClock I could email you that has an option to use a remaining time timer as well as the default elapsed time. I'm not at the computer that has the file right now, but if you like, I can send it to you once I get back to the office tomorrow or Thursday.

Let me know,

Ciao,
-rob
#4
08/10/2004 (8:40 pm)
Http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=4978
Resource on a clock that counts time remaining (or pauses)
#5
08/10/2004 (8:44 pm)
Haha, or that looks pretty good, too ^_^

-rob
#6
08/11/2004 (5:33 am)
Cool, that would definately work, thnx fer link, I tried searching around but didn't end up finding that one.

I ended up creating a function that's called every second and formatted the time in there, but this will definately help in doing it a better way, thnx.