This script allows you to run a common event when you encounter an enemy through “random encounter”.
When the common event finishes executing, the random encounter battle will begin.
In this common event, you have the opportunity to run some extra logic before the battle occurs. The enemy troop that you will battle is available, and you can use this information in your event. For example, you may choose to display a message if a certain troop is encountered.
This script provides a special command that allows you to “cancel” the encounter, allowing you to create mechanics that allow players to skip encounters if they do not wish to battle.
Script: download here
In the script editor, place this script below Materials and above Main
In the configuration, you can choose a variable that you will use to determine which common event to run. This allows you to change the common event during the game if necessary.
The enemy troop that is encountered can be accessed using script calls by referencing
If you would like to cancel the random encounter, use the script call
And the encounter will be canceled.