Status
Not open for further replies.

Ameer

Veteran
Veteran
Joined
Oct 13, 2018
Messages
85
Reaction score
13
First Language
English
Primarily Uses
RMMV
is there a way to check terrain tag in Mv in conditional branch and note that i am using mv 1.5.1 because my project is in development since rpg maker mv 1.5.1 was released and it is not running in newer versions
 

RetroExcellent

Cute Kiwi
Veteran
Joined
Nov 1, 2018
Messages
121
Reaction score
300
First Language
English
Primarily Uses
RMMV
Found this in an old post from 2014 from Juunanagou.

"$game_map.terrain_tag(x,y)==5

change x and y with the x and y of the map of the part you want to check. I made a simple event that controlled if that part has that terrain tag that plays a sound and makes an exlamaton mark on the character and it works. The tag is not game_character but game_map. Hope it's the thing you are searching for."
 

Ameer

Veteran
Veteran
Joined
Oct 13, 2018
Messages
85
Reaction score
13
First Language
English
Primarily Uses
RMMV
Found this in an old post from 2014 from Juunanagou.

"$game_map.terrain_tag(x,y)==5

change x and y with the x and y of the map of the part you want to check. I made a simple event that controlled if that part has that terrain tag that plays a sound and makes an exlamaton mark on the character and it works. The tag is not game_character but game_map. Hope it's the thing you are searching for."
i want to check it for whole map not only one tile is there a way for that without providing x and y . and what i want to do is make player die whenever he steps on it and if there's some script for that you can tell me about that script
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
33,981
Reaction score
8,620
First Language
German
Primarily Uses
RMMV
@Ameer
You'll need coordinates because the terrain tag is different for different tiles.
The only thing you can do is load the players coordinates into variables and then check the terrain tag of that position.

And no need for a script - you can do this with pure eventing on a parallel process

1) create an event set to parallel process
2) control variable to get player X position into one variable (done in the game data section)
3) control variable to get player Y position into another variable
4) get location info with the two variables above to load terrain tag into a third variable
5) conditional branch to check the variable with the terrain tag for the number you set, doing whatever you want if the player is on a terrain with that number
6) wait 5 frames (to prevent the parallel process from lagging too much

finished.
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
43,749
Reaction score
15,314
First Language
English
Primarily Uses
RMMV
Get Location Info is a command on tab 3.

You can shorten the process with this in the script of a conditional branch:
Code:
$gamePlayer.terrainTag() === 6

replacing 6 with whatever terrain id you want to use.
 

Ameer

Veteran
Veteran
Joined
Oct 13, 2018
Messages
85
Reaction score
13
First Language
English
Primarily Uses
RMMV
@Ameer
You'll need coordinates because the terrain tag is different for different tiles.
The only thing you can do is load the players coordinates into variables and then check the terrain tag of that position.

And no need for a script - you can do this with pure eventing on a parallel process

1) create an event set to parallel process
2) control variable to get player X position into one variable (done in the game data section)
3) control variable to get player Y position into another variable
4) get location info with the two variables above to load terrain tag into a third variable
5) conditional branch to check the variable with the terrain tag for the number you set, doing whatever you want if the player is on a terrain with that number
6) wait 5 frames (to prevent the parallel process from lagging too much

finished.
Well sorry sorry i meant region id
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
43,749
Reaction score
15,314
First Language
English
Primarily Uses
RMMV
It's still the same - Get Location Info will give it to you, but you have to provide the coordinates, because every tile on the map could have a different region. So the steps are the same as Andar gave, but you would get the Region ID instead of the Terrain Tag from Get Location Info.

Or the shortcut for the script in a conditional branch is:
Code:
$gamePlayer.regionId() === 6
 

Ameer

Veteran
Veteran
Joined
Oct 13, 2018
Messages
85
Reaction score
13
First Language
English
Primarily Uses
RMMV
It's still the same - Get Location Info will give it to you, but you have to provide the coordinates, because every tile on the map could have a different region. So the steps are the same as Andar gave, but you would get the Region ID instead of the Terrain Tag from Get Location Info.

Or the shortcut for the script in a conditional branch is:
Code:
$gamePlayer.regionId() === 6
Thank you so much that worked now mods you can close thread and can you tell me how to ask mods to close thread
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
43,749
Reaction score
15,314
First Language
English
Primarily Uses
RMMV
Just report your first post and let them know your problem is solved, and they'll close it for you.
 

Ameer

Veteran
Veteran
Joined
Oct 13, 2018
Messages
85
Reaction score
13
First Language
English
Primarily Uses
RMMV
Just report your first post and let them know your problem is solved, and they'll close it for you.
thanks i'll try it
 

slimmmeiske2

Little Red Riding Hood
Global Mod
Joined
Sep 6, 2012
Messages
9,043
Reaction score
5,914
First Language
Dutch
Primarily Uses
RMXP

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.

Latest Profile Posts

Redesigning characters after such a long time feels great. Makes me excited to work on an old game again.
Phone menu to replace main menu WIP:
It's been that long since I wrote a plugin, it took me 4 attempts to realize it's != rather than #. In a 40-line plugin, 20 of those lines being documentation!
Disk Check Plugin - Running on Linux:
RMMV-Game-Mint.png
workin on some graphics for my game. was originally planning on doing a cartoony style for the town but I might stick with this instead

Forum statistics

Threads
116,086
Messages
1,095,639
Members
151,460
Latest member
Lykaner05
Top