Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Pokemon Styled Random Battles (In Grass only)

Mars

Member

Hey what's up, I know you all hate me for my Map Tutorial, so since I've seen millions of people doing this the wrong way. They would set an event on each tile for grass, and that would cause more lag than a 874387325$ computer could handle...


This tutorial, obviously will teach you how to set the game, so that random battles only occur in thick grass. (Or where ever else you want it)

When I finished the tutorial, I decided to use the project as a demo, so if you are too confused, (Or just too lazy) to set it up, you can download it from this link.

http://www.megaupload.com/?d=C5XFVXT5


Let's get started shall we?

I. INTRODUCTION

A. I first thought of this when I looked at pokemon starter kits. The designers would make them with a sample demo included, and I noticed how horrible the lag was.. When I got too pissed to take the lag anymore, I checked to see what was ruining the whole game.. It turned out to be the wild random grass battles. And I got to thinking "What's the best way to do this?" so I opened a new project file and thought of what to do...


II. Setting The Areas In Which Battles Occur..

A. This is the easier part. RPGXP has seven terrain tags that can be used in the tileset tab in the database. I always wondered what they were and how to use them.. Here's what I do with them.

1. To set where the battles occur, first go to the tileset tab in the database and click the "Terrain Tag" button. It should look like this..(Note that I'm using the RTP tilesets..)
http://i72.photobucket.com/albums/i196/mashjka1/TerrainSetting.jpg[/IMG]

2. Terrain Tags are like in-game variables.. There quantity does not change anything, so the higher number won't make a difference from lower number. With that in mind, change the Terrain Tag Number on whatever tiles you like to numbers, depending on what enemies are where. I decided to go with 7 in the grass, and 6 on the bridge. If you copy me, it should look like this..
http://i72.photobucket.com/albums/i196/mashjka1/TerrainSetting2.jpg[/IMG]

3. Now that that's done, we can go to the actual setting of the chances that an enemy appears on these spaces. You can do this via common event, or (I prefer althought it takes more work) a map event.
This will teach you to do it with a map event, but it will only take a couple switches and some finger tip grease to make it with common events.


III. Setting up the chance of running into a battle.

A. Well, you have your terrain tags, and you're ready to set up the battle event, but wait! All we have are terrain tags! They don't relate to the player in anyway... or do they?

1. The first thing we must do, is make it so the map knows which terrain the player is on. To do so, right-click and click "New Event" anywhere on the map. This is the boring part. -.- The picture show's a blank event...
http://i72.photobucket.com/albums/i196/mashjka1/TerrainSetting3.jpg[/IMG]

2. Okay, blank event.. Let's change that. Right click and click "Insert" then find (On the first Tab) "Control Variables". Name the variable "Terrain" for now, and set it to the characters terrain, and press "OK" (oh, and also, make the event a parralel process) I'm a visual learner, so here's a pic.
http://i72.photobucket.com/albums/i196/mashjka1/TerrainSetting4.jpg[/IMG]

3. Now that the map knows where the player is terrain-wise, we can make enemies appear, but first we have to make a randomizer to know the chances of making a battle.

IV. Randomizer

A. Right click and click "Insert" and click "Control Variables" again. But this time, make it Variable 2, and name it Randomizer. This will give the player a chance of getting into a battle or not. (I like 1-5 but to make battles more or less scarce, change the variable. (higher = less battles)(lower = more) Like always, pictures are the best way of learning...
http://i72.photobucket.com/albums/i196/mashjka1/TerrainSetting5.jpg[/IMG]

V. Running into Battles

A. With Terrain Tags, and a Randomizer, we can now make the player run into battles. In this tutorial I will only tell you how to setup the grass, but it's the same for anything else.

1. Make a conditional branch in which the variable is = to the terrain number in the tilesets tab. For the grass I made, the number was 7. (Uncheck "Set handling when conditions do not apply")
http://i72.photobucket.com/albums/i196/mashjka1/TerrainSetting6.jpg[/IMG]

2. In that conditional branch, add a conditional branch in which randomizer = 20, (Uncheck "Set handling when conditions do not apply").

a. In that conditional branch, put (on tab 4) "button up is being pressed." this makes it so that the player only battles when moving.

b. In there change the same randomizer and make it 1 through 3. This makes it so the monsters are randomized.

c. Make conditional branches for 1, 2, and 3, inside them place "Battle Processing" for the monsters you wish to have. I set it so that there is less chance of running into three ghosts at once than two, by making it the following. (check the "Can Escape" option.)
http://i72.photobucket.com/albums/i196/mashjka1/TerrainSetting7.jpg[/IMG]

d.copy and paste the conditional branch for Button Up being pressed four times, and make it so that there's the same exact condition for "Up", "Down", "Left", and "Right".

The last thing that you MUST DO is put a wait of 5 frames on top of everything. If you don't, then you'll get a battle nearly every frame..

Well... I suck at ending things, so... bye?

Comment!

Ask for help if you must....
 
Great work!! This helped me out a lot. I was wondering how I was going to put in random battles. I liked the pics (they helped a lot) because I am more of a visual person.
 
Its good, but, I think, that if you want to put more troops on the map, there must be a very long event isn't it? For a pokemon game, a common event won't work good as well, cuz you don't want the same pokemons in every grass.
 

Mars

Member

@Yeyinde No matter if it's better or not. Scripts are easier, but they can become a pain in the ass when it comes to compatability. This is just an alternative.

@Mister Smit: It doesn't need to be a common event. I'm pretty sure I said I put seperate events on everymap for monsters.

@Everyone else: Thanks. If you need any help, just ask.
 

Mars

Member

Well... uhh.. yeah.
*Runs away*

Anyways, yeah it would, but you would have no conrtol over the different encounters for different places. (If in water you fight a squid, but in grass there's a lizard.)
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top