1st off we will set up our switches and variables we will be using.
- 1 switch to turn encounters on - Lets name it: Encounter On/Off
- 1 variable for the groups of monsters to encounter - Lets name it: Encounter Group
- 1 variable for the rate at which you encounter monsters - Lets name it: Encounter Rate
- 2 variables to determine if the player is moving - Lets name it: Player Movement 1 / Player Movement 2
We need to make a new common event, I'll name it simply Encounters. This will be triggered by a parallel process activated by switch Encounter On/Off.
Now we will start the common event by setting variable Player Movement 1 = Other | Steps (This is players steps)
We need a conditional branch, Player Movement 1 does not equal Player Movement 2.
This finds out if the player has moved. The player moved so lets set Player Movement 2 = Player Movement 1
Now we have that figured out lets figure out if they get attacked.
First we need to see what Encounter Group we are using.
Use a conditional branch using variable Encounter Group == 1
Now set variable Encounter Rate to a random number 1 to any number. For this tutorial I'll use 500.
(This part can be done multiple ways but it depends on the user. I'll be using the less repetitive way.)
Use a Conditional branch variable Encounter Rate >= 1 then Conditional branch variable Encounter Rate <=5
Inside of that Call a Battle Process - Monster
Repeat above step until you have all the monsters you want for this encounter group.
It should end up something like
1 to 5 Slime x 1
6 to 10 Slime x2
11 to 20 Ghost x 2
21 to 25 Bat x 2
26 to 30 Bat x 3
31 to 35 Beast
So what this means is if the random number that was chosen is 1 through 35 we get attacked. Depending on what the number is, is what we get attacked by. The random number is set 1 to 500 so you have a 35 / 500 chance to get attacked every step, aka 7% chance, roughly every 15 steps.
Repeat those steps for each encounter group.
Turning It On / Off
Thats the basics but now we have to turn this on. The easiest way to initiate this is to incorporate it into leaving town events. Before you Transfer Player outside of town turn Encounter On/Off - on. Using the event to make you enter town turn the same switch off.
We have turned on the encounter rate but now we need to know what group we are fighting so we need to change variable Encounter Group to the group we want to fight. The first place you change this is simply back at the exit town event. Next is the big customization part. On your map make new events activated by player touch. Simply have them change encounter group to a new group. You want to fight new monsters in that forest, put encounter group forest on when you step on the forest.
And that is the tutorial. As you can see this can be used to customize encounters to extreme degrees. How often you get attacked, where you get attacked, allows you to add "Rare Monsters" and can let you do anything you want to the normal battles as every single one is called by you.
Below is the event coding as well as a small example of using it on a world map tileset. It does use quite a few events, but it depends on how customized you want the encounters.
Any questions / comments?
Click to view attachment
Click to view attachment