Jump to content

Announcing our new website

To find out the latest about our new website, visit Game Dev Unlimited

Enemy Encounters Tutorial


  • You cannot reply to this topic
3 replies to this topic

#1 Marked

    I administrate

  • Admin
  • 3,338 posts

Posted 11 December 2007 - 02:47 AM

In this Tutorial, I will show you how to only encounter enemies on specific tiles on your map. This is exactly like how the encounters work on games like Pokemon.

First off all, open up the database in RPG Maker XP, and goto the tilesets tab. The last button on the very right side is called "Terrain Tag", click on that.
This will show "0"s over all of the tiles on that Tileset. By default every tile is assigned to 0, and you can change these value from 0-7. These numbers are to be used to identify tiles with variables.

For this tutorial, I will use the "Grassland" Tileset.

Open your database and goto the "Grassland" tileset. Click the "Terrain Tag" button. Here we want to change the value of the tiles we want to encounter enemies when the character is standing or walking through them. I'm going to set all the grass tiles to "7" as shown below.
Posted Image
This is all we need to do in the Database, click OK.

Now place some of those tiles into your map. Goto your "Map Properties" and add some Troops. We are going to want the "Step Average" to be quite low. I'm going to set mine to 3.
Posted Image
Now make an Event somewhere on your Map.
Set the "Trigger" to "Parallel Process"
Add a new "Control Variables" command. Here we can setup the Variable which will set the Terrain Tag the Player is currently on. So create a new Variable and name it "Set Terrain Tag".
In the Control Variables command window, have the "Operation" set on "Set", and the "Operand" set on "Character" >> "Player" >> "Terrain Tag", as shown below.
Posted Image
Next, make a "Conditional Branch" command.
On the first tab, set it to "Variable", and make sure the Variable selected is the "Set Terrain Tag" Variable. In the next box, have it set to "Equal to", and a Constant of 7. This command basically checks if the variable "Set Terrain Tag" is 7, and the "Control Variables" command above sets this value to the value of the Tiles Terrain Tag value. So when the player is on the grass, the variable "Set Terrain Tag" is set to 7, and when on any other tile, it is set back to the default value, 0.
Inside the condition branch, under the first line, add the command "Change Encounter", and set this to "Enable". Inside the Condition Branch under "Else", add the command "Change Encounter", and set this to "Disable".

Now test play your game. Once the player walks into the grass, you should encounter enemies, but anywhere else you should have encounters.

Demo

#2 Black Shadow

    The wind blows within my soul.

  • Member
  • 194 posts

Posted 11 December 2007 - 05:24 PM

I didn't even know people could to such things T_T(Dies inside)

Very good tutorial, with a good layout and explanations. Good job.

#3 C.L.

    Member

  • Member
  • 26 posts

Posted 12 December 2007 - 05:28 AM

Thanks, awesome job.

#4 KarshnerShagger

    Newbie

  • Member
  • 20 posts

Posted 31 December 2007 - 04:15 PM

Thank you so much for showing exactly how a Terrain tag could work properly. I have heard about utilizing it, but have never really seen an example of it.

Thank you!





0 user(s) are reading this topic

members, guests, anonymous users