Random Encounter Events

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.


Get it at HimeWorks!
I don't understand. Can't we just do this with events?
I don't understand. Can't we just do this with events?
No - that would be evented encounters instead of random encounters, and those have limits in that way that they require events on the map.
This script is for people who want to use the random encounter tables, but need to change settings before the random encounter is executed.
No - that would be evented encounters instead of random encounters, and those have limits in that way that they require events on the map.

This script is for people who want to use the random encounter tables, but need to change settings before the random encounter is executed.
Ohhhhhhhh they're not events. I get it now.
It just wont work.. This is so frustrating... I just gave it a show text command in the common event number 004.


then of course I changed the "Variable" in the script into 4. But the common event is just ignored! Please help!
It just wont work.. This is so frustrating... I just gave it a show text command in the common event number 004.


then of course I changed the "Variable" in the script into 4. But the common event is just ignored! Please help!

Please post a screenshot of the common event and of the configuration of the script from the script editor.


Usually Tsukihime's scripts are well-tested, so it has to be either an incompatibility with one of your other scripts or you did something wrong.


In both cases we need more info to help


EDIT: the variable number is not the number of the event, but the number of the variable where the event number is stored - did you store the 4 into the variable #4 as well?
Please post a screenshot of the common event and of the configuration of the script from the script editor.


Usually Tsukihime's scripts are well-tested, so it has to be either an incompatibility with one of your other scripts or you did something wrong.


In both cases we need more info to help

ok please wait I'm currently making an animation. I'll be posting it after I'm done 🙂
@Kevin Eontrainer see my edit above - I already found your error, you didn't understand the instructions about the variable
@Kevin Eontrainer see my edit above - I already found your error, you didn't understand the instructions about the variable

I'm sorry I'm still a noob. So we have to store the common event number inside a variable?


For example:


Common Event number 004:CEname


then we set the number "4" to a variable..  lets say variable number 5


then in the config part of the script we write Variable: 5 in order to execute what's written in CE number 4


is that correct?
is that correct?

basically yes


The idea behind this is that this assumes you want to change which common event runs depending on where in the story the player is or on which map he is or whatever.


So you define a variable "100: Encounter event" (or whichever), set that number 100 in the script and then use the control variable command in the game to change which common event is running at which time.
basically yes


The idea behind this is that this assumes you want to change which common event runs depending on where in the story the player is or on which map he is or whatever.


So you define a variable "100: Encounter event" (or whichever), set that number 100 in the script and then use the control variable command in the game to change which common event is running at which time.

it worked! Thanks so much!

Original thread: https://forums.rpgmakerweb.com/threads/random-encounter-events.36243/