Hi there,
I'm not familiar with the MZ addon, but if I had to do what you want, I'd use two plugins:
- The essential (and free) plugin:
“event sensor” from MogHunter
(here's his page where you can download a demo of his addons to understand them well, and copy them to use them)
-
The optional plugin that will make your life easier:
Yanfly's self-variable and self-switch.
The event sensor plugin activates an event when you're nearby (you set the distance).
The self-variable plugin lets you create variables intrinsic to the event.
When you use a self variable, each event has its own variable, so you don't need to create var-spawn1 / var-spawn2 /var-spawn3, etc... but a “self-spawn” variable that will be instantiated in each event with different values.
The simple way would be to place “spawner” events with :
- 1st page :
condition :
self-var-spawn = 0
cross the hero / don't move /
with the sensor set to the distance at which you want the spawner to have a probability of spawning the enemy (example: 5 squares)
- 2nd page (the one where the sensor is activated) with the following instructions :
variable
self-var-spawn =
random between 1 and 4 (or + than 4 if you want to reduce the spawn rate%):
// you create a page 3 whose activation condition is the switch self-var-spawn = 1 with the mob type 1, which follows the player at a certain speed etc... with triggering when it touches the player = combat (if win: self-var-spawn = 4)
// you create a page 4 whose activation condition is the self-var-spawn = 2 with the mob type 2, which follows the player at a certain speed etc., triggered when the player is touched = combat (if win: self-var-spawn = 4)
// you create a page 5 whose activation condition is the self-var-spawn = 3 with the mob type 3, which follows the player at a certain speed etc., triggered when the player is touched = combat (if win: self-var-spawn = 4 )
// create a page 6 whose activation condition is the self-var-spawn > or = 4
with automatic launch:
self-var-spawn = 0 // reset for your next visit to the map
delete the event // so it doesn't respawn directly
the advantage of self switch and variable is that all you have to do is copy/paste the event and the variables won't interact with each other.
PS : sorry english is not my main language, I hope everything is understandable 😛