Quote: --- Original message by: Nexus Halo
I also wanted to know this but I got a no if I remember correctly.
Funny story about that actually. I remember you made a topic a long time ago about a map you were making and one of the things you needed scripting help with was a timer that counts up. I offered to help with the scripting and you agreed, but you never advised me, so I'm guessing you got what you needed. But, I had already finished the script for a timer counting up, and luckily I saved it.
So here it is:
(global short ticks 0)
(global short seconds 0)
(global short minutes 0)
(script continuous manage_ticks
(set ticks (+ ticks 1))
(if
(>= ticks 30)
(begin
(set seconds (+ seconds 1))
(set ticks 0)
)
)
(if
(>= seconds 60)
(begin
(set minutes (+ minutes 1))
(set seconds 0)
)
)
(hud_set_timer_time minutes seconds)
)
I'm pretty sure that this would work, although I've never tested it, so I can't tell you it will work.
I know all the variable stuff is set up correctly. The only fault might be in using the "minutes" and "seconds" variables to set the timer in "hud_set_timer_time", but the thing that reassures me is that I'm using "short" variables and the command asks for "short"s:
(hud_set_timer_time "short" "short")
sets the time for the timer to minutes and seconds, and starts and displays timer
The way it works is that it just doesn't let the timer count down because in every single tick of the game, the "hud_set_timer_time" command is resetting the timer's time to the variables "minutes" and "seconds" which are being counted up.
Edited by Me KS on Jan 22, 2009 at 06:19 PM