Region ID check

Status
Not open for further replies.

Milena

The woman of many questions
Veteran
Joined
Jan 26, 2014
Messages
1,281
Reaction score
106
First Language
Irish
Primarily Uses
N/A
Is there a way or a script function that allows me to check which region id there is at every map. Say for example, my map 1 has Region IDs 1 and 2. Now, I want to determine all the parts of region id 1. 



So what I am aiming for is a way to check my map's region ids, and do something with it. Like, I want my region id 1 to be a healing ground, so when my character steps to all region 1 tagged part of the map, I recover my hp.
 

Zevia

Veteran
Veteran
Joined
Aug 4, 2012
Messages
640
Reaction score
353
First Language
English
Primarily Uses
RMMV
You could do the healing ground idea without using a script. Create three variables - PlayerX, PlayerY, and RegionID. Set PlayerX equal to Game Data -> Character Player's Map X. Set PlayerY equal to Game Data -> Character Player's Map Y.

Then, on page 3 of event commands, look for "Get Location Info." Under "Variable for Info," select your RegionID variable. Then for info type, do "Region ID." Under location, do "designation with variables," and make the Map X variable your PlayerX variable and your Map Y variable your PlayerY variable.

Then, in a parallel process on the map, do a conditional branch: Variable RegionID is equal to 1 -> Change HP Entire Party +9999 (or however you want the healing to work). At the end of the event, add in a wait 5 frames or wait 10 frames or something.

What this will do is track your player as he moves around the map and, if at any point he steps onto a tile that's been labeled as region 1, will recover health.

The whole thing will look like this:

 

Milena

The woman of many questions
Veteran
Joined
Jan 26, 2014
Messages
1,281
Reaction score
106
First Language
Irish
Primarily Uses
N/A
You could do the healing ground idea without using a script. Create three variables - PlayerX, PlayerY, and RegionID. Set PlayerX equal to Game Data -> Character Player's Map X. Set PlayerY equal to Game Data -> Character Player's Map Y.

Then, on page 3 of event commands, look for "Get Location Info." Under "Variable for Info," select your RegionID variable. Then for info type, do "Region ID." Under location, do "designation with variables," and make the Map X variable your PlayerX variable and your Map Y variable your PlayerY variable.

Then, in a parallel process on the map, do a conditional branch: Variable RegionID is equal to 1 -> Change HP Entire Party +9999 (or however you want the healing to work). At the end of the event, add in a wait 5 frames or wait 10 frames or something.

What this will do is track your player as he moves around the map and, if at any point he steps onto a tile that's been labeled as region 1, will recover health.

The whole thing will look like this:

Ahhh I never had that in mind, thanks a lot. Now I am wondering how to convert this event into a script :o
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
The event above would continue healing even when the player isn't moving. Is that what you want? Or do you want them to heal a little bit every time they step onto a region 1 tile (and then not again until they take another step)?


The script linked by Andar will do that for you.
 

Milena

The woman of many questions
Veteran
Joined
Jan 26, 2014
Messages
1,281
Reaction score
106
First Language
Irish
Primarily Uses
N/A
This is helpful, thanks! I will be using it on my project :D
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.
 
Status
Not open for further replies.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD

Forum statistics

Threads
105,868
Messages
1,017,072
Members
137,578
Latest member
JamesLightning
Top