Feelzor

Veteran
Veteran
Joined
Oct 10, 2017
Messages
92
Reaction score
83
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
83
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.
 

Latest Threads

Latest Posts

Latest Profile Posts

Quick little one day make. Having mimosas on a boat tomorrow but wanted to feel productive today. Ask me about my sunburn later.

GABposterwork.png

Working on a new poster.
I just posted the first devlog for The Hidden Art of Innkeeping: https://seaphoenix.itch.io/hiddenart!

BeachLogo.png
Might start playing some rpg maker games and uploading the games on youtube. Realistically they're not going to be for views. Just to give anyone some feedback on any games they're working on. So if you'd like me to play and review your game just reply them down here. And I'll upload them on Rpg4MGames.
Ah, so THIS is what it feels like to sleep till I naturally wake up, and not be woken up by an alarm or other unwanted stimuli... holy crap I feel like I can lift a house! XD (Or work on my game)

Forum statistics

Threads
131,616
Messages
1,221,618
Members
173,345
Latest member
Wyvern756
Top