Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

[Resolved] Terrain Tag RGSS syntax

Status
Not open for further replies.
I want to make a conditional branch in script for when the player touches a tile with terrain tag whatever. Can someone please tell me how to do this?
 
$game_map.terrain_tag(x,y) #retrives the terrain tag of the x,y coordinates

then just do something like this
Code:
if $game_map.terrain_tag($game_player.x,$game_player.y) == TAG
  #do something
end
 
Very useful, thanks, but for my particular script edit, I need to reference a square in front of the character [not that anyone knew that lol]. I'll keep your comment mentally recorded though [mkay more like in a .txt file cuz i'm so ditzy]
anyway, thanks.
 
@Raiju I also though of that but if he was gonna do that he could just use the variable funtion.
But since $game_map.terrain_tag(x,y) method works for all cases I though I could give him that.

@tori: you are welcome!
 
Status
Not open for further replies.

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top