User Tools

Site Tools


timers

Timers

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 in the builder

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,
  • and countdown 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.

Adding timers

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.

Properties

  • A brief description. This is optional, and will not show up to the player (as far as I know)
  • A piece of media (picture) to represent the timer. This will also not show up to the player (as far as I know), so leave this alone.
  • An icon to represent the timer. Like the media, this will not show up to the player (as far as I know), so leave it alone.
  • A Duration for the timer. This is measured in seconds. It has to be at least 1 second, and there is no maximum.
  • Type. You can select either Interval or Countdown. Interval counters will count down from your entered duration to zero and then restart at the entered duration once more, whereas Countdown timers will count down from your chosen duration to zero once and stop.
  • Visible. Has no effect AFAIK

Timer Statements

There are three statements that you can use with a timer:

  • Start
  • Stop
  • Tick

Start

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).

Stop

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.

Tick

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

Events will happen when the timer reaches certain stages. They look very similar to the Statements but

  • a Statement is actively influencing the timer
  • an Event happens automatically when the timer reaches the asociated stages.

There are three different Event types:

  • Tick. This is the most used timer event. It triggers when the timer reaches zero.
  • Start. This event triggers when the timer is initially started.
  • Stop. This event triggers when the timer is forced to stop by the program stop command.

Tick

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.

Start

The start Evet is triggered when the timer is started.

Stop

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”).

timers.txt · Last modified: 2013/05/07 17:12 (external edit)