{WEBSITE :D}

Version 3.32

Multiple Timers

Glitchfinder's Multiple Timers is a script intended for those who need to juggle several different timers at the same time, but want to avoid the hassle of scripting loops or adding new events to a map or battle. This script has been tested in both events and scripts, and will work in both RPG Maker XP and RPG Maker VX.

Features

Screenshots

The only visual element for this script is identical to the default in-game timer. Therefore, screenshots are unnecessary.

Script

The script can be found here.

Instructions

Place this script above Main, and below the default scripts. (I realize this is obvious to most, but some people don't get it.)

To start a timer, use the following call:

$game_timer.start(seconds, key)

Where seconds is the number of seconds you want the timer to run, and key is the name of that specific timer. You must use a separate name for every timer, because when one finishes, only the first script checking for that name will return with the timer completed.

To start an extended timer, use the following call:

$game_timer.extended_start(hours, minutes, seconds, key)

Where hours, minutes, and seconds are the number of hours, minutes, and seconds you wish the timer to run. key follows the same rules as it does in the method above.

To check whether or not a timer has finished, use the following call:

$game_timer.finished?(key)

Where timer_number is the number of the timer that you need to check. See the rules above regarding key.

To remove a timer, you use the following call:

$game_timer.kill_timer(key)

Where timer_number is the number of the timer you wish to stop. Please read the above rules regarding key.

To adjust the remaining time, use the following call:

$game_timer.adjust_time(setting, value, key)

Where setting is what kind of operation you wish to perform. (1 for addition, 2 for subtraction, 3 for multiplication, and 4 for division) Value must be the number of seconds you wish to add or subtract, or the number you wish to add or divide by. Finally, timer_number is the number of the timer you wish to edit. (Once again, see above for rules regarding key)

To update a single timer separately, you must use the following call:

$game_timer.update_single(key)

Where key is the number of the timer you wish to update. This is meant to be used to update specific timers in scenes that this script doesn't normally update in. (In other words, anything other than Scene_Map) It can also be used to update a specific timer at a rate that is faster than normal, when variable speeds are necessary.

For debugging purposes, check the timer with the following call:

$game_timer.check_timing(key)

Where key is the number of the timer you are checking. (once again, see above for details on key) It will either display the remaining frames before the timer is finished, or it will tell you that the timer has finished. If the timer does not exist, it will print a message to inform you of that fact.

To stop or start a timer, use the following call:

$game_timer.active(key, bool)

Where key is the timer you want to start or stop, and bool is true if you want to start the timer, and false if you want to stop it.

To have a timer force battles to abort when they reach zero, use the following call:

$game_timer.end_battle(key, bool)

Where key is the timer you want to modify, and bool is true if you want it to abort battles while it is 0, and false if you don't.

To set a timer to display, use the following call:

$game_timer.display(key, bool)

Where key is the timer you want to display, and bool is either true or false, depending on the desired result.

To set a timer to be saved in the save file, use the following call:

$game_timer.save(key, bool)

Where key is the timer you want to have saved, and bool is true if you want the timer to be saved, and false if you want it to disappear when the game is closed.

Terms and Conditions

http://www.glitchkey.com
http://www.hbgames.org

Site Software 2010 Brian Labbe