Home   Help Search Login Register  

Author Topic: Timer for countdown trigger displayed on screen  (Read 2096 times)

0 Members and 1 Guest are viewing this topic.

Ice Man 3:16

  • Guest
Timer for countdown trigger displayed on screen
« on: 16 May 2004, 23:05:05 »
How would i make it so when you trip a countdown trigger (it has 600 seconds) it would show the timer for the countdown on screen so you can see how long you have left until the countdown is compleate.

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Timer for countdown trigger displayed on screen
« Reply #1 on: 17 May 2004, 10:19:37 »
Make the trigger start a script which looks something like this.  This just a sketch, not a working script.  Syntax not guaranteed.

; this script shows the countdown

_timer=600

#loop
?condition: goto "end"
hint format ["Time remaining %1s", _timer]
~1
_timer=_timer - 1
? _timer <=0: goto "timeout"
goto "loop"

#timeout
whatever
exit

#end
whatever
exit


--------------------------------

Unrelated PS - Thanks Chris, it's nice to be back
« Last Edit: 17 May 2004, 10:23:55 by macguba »
Plenty of reviewed ArmA missions for you to play

Offline nEO iNC

  • Contributing Member
  • **
Re:Timer for countdown trigger displayed on screen
« Reply #2 on: 18 May 2004, 08:24:57 »
Hey Ice Man/Macguba, I wrote these a while ago it's a couple of scripts that do a countdown in hours/minutes format. It's meant for client/server operation, but you can easy modify for client only.

Just remove the line '?!local dedserver: exit' from 'stimer.sqs'

format for the server/client side script init is;

[number of hours, number of minutes] exec "stimer.sqs"

format for the client side script is;

[] exec "ctimer.sqs"

That's it... There are two predefined variables in the script. 'ontime' can be used to test if the objective has been completed ontime. 'timeup' can be used to see if time has run out.

All you have to do to use these, is set whichever one you want to 1. If your running client/server, you would need to make sure 'ontime' is made public. 'timeup' is handled in the script for you.

Hope this helps... Feel free to modify in anyway you want to...


Offline nEO iNC

  • Contributing Member
  • **
Re:Timer for countdown trigger displayed on screen
« Reply #3 on: 18 May 2004, 08:25:28 »
The other srcipt...


Offline nEO iNC

  • Contributing Member
  • **
Re:Timer for countdown trigger displayed on screen
« Reply #4 on: 20 May 2004, 14:05:40 »
Oh... Knew I'd forget something... You can prefix the timer display by putting a message in the init array for ctimer.sqs

eg. ["Transport leaves in: "] exec "ctimer.sqs"

That's all...  :)

Ice Man 3:16

  • Guest
Re:Timer for countdown trigger displayed on screen
« Reply #5 on: 22 May 2004, 03:34:01 »
sweet, ive gotta try those scripts out.  One this is the trigger is set so when the time is out an objective is compleate.  Will that still work with this script??

thanks again

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Timer for countdown trigger displayed on screen
« Reply #6 on: 22 May 2004, 14:24:55 »
Yes, you just need to put the objective complete commands at the appropriate place in the script.
Plenty of reviewed ArmA missions for you to play

Offline nEO iNC

  • Contributing Member
  • **
Re:Timer for countdown trigger displayed on screen
« Reply #7 on: 24 May 2004, 08:12:39 »
Or, rather than mod-ing the script, just have a trigger that equates the 'timeup' variable to the objective being complete.

eg. cond: timeup == 1
      onact: "1" objstatus "done"

 ;)
« Last Edit: 24 May 2004, 08:12:58 by nEO iNC »