OFPEC Forum
Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: Bailey on 29 Aug 2008, 19:03:50
-
#start
_timer = 0
#loop
_timer = _timer+1
Titletext [Format [" %1", _timer],"plain down"]
? timer <= 300: exit
? StopScript : exit
~1
goto "loop"
Ok hello first of all :good:
#1 On to the job at hand, My script timer works the first time i set it off but once i turn it off with a trigger "StopScript = true" and activate it again it will not time through again. It gets stuck on 1.
#EDIT: Edited the topic title as well.. h-
-
You increment _timer (local variable), but check timer (global variable). You also need to exit if _timer is too large, not when it is too small:
? _timer >= 300: exit
I suspect that after you first run the script, you do set the value of timer and that causes the script to exit early (that line will be ignored if timer is undefined).
One topic per thread please (where you have multiple questions about a specific subject, that can be O.K.)! Edit your original post to remove the jail question and start a new thread with it.
EDIT: Thanks for sorting that out.
-
Thanks Spooner all good now ;)
EDIT (Spooner): Removed unnecessary quoting.
-
Please don't quote the previous post. Everyone knows you are replying to it ;P
Don't worry about making forum faux pas. You'll get the hang of it...
-
how do i call this script with a set time in wich my unit has to complete the mission
can this script be made just like the ofp one
setting variables to show the time once in a certain while (players decision how often the timer is shown) until the last minute or so then shows constant