Gw Temp

Menu

Tutorial - 'Predictable Encounters Part 1: Very Predictable En' by Guest

An item about RPGMaker 2000 posted on

Blurb

A very well-written tutorial showing how to make fixed-step encounters using events rather than RM2K3's default features.

Body

Okay, so we've all seen random encounters. But wouldn't it be great if there were PREDICTABLE encounters? That's right! Encounters that'll happen precisely when you want them to.

For this tutorial, you'll need knowledge in:
So, let's get started.

First, find the map you'll put the random encounters on. Next, make an event. Call it "Random Encounters" or something and put it somewhere out of reach. Make it a parallel process event. Put this code in for starters:
<>Loop
  <>
: End Loop
<>

Pretty easy. Double click on the "<>" in the loop. Put a "Key Input Processing" command, and make it use the variable "Walking." Check the directional buttons (up, left, right, down), but none of the others. After that, put a branch (fork), and put the conditions to the variable "Walking" is greater than 0. Make sure that "Execute custom handler if condition not met" is NOT checked. Your code should look like this, now:
<>Loop
  <>Key Input Proc: [####:Walking]
  <>Branch if Var [####: Walking] is 0 Greater
    <>
  : End
  <>
: End Loop
<>

In the "<>" inside the branch, put a Variable operation to add one to the variable "Steps." After that, put another branch and set the conditions to the variable "Steps" being 5 or greater. Once again, do not check the "Execute custom handler if condition not met" box. Now the code would look like:
<>Loop
  <>Key Input Proc: [####:Walking]
  <>Branch if Var [####: Walking] is 0 Greater
    <>Variable Oper: [####: Steps] +, 1
    <>Branch if Var [####: Steps] is 5 or more
      <>
    : End
    <>
  : End
  <>
: End Loop
<>

In the "<>" in the branch you just made, put an enemy encounter. Set the Monster Group to whatever you want, the escape handler to "custom handler," and whatever you want for the special battle conditions. Now, right before the ": End Loop" put a variable operation to set the variable "Steps" to 0, and another variable operation to put "Walking" to 0. Now you're done! Yay! Your code should look like this:
<>Loop
  <>Key Input Proc: [####:Walking]
  <>Branch if Var [####: Walking] is 0 Greater
    <>Variable Oper: [####: Steps] +, 1
    <>Branch if Var [####: Steps] is 5 or more
      <>Enemy Encounter: (condition), (monster group)
      : Victory Handler
        <>
      : Escape Handler
        <>
      : End
        <>
    : End
    <>
  : End
  <>Variable Oper: [####: Steps] Set, 0
  <>Variable Oper: [####: Walking] Set, 0
  <>
: End Loop
<>


There are some more things you can do with this, like having the encounter be random, which I'll be covering in the next part.

So, this is Maxlord, telling you to stay tuned!