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,946
Reaction score
8,614
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,728
Reaction score
15,308
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,728
Reaction score
15,308
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,728
Reaction score
15,308
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,025
Reaction score
5,906
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 Threads

Latest Profile Posts

FL Studio is a huge step up from LMMS but I'm having such a tough time with it D:<
The new Dune movie reminds me of the game Dune 2 made by Westwood. A quality product on its own, but extremely disloyal to its source of inspiration.
Terrible Writing Advice, you've done it again.
1635026211997.png
Feeling like my new profile picture is nice. Thinking of making it semi-permanent, does any one has an opinion? Does it look too evil or does it work as a public profile picture? :)
Bishiba.png

Forum statistics

Threads
116,033
Messages
1,095,129
Members
151,368
Latest member
aj1913
Top