Hi - What is the easiest way to check a terrain tag? I want to setup a conditional branch that checks if the player is on a tile with terrain tag 5 then something happens. I know the script call for terrain tags is "$game_player.terrain_tag" but can't figure out how to get that meaningfully into a conditional branch.
Thank you
Checking Terrain Tags with Conditional Branch
● ARCHIVED · READ-ONLY
-
-
Have you tried to make the condition
if Script ($game_player.terrain_tag==5)
It's on the fourth tab. I'm not sure if it will works but if that's the script call then I'd give a try. -
You would have to have either a map event or common event running a parallel process while checking the terrain tag. You can use the script call mentioned by Juunanagou. You can use region ID this way as well.
-
Genius. Didn't know the conditional branches worked like this - thank you.Have you tried to make the condition
if Script ($game_player.terrain_tag==5)
It's on the fourth tab. I'm not sure if it will works but if that's the script call then I'd give a try.
Susan, I will use a map event with player touch/below player on the tiles I want to trigger the condition, thank you! -
Tried out.
$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. -
What you first suggested already worked - would this be an improvement, or?Tried out.
$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. -
Dunno, at first it didn't worked, but I changed it because I probably made a mistake. I didn't know the conditional branch worked like this too, it's a new thing for me too. Probably the first is more generic, it checks all the terrain tags, while the second check a particular spot on the map. Maybe for you the first one is better since in a particular spot you know what tag you are walking on.
-
@Dymdex :
Having a parallel process event with this conditional branch eliminates the need for you to place multiple events on the map to check the same thing, which can cause your game to lag if used extensively. That's one of the purpose to have terrain tags and region IDs in the first place.
Plus, you can place other events on those tiles.
Example :
Try creating two 30 x 30 map with 25% of the tiles made of those with the terrain tag.
- On the first one, place the events on the map as you mentioned to check that condition..
- On the second one, create a parallel process event checking the same condition.
Do try it out. -
Thank you, point made, you're certainly right and I will do that.