In my training map I also have an Obstacle Course. Was wonder if there was a way to script/map in a timer so that it starts when you start it & stops when you finish???
If so is it possible to use the timer that the game uses for RB map(top left corner)???
Thanks in advance
Scripting a timer
Moderator: Moderators
-
SniperWolf
- Colour Sergeant
- Posts: 89
- Joined: Sat Dec 18, 2004 5:14 am
- Location: New York, USA
- Contact:
-
Green Beret
- Major General
- Posts: 746
- Joined: Mon Apr 19, 2004 12:21 pm
- Contact:
-
SniperWolf
- Colour Sergeant
- Posts: 89
- Joined: Sat Dec 18, 2004 5:14 am
- Location: New York, USA
- Contact:
if you use the stop watch that is usaed for bombs, i would have thurt everyone could see it? i dont know this answer..
[ Formerly Known As Snakeâ„¢ ]-
SniperWolf
- Colour Sergeant
- Posts: 89
- Joined: Sat Dec 18, 2004 5:14 am
- Location: New York, USA
- Contact:
timer
Here is one you can try -- I'm not sure it will work. The trigger should be a trigger_multiple that goes from the start line to the finish line. give it these key /values.
Key: targetname
Value: obsticle_trigger
Key: setthread
Value: counter
The time display will not work for more than one player at a time. So, players will have to wait for the time to reset to 0 before the next guy goes.
Key: targetname
Value: obsticle_trigger
Key: setthread
Value: counter
Code: Select all
main:
level waitTill prespawn
level.counter = 0
level waitTill spawn
thread print_time
end
//----------------------------------------------------------->
// active timer
//----------------------------------------------------------->
print_time:
while (1)
{
waitthread hudprint ("Time Count: " + (level.counter) + " seconds") .75 .65 .1 // three numbers are for color (gold)
}
waitframe
end
hudprint local.nstring local.r local.g local.b:
huddraw_rect 187 140 -84 50 50
huddraw_color 187 local.r local.g local.b
huddraw_font 187 "facfont-20"
huddraw_string 187 local.nstring
huddraw_align 187 left bottom
huddraw_alpha 187 1
wait .5 //refresh time
end
counter:
local.runner = parm.other
while (1)
{
level.counter = level.counter + 1
wait 1
if (!local.runner istouching $obsticle_trigger) //checks to see if the player has left the trigger
{
thread global/message_print.scr::message "TIME!" NIL 4 // stays on screen for 4 seconds
break
}
}
wait 10
level.counter = 0
end

