This script introduces a new command that allows you to tell an event to stop and wait until a certain condition is met before proceeding.
RPG Maker comes with a wait command, but that is only to check whether a certain amount of frames have passed before proceeding. This custom wait command allows you to condition on things such as the value of a switch or variable, player input, or anything else that you can imagine that can be done with formulas.
The command is provided in two formats: a marked up conditional branch, or a script call so that you can choose which one you are most comfortable with.
Script: download here
In the script editor, place this script below Materials and above Main
There are two ways to specify a wait command: using a conditional branch along with a comment, or using a script call.
Conditional Branch format
Start by creating a comment and add the following to it
Then immediately after the comment, create a conditional branch. The event will understand that it should keep evaluating the condition until it is true.
This is not a normal conditional branch. Because it will continue to wait until the condition is true, the else branch will never be entered.
Script Call Format
Conditional branch supports script calls, but if you would like a compact command, you can simply use a script call command directly
Where the CONDITION is a valid formula that resolves to true or false. The event will wait until the condition is met.
To have an event wait until the player pressed the C button (Z or Return key),
use the script call
To wait until variable 5 has a value of 20, the conditional branch would look