MV Random enemy spawn

Hello, I am planning to create a dungeon that contains monsters. I would like the monsters to appear randomly when the player enters the dungeon. Is there a plugin for this, or how can I implement such a feature? I appreciate your help, thank you.

I would like to create something similar to the video I shared, but the video uses RPG Maker MZ, while I am using RPG Maker MV.

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 😛
as an alternative, like galv event spawner (or yeps or ritter (paid)).

and create an array of event's id's on an event map to draw at random and number.

as there are many methods, the above is one way to pull it off, and it also depends
how many monsters.

just random on map (1-5) or on region defined?
based on difficulty?
always different location?

whatever the reason, the methods can be done on multiple ways, with plugins,
without plugins, but it really depends on complexity and how well you know the engine.

Original thread: https://forums.rpgmakerweb.com/threads/random-enemy-spawn.172097/