RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
Pokemon style encounters event tutorial

0 Members and 1 Guest are viewing this topic.

**
Rep:
Level 87
RIP w-hat the fork
While browsing on some script archive for RPGXP, I found a script that lets you encounter monsters only on specific tiles, like from the pokemon games where you encounter them on grass tiles.
Well, this tutorial will show you how to do this, without a script, and with only two events.

For an example, I will use a small map I made.


Step 1: setting up the tile
Spoiler for:
-Open up the database and go to tilesets. On the left hand side, find the tileset you are using. Then, on the right hand side, select TERRAIN TAG. This allows us to assign a value to the tile we want. Click on the encounter tile once. I used the grass tile for this. Now, you will notice the value went from 0, to 1. the value that the tile is now at one, and can be increased by clicking again. There are only 8 values: 0,1,2,3,4,5,6, and 7. 0 is the default, so we don't want to use that, and 1 & 7 sometimes will conflict with scripts, like some ABS. so, I am setting my value for the tile at 3. (NOTE: the value does not mean anything, a higher value does NOT mean it's better or worse.

Here is a screenshot:

Step 2: Setting up the first event
Spoiler for:
-Ok, now don't forget the terrain tag we used, it will be very important in a minute.
In this step we will set up the common event used to decide whether the player is on the tile or not, and then call forth the monsters to attack!
So, open up the database, and go to common events. Make it parralel, and choose whatever switch you want (it is important to remember the switch #)
Then, use a control variable command, and set up the variable to whatever number you feel like, the operation to "SET", and the operand to "CHARACTER". Next to character there are two drop down lists, one is for what character (the left drop down list), and the other is for What about them should be the variable value. The first should be "PLAYER" which we should leave alone, the second list should be changed to "TERRAIN TAG"
Screen shot

what we just did was make a variable be the same value as the tile's terrain tag that the player is standing on. So if the player is standing on the tile we set as 3 or whatever value, then the variable will be equal to 3 or whatever value.

Now, in the same event, we need to make a conditional branch, change it to variable, change the variable to whatever variable we used in the conditional branch, and make it a constant of the value we set the terrain tag to (I.E: 3).
screen shot

Next, inside the branch, we need to add "CHANGE ENCOUNTER" and make it "ENABLE". Then, after "ELSE" inside the branch, add another "CHANGE ENCOUNTER", but make it "DISABLE".
What this does is think "Is the variable equal to (number)? If YES, then the player can encounter monsters, if NO, then the player cannot."
Screenshot of the final event:

Now, we aren't done just yet, we need to make some final adjustments to our world in step three.

Step 3: final adjustments
Spoiler for:
-So, we are not done yet, we need to do a few things.
First, we need an event that turns on the switch for our common event, the very first event in your game should have this switch, to avoid unnecessary battles.

we also need to change the map properties to have the correct troops, and change the steps a bit, or we would never encounter anything.

Now test play the system, and be happy!


So, now you know the basics of how to utilize the terrain tag, there are some other things you can do using the same technique. One thing is to create a jumping system similar to that of pokemon (jumping over ledges), by using a set move router command.


I now feel like making some more tutorials based on pokemon...



« Last Edit: November 29, 2007, 05:55:04 AM by zzzdude »
Huge sig is huuuuge.

********
Shadow Knight
Rep:
Level 91
Ruin that brick wall!
Project of the Month winner for October 2008
Nice tutorial!
Be kind, everyone you meet is fighting a hard battle.

**
Rep:
Level 87
RIP w-hat the fork
Thank you!
I have been wanting to make a tutorial for quite some time now, just didn't know what to make it about.
My first tutorial, and I had to make it look nice.
Huge sig is huuuuge.

pokeball :)OfflineMale
********
Cheese
Rep:
Level 95
?
this could help some people, nice job.  :lol:
Watch out for: HaloOfTheSun

*
A Random Custom Title
Rep:
Level 96
wah
...

This is... very. Very. Very. Nice.

*Applause*

+1

This will remove the people wanting a script for this and stuff.

**
Rep:
Level 87
RIP w-hat the fork
I was going to make another tutorial just now on how to make a pokemon style jumping event system, and then I realized it is almost exactly the same as this tutorial, so I added a few sentences at the end of this tutorial.
Huge sig is huuuuge.