Members | Sign In
All Forums > Mission Scripting
avatar

Changing time values

posted May 24, 2013 16:20:39 by matt.schillinger
Can the value of remaining time on a timer be changed once a timer is started?

What i would like to do is to add time to a timer that is running, if a condition is met.

what I was hoping for is that i could change the remaining time value via

set variable timername to "timer1 + 60" in the Artemis Mission Editor. The goal in the example would be to add 60 seconds onto whatever is remaining in the 'timer1' timer.

Is this possible, or if not, is there another way to achieve the desired result that I haven't considered?
page   1
3 replies
avatar
Mike_Substelny said May 24, 2013 18:48:32
You can reset a timer to a new absolute value but I don't think you can add to or subtract from it.
"Damn the torpedoes! Four bells, Captain Drayton!"

(Likely actual words of Admiral David Farragut, USN, at the battle of Mobile Bay. Four bells was the signal for the engine room to make full steam ahead).
avatar
XHawk87 said May 24, 2013 20:52:36
A couple of ways this could be solved:

Have a variable counting down on a 1 second timer (or any interval you want). You can add and subtract numbers from a variable without issue.

Have two timers, one at the original time, one at the extended time, and only consider the valid timer depending on if the condition has been met.
avatar
lucas99801 said May 24, 2013 20:58:45
Using a variable/timer loop seems like the best method.

Or, you could have your initial timer, and a variable for additional time, when the original timer ends, a new timer is created based on the additional time gathered, but that would be a one shot thing. Have a decrementing variable would ensure infinite number of additions to the timer.
Hosting a Mumble (Murmur) server @ tsnfenrir.no-ip.org
Having trouble connecting to the TeamSpeak channel: http://tsnfenrir.no-ip.org/ts3
Helm Script for Numerical heading input: https://dl.dropbox.com/u/10193809/ArtemisHelmFSW.zip
Twitter: @lucas99801
Facebook: /lucastarnold
Login below to reply: