Wait Extended - Use minutes, seconds, variables

TDDP_WaitEx 1.0.1
Galenmereth
​

Introduction
This plugin allows you to call Wait events using minutes, seconds, variables, and more. Useful when you need to time waits to music, sound effects, or other units of time that make converting -- and reading -- frames inconvenient.

Using variables as wait duration also expands the possibilities of what you can do without the need for excessive conditional branches.

Features
  • Very easy Plugin Command syntax. As simple as typing "Wait 2m 30s".
  • Use variables with any time unit. For example: "Wait v1m v2s".
  • Doesn't alter MV's internal wait functionality; simply converts any of the time units to frames and passes it on.
Screenshots
Not much to show in a screenshot, but have an example nonetheless:

TDDP_WaitEx_example.PNG


How to use
Spoiler
Use the following Plugin Command structure:

Code:
Plugin Command: Wait 2m 30s

You can combine any number of units in any order you want. So while impractical, you can do this:

Code:
Plugin Command: Wait 15s 1m 2m 10f

The default time unit is frames, so if you simply want to wait for a variable's value number of frames, you can simply write:

Code:
Plugin Command: Wait v1

Variables
You can use variables as values. For example:

Code:
Plugin Command: Wait v1m v2s 30f

This would wait variable 1's value in minutes, variable 2's value in seconds, and 30 frames.

Verbosity
If you feel like the units are a little hard to read, you can use more verbose aliases. For example:

Code:
Plugin Command: Wait 3minutes 15seconds 20frames

All available units of time
Code:
------------------------------------------------------------------------------
Unit         | Valid keys       | Example usage
- - - - - - -|- - - - - - - - - | - - - - - - - - - - - - - - - - - - - - - -
Frames       | f, frames, blank | 5f, 5frames, 5
Minutes      | m, min, minutes  | 2m, 2min, 2minutes
Seconds      | s, sec, seconds  | 8s, 8sec, 8seconds
Milliseconds | ms, milliseconds | 300ms, 300milliseconds

Note: Keep in mind that ~16 milliseconds will pass for each internal "tick" in MV's engine, so wait times that aren't multiples of 16 when using milliseconds will not be entirely precise.

Download
Grab the latest release here: TDDP_WaitEx.js

Changelog
Code:
------------------------------------------------------------------------------
Date       | Version | Description
- - - - - -|- - - - -|- - - - - - - - - - - - - - - - - - - - - - - - - - - -
04/05/2019 | 1.0.1   | Add support for no time unit, defaulting to frames

Credit
- Tor Damian Design / Galenmereth

License
Released under an MIT License (free for commercial use)
Really nice plugin! As a composer, I'm definitely using this. Thank you so much for sharing this with everyone!
Great addition. Might use this in my game. =)
Bumping this for visibility 👋
Not a plugin everyone want but everyone need!
its a nice plugin for some others, but its a bit similair than SRD wait plugin,
only that SRD can "wait for animation" and such, this one might be usefull for
other parts, but I can tell, its extremely easy to use from the look of it 🙂
I tried PluginCommand: Wait 0m 10s and the command is not working to delay the script.
(edit) PluginCommand: Wait 0s doesn't work either.
I tried PluginCommand: Wait 0m 10s and the command is not working to delay the script.
(edit) PluginCommand: Wait 0s doesn't work either.
Can I see a screenshot of your actual event page?
I found a way to accomplish the same task by using a loop.
I found a way to accomplish the same task by using a loop.
How?

Using the plugin is probably much more convenient, but I've evented something similar using a loop.

First I create a variable (VAR 001) which is set to a multiple of 60. Why a multiple of 60? Because MV runs at 60 frames every second.

Next I create loop.

Inside the loop I create another variable (VAR 002) that starts at 0 and then adds +1 every time the loops runs. SInce the loop runs 60 times per second, VAR 002 will be a multiple of 60 every second / frame.

Next, inside the loop (and below VAR 002) I create a conditional that checks if VAR 002 is = > VAR 001, and if TRUE then it runs the Break Loop command to exit the loop and continue on with the rest of the event.

So by setting VAR 001 to however many seconds you want to run the loop for (3 seconds is 180 frames, so VAR 001 = 180 for a 3 second wait) you can effectively use that variable as a WAIT.

Original thread: https://forums.rpgmakerweb.com/threads/wait-extended-use-minutes-seconds-variables.108654/