ADJUSTING ENCOUNTER RATES

How to adjust encounter rates to various circumstances

  • Xenomic
  • 04/16/2013 04:21 AM
  • 2375 views
Hello and welcome all! This is my first tutorial, so don't mind if I'm green around the edges here. ^^;


Anywho, today will be a tutorial on how to adjust encounter rates.

"But Xenomic! We already know how to do that! We just either do that in the Map Editor or by using the Change Encounter Rate command!".

Why yes, yes you can. And this is going to cover using the Change Encounter Rate command. In particular, using it in different situations and circustances.

I. The Basics

Before we begin, at least allocate one variable slot for this particular tutorial, as this is what we will be using to modify encounter rates. You will also need a Common Event, set to Parallel Process. This tutorial also assumes that you, the coder, knows how to deal with Conditional Branches at least decently well, as well as understanding coding structures.

II. No Encounters, aka the "Moogle Charm"

One of the more common things asked is how to make this special accessory from Final Fantasy VI, which prevents all random encounters entirely. Why, my good friend, allow me to tell you how to do so!

Firstly, we want to make this accessory, if you plan on having it as such. You can also have it as an armor or helmet, or even a shield or weapon. What matters is that you have it as SOMETHING that a character can equip. Let us name it Demon Charm for this exercise. The next step is to go to your common event (Let's name it Encounter Stuff), which should be a Parallel Process. Finally, name a variable "Encounter" or some such.

Here, you want to first set up a Conditional Branch, and check for the very first condition, being the character in the party first off, and make sure this particular Conditional Branch has "Execute Custom Handler" checked. The next step is to make another Conditional Branch inside of the first Conditional Branch, and having this one check if the character has the Demon Charm equipped. Finally, we make the last Conditional Branch within this conditional Branch, and have it check if variable "Encounter" is equal to 0. Now, within the third Conditional Branch (the one checking for the "Encounter" variable, you'll want to go to Variable Operations and set your "Encounter" variable to 1. This is all you'll have to do for this segment.

The last part will be in the Else Handler, in which you make another Conditional Branch, and have this one checking if variable "Encounter" is set to 1. Within this Conditional Branch, go to Variable Operations and set your "Encounter" variable to 0.

At the very end of this, outside of the entire thing at the bottom, make one more Conditional Branch, this one checking if variable "Encounter" is equal to 0. Inside here, go to Change Encounter Rate and set it to your normal default encounter rate. Outside of this Conditional Branch, make one more Conditional Branch checking to see if variable "Encounter" is equal to 1, and within here change the Encounter Rate to 0. Make sure to place a "Wait: 0.0 Sec" at the very end to help ease lag!

And that's it! You have your very own custom Moogle Charm!




III. Half Encounters, aka the "Ward Bangle"

This section will be dealing with how to make a piece of equipment reduce encounters by half. And by encounters, I mean the default RPG Maker 2k3 encounter system, which is a bit flawed but bear with me!

Firstly, let us make a piece of equipment that this will work with. I suggest either an accessory or armor, but let us go with an armor for this example, and let us call it the "Avoidance". Stats doesn't matter or anything, just so long as a character can equip it. This will be as simple as the No Encounters segment.

Now, in your Encounters Stuff common event, go right after your No Encounters coding (if you have it) and right before your conditional branches that checks for variable "Encounter". Here, let us make a new Conditional Branch, and have it check to see if your desired hero is in the party (for this example, we shall use Aya). Also make sure to have the "Execute Custom Handler" checked, similar to the No Encounters version. Next, make a conditional branch inside this branch, checking to see if Aya has the Avoidance equipped. And finally, make one last conditional branch to check to see if variable "Encounter" is equal to 0. Inside this conditional branch, set "Encounter" to 2.

Now, in your Else Handler, make a conditional branch to check to see if "Encounter" is equal to 2, and within this branch, set "Encounter" to 0. Finally, outside of the conditional branches (make absolute sure that this next segment is not in any conditional branches, and that it's at the very end!), make one more conditional branch to check if "Encounter" is set to 2, and use Change Encounter Rate to set your encounter rate to double what you normally have (if you use Encounter Rate: 80, you would set the encounter rate to 160). Make sure to have another conditional branch to check if "Encounter" is set to 0 to return the encounter rate back to your default value, if you do not have one already.





IV. Two Characters with the same piece of equipment


This may be something you run into if you decide to make it so that a single piece of equipment is not used by only one character, and you want your game to check for multiple instances of encounter rates (for instance, Half Encounters and No Encounters). Let's take a look at how this is done. First off, we're only going to check for two characters in this example. Let us use Aya and Momiji as the characters for this.

Firstly, use a conditional branch to check if Aya is in the party, and set this to have "Execute Custom Handler". Inside of this branch, make another branch to check to see if Momiji is in the party, but do not check "Execute Custom Handler" here. Now, inside of the Momiji branch, make a branch to check to see if Aya has the Avoidance equipped, and check "Execute Custom Handler". In this branch, make ANOTHER branch to see if variable "Encounter" is set to 6, and then in THIS branch, set that variable to equal 0. Then make two more branches, one to check if "Encounter" is set to 5 and then setting "Encounter" to 0, and one other to check if "Encounter" is set to 0 and then setting "Encounter" to 7.

Now, in the Else Handler for the branch checking if Aya has Avoidance equipped, make a branch here to check if Momiji also has the Avoidance equipped. Copy and paste the "Encounter" branches from Aya's Avoidance branch into this branch. Finally, in the last Else Handler, made from checking if Aya is in the party, have one last branch checking to see if "Encounter" is equal to 7, and then setting that variable to 0 within that branch.

The last thing to do is outside of the entire branch, make three separate conditional branches to check if "Encounter" is equal to 5, 6, and 7 respectively, and in each branch set the variable to 0. Make sure there is a conditional branch checking for "Encounter" being 0 that is setting the encounter rate back to normal as well!




V. Characters in the Party

It is entirely possible to alter encounter rates simply by having characters in the party. The simplest way to deal with this is to have a conditional branch to check if the character is in the party and checking "Execute Custom Handler", and then within that branch, make a branch to check if "Encounter" is set to 0, and then setting the "Encounter" variable to a specific number of your choosing. Afterwards, in the Else Handler, make a conditional branch to check if "Encounter" is equal to whatever number you chose for the character, and within that branch, setting that variable back to 0.

This can get a bit more complicated if you have multiple characters that alter the encounter rate. For instance, let's say that you have Cirno, who doubles the encounter rate while in the party, and Yuuka, who halves encounter rates, in the same party. To balance them out, you want to make sure that they effectively cancel each other's abilities out so that encounter rate is set to normal. But how would one go about doing so? This is handled much in the same vein as with Section IV actually. Let us take a quick look.

First, let us make a conditional branch to check if Cirno is in the party, and then check "Execute Custom Handler". Now, within this branch, check to see if Yuuka is in the party and check "Execute Custom Handler", and then set "Encounter" to 0. Now, in the Yuuka custom handler, have a branch checking if "Encounter" is set to 0, and then set it to 3.

Next, in Cirno's Else handler, let us make a branch to check if Yuuka is in the party and check "Execute Custom Handler". Now, in Yuuka's branch, check to see if Cirno is in the party, also checking "Execute Custom Handler", and within this branch, set "Encounter" to 0. In Cirno's Else Handler, have a branch checking if "Encounter" is set to 0, and then set it to 2.

Finally, in Yuuka's Else Handler, have a branch to check if "Encounter" is set to 2, and then set the variable to 0. After this branch, also check if "Encounter" is set to 3, and then set it to 0. At the very end of the entire event, outside of the entire conditional branch, have three separate conditional branches to check if "Encounter" is equal to 0, 2, and 3 respectively, and set your normal encounter rate in the branch checking if "Encounter" is 0, your Halved Encounter encounter rate in the branch checking for 2, and your Double Encounter in the branch checking for 3.





VI. Combining it All

Now that you have each individual pieces, it's simple to just plug them all in. However, be wary of the ORDER that you plug them in, as it will ALWAYS check in order of what you put in. If you want your No Encounters to happen first, then make sure that it's the very FIRST thing in the entire common event. Otherwise, if you have it set to the second thing in the list, and Half Encounters first, the common event will read and set Half Encounters (if all conditions are true) before setting No Encounters.

The following image is just an example of how the entire thing should look if plugged in together. Your order and mileage may vary!





Hopefully you find this tutorial somewhat useful if you're using the default Encounter Rate! And hopefully this tutorial wasn't too confusing to follow. If you have any suggestions or criticisms for improving this tutorial, or for future tutorials, please feel free to let me know.

You can find this and more in one tutorial here: http://rpgmaker.net/media/content/users/18498/locker/RPG_Maker_2k3_Tutorials.txt