Random Encounter Events MV

In RPG Maker, you can set up your maps so that the player will randomly encounter enemies. You can choose what enemies will be present on the map, what regions they will be available in, how often they will show up, and so on.

randomEncounterEvents3

During the game, the player can then explore your maps and randomly encounter enemies.

However, what happens if you wanted to have some more control over the random encounters? What if you wanted to increment some variables depending on what you encountered? Or perhaps give the player a chance to skip the encounter by pressing a certain sequence of buttons in time!

This plugin gives you the tools to apply your eventing knowledge towards random encounters as well.

When the player runs into a random encounter, a common event of your choice will execute, before the battle begins.

Download

Plugin: download here (right click and save as)

Installation

Download the plugin and place it in the “plugins” folder in your project’s “js” folder. Then open your Plugin Manager (F10), double-click an empty row, and select the HIME_RandomEncounterEvents plugin. Please do not rename this.

Once it is in your list of plugins, turn the plugin on.

Usage

Begin by reserving a variable in your game. This is a special variable that the game will use to determine which common event will run.

Next, go to the plugin manager, double-click on the RandomEncounterEvents entry, double-click on the “Variable ID” entry, and enter the ID of the variable that you’ve decided to use.

randomEncounterEvents2

And now everything is ready.

Quick Tutorial

To test that it works, follow this example:

1. Let’s assume you have chosen variable 10 as your random encounter variable, and that your map has some random encounters set up.

2. Create a common event that will display a message “Encounter!” We’ll assume this is common event 1.

randomEncounterEvents4

3. Start testplay, press F9, and change the value of variable 10 to the ID of the common event you set up in step 2. In this case, I will set it to 1.

randomEncounterEvents6

4. Now, run around and wait for a random encounter. At some point, you should get a message that says “Encounter!”, and once you finish reading the message, the battle will occur.

randomEncounterEvents5

If you see the encounter message, then your random encounter event has been set up successfully. You can choose which common event to run at anytime using events.

Skipping Encounters

This plugin let’s you skip random encounters in your random encounter
event.

To do this, you would make a script call

  $gamePlayer.cancelEncounter();

Which would basically tell the engine to ignore the battle.

Accessing Encountered Enemy Information

In your common event, you will have access to the enemy troop that you encounter.

You can access the troop through this object in script calls

  $gameTroop

I will provide a separate tutorial showing some things you can do with the troop information.

You may also like...

52 Responses

  1. Renji says:

    im trying to make it so when ever my main hero kills a certain amount of a type of monster he will learn a skill and ive been having a hard time trying to figure out how to make this happen with random encounters, with your plug in do you have to hit F9 during actual game play in order to get the plug in to work or will it stay that way once you set it up?

  2. great sage wizard, 30 year old man baby says:

    Is there a way to configure this plugin for ALL battles, regardless of “randomness”?
    I see a particular use in my own game, where the main character will eventually gain the ability to rewind time in the battle.
    However, the problem lies with storing all the variables correctly at the beginning of ALL battles.
    Speaking of which, do you plan on updating your action history and time reversal script?

    • Hime says:

      No, it is meant for random encounters.
      Because it uses a common event, you can have evented battles call the common event.

  3. bob says:

    I can’t find the tutorial for “Accessing Encountered Enemy Information” anywhere, is it still available?

  4. Saghneen says:

    Combining this with moghunters theatrythm you could make evry encounter into a rythm challenge!

  5. A Figment of Your Imagination says:

    Thanks, Hime! This plugin will be very useful.

    Making a script call with “$gamePlayer.cancelEncounter();” raises an error (TypeError: Undefined is not a function), though- even on a new project without any other plugins.

    • Hime says:

      Oops, there’s another case of specification mismatch where I typed in one thing and then thought it was another thing.
      I’ve updated the plugin to reflect the instructions.

  6. I have a list of random events that will occur, only some of them are actual encounters. What I’d like to do with this strip is that, at the start of the Common Event, Cancel the Encounter, and then go through the random-generated events, and when it comes to an event that is an encounter, set it up and run that. I hope I can do it with this plug-in.

    • Hime says:

      Yes, you could use this plugin as a way to turn your random encounter into a “Random Chance event” where you roll some dice and depending on what you land on, you might run into an actual encounter, or you might win some gold or exp, or something else.

      You could use the battle processing command to set up a different battle.

Leave a Reply to David Foxfire Cancel reply

Your email address will not be published. Required fields are marked *