A Community discussion forum for Halo Custom Edition, Halo 2 Vista, Portal and Halo Machinima

Home  Search Register  Login Member ListRecent Posts
  
 
»Forums Index »Halo Custom Edition (Bungie/Gearbox) »Halo CE Technical / Map Design »Timers

Author Topic: Timers (7 messages, Page 1 of 1)
Moderators: Dennis

Gamma927
Joined: Jun 12, 2008

Steam: gamma927


Posted: Jan 20, 2009 09:25 PM    Msg. 1 of 7       
Is it possible to have a timer count up, instead of down? If yes, then what is the script? I can't seem to find it in the Halo Scripting Bible...


Nexus Halo
Joined: Feb 24, 2007

Halo's Dark Knight http://www.nexushalo.kk5.org/


Posted: Jan 20, 2009 10:54 PM    Msg. 2 of 7       
I also wanted to know this but I got a no if I remember correctly.


Gamma927
Joined: Jun 12, 2008

Steam: gamma927


Posted: Jan 20, 2009 11:17 PM    Msg. 3 of 7       
Well, if it were multiplayer, could I initialize a variable, and make a script like:

(script continuous count_up
([variable x])
(sv_say [variable x])
(sleep 30)
([variable x ++])
)


Would this work, or have I been reading too much Java?


Gamma927
Joined: Jun 12, 2008

Steam: gamma927


Posted: Jan 20, 2009 11:50 PM    Msg. 4 of 7       
Its a string of numbers that counts downwards. What's the proper syntax for having one count downwards from 5 minutes?
Edited by Gamma927 on Jan 21, 2009 at 12:18 AM


Me KS
Joined: Feb 2, 2008

Desire is Reality. Xfire: jetmaster23


Posted: Jan 21, 2009 05:23 PM    Msg. 5 of 7       
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


Gamma927
Joined: Jun 12, 2008

Steam: gamma927


Posted: Jan 21, 2009 06:44 PM    Msg. 6 of 7       
Thanks :) And the command for it to stop would be

numeric_countdown_timer_stop

?


Nexus Halo
Joined: Feb 24, 2007

Halo's Dark Knight http://www.nexushalo.kk5.org/


Posted: Jan 22, 2009 02:12 AM    Msg. 7 of 7       
Actually Deadlock hasn't been worked on in a while. Sometime in the future I'll contact you hoping to finish it.

 

 
Previous Older Thread    Next newer Thread







Time: Fri January 20, 2023 10:54 PM 313 ms.
A Halo Maps Website