Timers

Feelzor

Veteran
Veteran
Joined
Oct 10, 2017
Messages
92
Reaction score
79
First Language
French
Primarily Uses
RMMV
Timers v1.1
FeelZoR

Free to Use for both Commercial and Non-Commercial projects.
Credits not required but highly appreciated!

You can find a more in-depth version of the TOS here.


Requested here.

Introduction
Have you ever needed to use some Timers in your game? For example, to stop the game for a few seconds, but the "Wait" command wasn't enough? (or you would put 50 "Wait 999 frames").
With this real time plugin, you can create multiple timers. You create them in one call, and check if the time elapsed since their creation is over a certain amount of time (in milliseconds, seconds or minutes) and you can do something after this specific time!

Features
- Create timers and check if the time elapsed since their creation is over a certain amount of time.
- Timers are dependent of each save file.
- Timers won't run while the game is paused (in menu, message window open, ...).

How to Use
Do not rename the file! It must be called Timers.js in order to function correctly!

Plugin Commands:
- Timers CREATE NameOfTheTimer MSRollback - Creates a new Timer.
NameOfTheTimer - The name of the timer. Be careful, the name is case sensitive. You can you almost any symbol you want, though it's better to keep clear and alphanumerical names.
MSRollback - If you don't want the timer to use the current time, use this parameter. It will allow you to make a timer MSRollback milliseconds old.
E.g.: Timers CREATE Chicken 500 - If I execute this command at 2:00:00.500, it will create a Timer named Chicken with the time 2:00:00.000.
E.g.: Timers CREATE Chicken -500 - If I execute this command at the same time than before, it will create a Timer named Chicken with the time 2:00:01.000.
Careful: If the Timer already exists, it won't be updated.

- Timers UPDATE NameOfTheTimer MSRollback - Updates (or create) a new timer.
The usage is the same than Timers CREATE NameOfTheTimer MSRollback, but it updates the Timer if it already exists and create it if it doesn't.

- Timers DELETE NameOfTheTimer - Deletes the specified timer.

- Timers MODE mode - Changes the Timer mode.
mode - The new mode to use. Accepted values are:
  • ms: Set the mode to milliseconds. (milliseconds, msec, msecs and reset are accepted values, too).
  • s: Set the mode to seconds. (sec, seconds and secs are accepted values, too).
  • min: Set the mode to minutes. (m, minutes and mins are accepted values, too).
E.g.: Timers MODE s - Will set the mode to seconds.
Script calls:

- Use $gameTimers.isOver(name, time); to know if the Timer name is older than the time specified.
name: Case sensitive; the name of the timer.
time: The time that needs to be elapsed since the last timer update for this method to return true.
Depending on the mode, the time needs to be in milliseconds, seconds or minutes.
E.g.: $gameTimers.isOver("Chicken", 50); will return true if the timer Chicken hasn't been updated in 50ms, 50s or 50min depending on the mode.

- Use $gameTimers.isOverVar(name, variable); to do the same than the previous script call, with the content of a variable instead of a constant value.
E.g.: $gameTimers.isOverVar("Chicken", 2); will return true if the timer Chicken hasn't been updated since the time specified in variable 2. It also uses the mode to decide whether it's milliseconds, seconds or minutes.

Demo
Available here.
Sounds and graphics removed to make the download faster. Please copy and paste it in a new project.

Script
You can download it here.

FAQ
No FAQ yet.

Credit and Thanks
- FeelZoR for making the plugin :p

Changelog

Version 2.0 - Major update
+ Added possibility to delete a timer
+ Timer update is now handled by a specific command.
+ Plugin commands used instead of script calls when possible.
* Timer creation cannot update timers anymore.​

Version 1.1 - Bug fix
  • Corrected a bug where the save wouldn't work.
Version 1.0 - Initial Version

Author's Notes
As this is my first plugin in RMMV, do not hesitate to report any bad things in the code.
It's probably not very well-designed sometimes, as I'm not very used to JS and RMMV yet, I'm learning with what's already made! :D

Do not hesitate to report me any bug you find, and I'm open to suggestions too!
 
Last edited:

Feelzor

Veteran
Veteran
Joined
Oct 10, 2017
Messages
92
Reaction score
79
First Language
French
Primarily Uses
RMMV
Updated the plugin to v2.0, it's now easier to use, I guess.

Changelog:
+ Added possibility to delete a timer
+ Timer update is now handled by a specific command.
+ Plugin commands used instead of script calls when possible.
* Timer creation cannot update timers anymore.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

buinguyenhoangtho wrote on fizzly's profile.
Hello @fizzly, i would like to use your asset/ resource for my project ( is maybe commercial ). May i have your permission? Thanks you !
I have 470+ hours on RMMV but have only made a demo game, is this normal? :kaoswt: (I lose motivation a lot plus I use a 32gb laptop, so..)
I like Iron Maiden.
Benku wrote on Magnus0808's profile.
Hey man you helped me out a long time ago with a plugin i was wondering if you can help me out one more time since its literally the last thing i need help with if not is cool but id figured id ask you one more soild.
Stream will be live shortly with a guest stream! Tonight, a new guest joins~ Feel free to drop by!

Forum statistics

Threads
95,425
Messages
929,070
Members
125,660
Latest member
AphoticAmaranth
Top