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.

Small Question

Maybe Something like this:
Code:
If $game_player.x == $game_map.events[ID].xand $game_player.y == $game_map.events[ID].y
#whatever
end

This checks if you are in the same spot of the event... this is what you want right?
 

Anonymous

Guest

Code:
 if $game_player.x = ($game_map.events[ID].x - 1 or $game_map.events[ID].x + 1 or $game_map.events[ID].x) and $game_player.y = ($game_map.events[ID].y - 1 or $game_map.events[ID].y + 1 or$game_map.events[ID])

but if it's in a "Conditional branch: Script: Blahblahblah" line, you won't need the "if" statement, so:

Code:
Conditional Branch: Script: $game_player.x = ($game_map.events[ID].x - 1 or $game_map.events[ID].x + 1 or $game_map.events[ID].x) and $game_player.y = ($game_map.events[ID].y - 1 or $game_map.events[ID].y + 1 or $game_map.events[ID].y)

I hope that helps!

P.S. This also will activate the event if your location is like so:

Code:
O..
.X.
...

where O is you and X is the event. You may need a handler for that, but that's a little too complex for me.
 
What are you trying to do?
I think of way, but it would work with distances... like you check the distance between the player and the event and then do what you want if it is true..
 

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