HOW TO MAKE AN ENEMY REPEL ITEM

A brief tutorial on how to make an item that prevents random encounters.

Hello, this is Darklordkeinor with another Rpg Maker tutorial. I would like to discuss the concept of random encounters. In your typical Rpg game, random encounters are one of the most common elements that can be found in this genre. Typically, you walk around the map and your player party is attacked by a group of monsters. Now suppose you wanted to make an item that would temporarily prevent an enemy encounter.

If this is the type of system your Rpg Maker game is using, then you might find this tutorial helpful. First, make an item (we'll call our item "Repel"). Make this a switch item. Have it turn on a switch that we will also call "Repel". Make a common event that is set to parallel process, and have the trigger switch be set to "Repel".

Now for the commands, we'll focus on the enemy encounter rate. In order to prevent enemies from appearing, set the encounter rate to 0. To merely lessen the chance of an encounter, you could set the encounter rate to a higher number of your choosing. After this, merely set the waiting time to whatever you desire. Finally, turn the encounter rate back to whatever it was originally set to and turn the switch "repel" off.

Our code should look something like this:

<>Encounter Rate: 0St
<>Wait: 15.0s. ***Note: this can be changed to any duration of time you desire***
<>Encounter Rate:25St ***Note: This can also be changed if the encounter rate in your game is different.***
<>Change Switch: -OFF Set
<>

If you wish to remove the player's repel item after use, just add in this additional line of coding to the above common event:

<>Change Items: Repel 1 Remove

Hopefully, this will help add a little variety to your game. Please bare in mind, once again, that this tutorial is only designed for a game that relies on random encounters.

Happy Rpg making!

Posts

Pages: 1
Great tutorial!

The only issue I see is when you have dungeons that don't have the encounter rate of 25 steps. I tend to adjust encounter rates depending on each map (larger maps have larger encounter rates, maps with puzzles have larger encounter rates, etc) so you'll have to take that into consideration with the rest of your code by writing some kind of conditional depending on the map you're on.

Makes me wish you could control the encounter rate by variable to make the code easier!
author=PepsiOtaku
Great tutorial!

The only issue I see is when you have dungeons that don't have the encounter rate of 25 steps. I tend to adjust encounter rates depending on each map (larger maps have larger encounter rates, maps with puzzles have larger encounter rates, etc) so you'll have to take that into consideration with the rest of your code by writing some kind of conditional depending on the map you're on.

Makes me wish you could control the encounter rate by variable to make the code easier!


Excellent point. I'd have to tinker with the coding to resolve the issue you mentioned. Several conditional branches mixed in with the coding would most likely solve this issue. Nonetheless, this tutorial should give the prospective game designer an idea on how to make a repel item.

I'm glad to hear you liked the tutorial and I do agree with you about the variable idea. Rpg Maker's coding system can be a bit of a nuisance at times.
Thank you for this!! This was extremely helpful!
author=lonestarluigi
Thank you for this!! This was extremely helpful!


You're welcome! :)
Pages: 1