OFPEC Forum

Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting Resources Beta Testing & Submission => Topic started by: hoz on 28 Sep 2008, 20:10:04

Title: CountDownTimer (ACCEPTED)
Post by: hoz on 28 Sep 2008, 20:10:04
Count down time script which displays a non intrusive dialog with counter.

Features
 * Multiple warnings at your choice of interval.
 * Two formats of time "HH:MM:SS" or  "HH:MM"

 
The script ends when the hozMaxTime is reached.
You can end the script prematurely by setting hoz_timerOn = false
You may wish to wait to load this script after the mission has started.
For example give all other scripts a chance to load before loading hozTimer

Configuration
[[warningFreq],maxTime,displayTime,timeFormat] execvm "hoz_timer\scripts\HozTimer.sqf";
[[120,60,30,10],120,10,"HH:MM:SS"] execvm "hoz_timer\scripts\HozTimer.sqf";

Parameters
 * [warningFreq] In Array format the frequency intervals for reminders. The very last entry the timer will turn red.
 * maxTime       Total time for the counter in seconds.
 * displayTime   Length of time the dialog is displayed for.
 * timeFormat    Choices for the display format. "HH:MM:SS" or "HH:MM"

Current Version is 1

Fixed up the demo mission slightly.
Fixed up some problems with the script ending.

OFPEC Download (http://www.ofpec.com/ed_depot/index.php?action=details&id=582)
Title: Re: CountDownTimer (Beta)
Post by: Mandoble on 28 Sep 2008, 21:27:33
hoz_timer.sqf header inside dialog folder:
Code: [Select]
/*
mando_hint.sqf v1.1
By Mandoble June 2008

Parameters:
   Title text.
   Message text to be parsed as structured text.
   Background color as [R, G, B, A] array.
   If keyboard should be intercepted to repeat last hint when pressing H key or not (true/false)

It also uses mando_hint globals inside so this will interfere with missions using mando_hint script.
Title: Re: CountDownTimer (Beta)
Post by: hoz on 28 Sep 2008, 23:08:59
Actually that script isn't used. I forgot to remove it. I'm going to update the readme, but I'll wait for some more testing. Thanks for point that out  :-[
Title: Re: CountDownTimer (Beta)
Post by: i0n0s on 28 Sep 2008, 23:43:07
What means "displayTime" in the parameters?
Readme is contrary to Init.sqf on the warning frequency.
Title: Re: CountDownTimer (Beta)
Post by: hoz on 28 Sep 2008, 23:54:31
It means number of seconds the timer is displayed. Thats why I'm going to rewrite the readme so the parameters are clearer.
Title: Re: CountDownTimer (Beta)
Post by: i0n0s on 29 Sep 2008, 00:23:26
Ah ok :)
Title: Re: CountDownTimer (Beta)
Post by: hoz on 29 Sep 2008, 00:38:18
I updated the top post with the parameters. Ignore the readme.txt for this part for now...  :D

Updated the first post with a new zip.
Title: Re: CountDownTimer (ACCEPTED)
Post by: Supergrunt on 17 Dec 2008, 17:51:35
with this script how can i check in a trigger if it is ended ?  i tried to have a trigger with condition HOZ_timerOn =false but it then stops the script from running  and if i set it to true the condition is met instantly and the trigger avtivates instantly

Title: Re: CountDownTimer (ACCEPTED)
Post by: hoz on 17 Dec 2008, 18:02:21
In my mission the trigger condition is !HOZ_timerOn

I'm retesting it in my example. give me a few mins.

edit:
In this example I've set the counter to 30 secs, wait the 30 secs and the mission ends.


OFPEC Download (http://www.ofpec.com/ed_depot/index.php?action=details&id=582&game=ArmA)
Title: Re: CountDownTimer (ACCEPTED)
Post by: Spooner on 17 Dec 2008, 18:28:47
Seem to be two different versions of v1 of your script attached to posts in this thread. Can you delete the out of date one please, because I's confuseled?  :scratch:
Title: Re: CountDownTimer (ACCEPTED)
Post by: Supergrunt on 17 Dec 2008, 18:48:53
thanks this was exactly what i was looking for
Title: Re: CountDownTimer (ACCEPTED)
Post by: hoz on 17 Dec 2008, 20:51:08
I removed the first attachment and pointed to the ED resource. The second attachment was just an example using the released version.
Title: Re: CountDownTimer (ACCEPTED)
Post by: i0n0s on 28 Nov 2009, 13:36:38
One bug:
HOZ_timeron = false doesn't disable the timer. It only disables the messages.
So if I re enable it, I'll get the messages from the first started counter too.
Title: Re: CountDownTimer (ACCEPTED)
Post by: Dazakiwi on 13 Dec 2009, 03:17:54
Just a suggestion for any future releases, what about the ability to change it to counting upwards and not down, could be a counter for coop missions where everyone has to complete the mission the most quickest and see how much time it took.

Also so predefined points to choose from, middle uppertop of screen, top left of screen etc

Daza