Plot:Set timer

From OHRRPGCE-Wiki

Jump to: navigation, search
set timer (id, count, speed, trigger, string, flags)

Sets the settings for a given timer (id), and starts it. Count is the length of the timer. While it's running, the count will go down by one every speed ticks. I.e., if you set speed to 18, it will count down once every 18 ticks.


trigger is what happens when the timer runs out. You can use the constant timer: game over to indicate that the game should end, or specify a plotscript (in the form "@my script") to have that run.


By default, a timer will not show up on screen. However, you can bind a timer to a string using the string parameter. Pass it the id of a string, and that string will be updated every time the timer counts down. You are responsible for displaying and positioning the string.


A timer also has a few other options in the form of flags. You can pass any combination of these flags: timer flag: critical to have the timer end a battle, if it runs out during it, timer flag: battle to have it count down during a battle in the first place or timer flag: menu to have it count down while the player is in a menu (i.e. the main menu).

You can pass timer:default to any parameter except id. This will either leave the parameter unchanged (if it's set), or set it to its default value.

[edit] Examples

#this starts a 300 second (5 minute) timer that counts down once every 15 ticks. If
#it runs out during a battle, the battle won't end, but it will go game over after.
set timer (0, 300, 15, timer: game over, 0, timerflag: battle)

[edit] See Also

Personal tools