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.

A Simple Request

With the code "$game_player.x" and "$game_player.y" , I can print out the characters x and y position.  Does anyone know if I can do the same with an event and print out its' x and y position?
 
Yeah, you can check the x and y position of an event like this:
Code:
$game_map.events[id].x
$game_map.events[id].y

just replace "id" with the id of the event you want to check.
If you have any further questions don't hesitate to ask :thumb:

Over and out - Gando
 
Nice, thanks a bunch Gando.  ^_^

Another thing I forgot to mention though.  >,<   Any way to make it find the location of 'this event' instead of a preset one?

EDIT:  Nevermind.  "$game_map.events[@event_id].x" will print the current event.  Thanks for your help.

EDIT2:  Nevermind, that didn't work.  -_-  I guess it doesn't matter much anyways.
 
Hmm..  i'm not sure if i understand what you're asking.
But if you would like to print out the x position and y position of let's say the event[1], then you could do something like this:
Code:
print $game_map.events[1].x
print $game_map.events[1].y
 
Lol yeah, I know that.  What I mean is, if I want to make 100+ events of an event which declares its' position, I'd have to go through all 100+ and edit that part.  I tried a @event_id among other things but this is within the script part of the 'Custom Move' of the event.  The important thing is I was able to get what I needed, so if it's too much work don't worry about it.  Thanks for your time. ^_=  (0 for 'this event' doesn't work either, as I was hoping it would...just wanted to mention this)
 

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