Builder Timers

From Wherigo Foundation Wiki
Revision as of 13:21, 22 April 2018 by Ranger Fox (Talk | contribs) (Created page with "Timers make it possible to cause something to occur after a specified number of seconds. For example, you might use a timer to periodically remind the player about a task that...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Timers make it possible to cause something to occur after a specified number of seconds. For example, you might use a timer to periodically remind the player about a task that has not been completed.

There are two kinds of timers. A countdown timer causes the action to occur just once, after the specified number of seconds has elapsed. A countdown timer ticks just once. An interval timer causes the action to occur repeatedly, at the specified interval. An interval timer ticks repeatedly until stopped.


What Makes a Timer?

Timers are not directly visible to the player. The only manifestation of a timer is the action you associate with it. Each timer has a picture and an icon, but these are not used as far as I know. Each timer has a unique name. This is required. There is also a brief description, which is optional.

These are the important characteristics of each timer.

  • Type. Interval or countdown.
  • Number of seconds. This is the time between ticks.
  • Script attached to the timer tick event. This is where you specify the action which is to occur at each timer tick.


Starting and Stopping Timers

You must start a timer from script attached to an event. For example, your game might require the player to move quickly from zone to zone. Each time the player enters a zone, you might start a countdown timer. You would do this from the script attached to the "enter zone" event. When the timer ticks, you might display a message prompting the player to move on to the next zone. You would do that from the script attached to the timer tick event.

A countdown timer ticks once and stops by itself. An interval timer ticks repeatedly until you stop it from script attached to an event. For example, you might use an interval timer to periodically remind the player about a task that has not been completed. You might stop this timer in the script attached to the task status change event.


Timer Events

Each timer has three events to which you can attach script.

  • Tick. This event occurs each time the timer ticks. Remember that a countdown timer ticks just once, while an interval timer ticks repeatedly until you stop it.
  • Start. This event occurs when you start the timer from script.
  • Stop. This event occurs when you stop the timer from script. This event does not occur when a countdown timer stops after time has elapsed.


Timers in the Builder

To add or edit a timer, begin by choosing Timers from the left sidebar. This will display a list of existing timers. To the right of this list, there is a second list of events. When you select an entry in the main list, the events corresponding to the tick, start and stop events for that timer appear in the second list.

  • To add a new timer, choose Add, and provide the requested information.
  • To edit an existing timer, select the timer in the list, choose Edit, and provide or change the requested information.
  • To delete an existing timer, select the timer in the list, choose Delete, and confirm your intention to delete it.
  • To add a script for an event, select the timer in the left-hand list, select an event for which no script exists in the right-hand list, and choose New Script. Then create the script.
  • To edit an existing script for an event, select the timer in the left-hand list, select an event for which script already exists in the right-hand list, and choose Edit Script. Make any needed changes to the script.
  • To delete an existing script for an event, select the timer in the left-hand list, select an event for which script exists in the right-hand list, and choose Delete Script. Confirm your intention to delete the script.

Scripts can also be added, edited and deleted from the Timer dialog, on the Events tab, as you add or edit the timer.

When you add or edit a timer, you will be asked to provide the following information.

  • The name of the timer. Required.
  • A brief description. Optional.
  • A piece of media (picture) to represent the timer. Optional, and unused as far as I know.
  • An icon to represent the timer. Optional, and unused as far as I know.
  • The type of timer. Interval or countdown.
  • The number of seconds between ticks.