Back to Tabs List.
Download the Timer Demo Cartridge (right mouse button, save link as, then restore the cartTimerDemo.txt file in Earwigo to view it in Earwigo)
Timers can be used in the wherigo file to cause certain events to execute at set intervals, or once after a set interval has passed. There are two types of timers:
Interval timers will run continuously once they have been started. They will produce a “tick” event whenever the chosen time is up. Then they will start again and produce a tick event when the time is up, then they will start again and produce …
Countdown timers will only run one time. They will produce one tick event when the time is up. You can however “manually” restart them.
To add a timer, begin by choosing Timers from the main tabs. This will display a list of current timers (the list will be empty if there are no timers). If there is a timer in the list, there will also be links to the timer Properties and Events, as well as a small field for a description.
To add a timer, enter a name for the timer and click ADD. The timer is now added, but non functional until you enter some PROPERTIES, and EVENTS.
There are three statements that you can use with a timer:
In order to use a timer, you need start it. In Wherigo this translates to: you need to use an event (such as talking to a character, entering a zone, etc) that starts the timer (TimerOperation:MyTimer:Start). There is no visible or audible indicator in the Wherigo cartridge that tells the player that the timer has begun (if you need him to know, you need to display a message).
If you need to pause/stop the timer at some point, you have to use theTimerOperation:MyTimer:Stop statement. There is no automatic indicator to the player that the timer has stopped. Note that if you want to unpause the timer, you need to call TimerOperation:MyTimer:Start once more.
You should normally not use this call. All timers will automatically run down once they are started. The tick is the event that indicates that the timer has reached its end. You can force this event to happen if you call TimerOperation:MyTimer:Tick. This call has the distinct probability of confusing the code, so it is not recommended to use it unless you are a programmer and KNOW what you are doing!
Events will happen when the timer reaches certain stages. They look very similar to the Statements but
There are three different Event types:
This is the event that you are typically looking for if you are using a timer. The timer “ticks” when it reaches zero.
For a countdown timer, the Event associated with the Tick will occur when the timer reaches zero, and the timer becomes inactive. You could use this timer for a bomb that goes off after a given time.
For an interval timer, repeated Tick Events occur every time the counter reaches zero. An example for this timer is a warning beep that sounds every minute.
The start Evet is triggered when the timer is started.
The stop Event of the timer will fire whenever the timer is forced to stop. There is no automatic indicator to the player that the timer has stopped. You can however use the stop Event to display a Message (e.g. “The timer has been stopped”).