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.

Syntax for Self Coordinates [Resolved]

Hey,
I'd like to know if there's a syntax for checking an event's x or y coordinate that I can use in a Call Script or Conditional Branch. I don't mean "$game_map.events[ID].x", because I'm using a script that calls an event from a different map. I tried "$game_map.events[self].x" and a few other methods, but none worked. If someone could help determine the exact wording for the code (or tell me if there isn't one and maybe suggest a workaround), that'd be great.
 
It is actually possible. I suppose what you are trying to do is to obtain the x and y for 'this event' as in setting a move route for this event so it works for more than just one event as a common event? If so, use the line:
Code:
$game_system.map_interpreter.get_character(0).x
or y or whatever you want to obtain.

Hope this works.
 
Yeah, it works fine now. I was just checking the distance between an event and the player. I could have probably used variables too, but this is a more conserving way.

Thanks a lot!

don't lock topics because they're solved even if they are you own, or if you didn't do it, then whoever did, don't D:
 

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