[RMXP] Get Event ID from X and Y with Script Call

Status
Not open for further replies.

Windyhouser

Veteran
Veteran
Joined
Oct 6, 2015
Messages
56
Reaction score
52
First Language
English
Primarily Uses
RMMV
I'm working on a very aggravating system in XP, and I've run into a case where I know an X and a Y, and need to know the event ID on that tile. In MV, I'd use Get Location Info. But unless I've missed something, XP doesn't have an equivalent, and I'm not good enough with Ruby to spin one up.
Thanks! :cutesmile:
 

KK20

Just some XP Scripter
Veteran
Joined
Oct 11, 2018
Messages
281
Reaction score
106
First Language
English
Primarily Uses
RMXP
It's already in Game_Map:
Code:
  #--------------------------------------------------------------------------
  # * Get Designated Position Event ID
  #     x          : x-coordinate
  #     y          : y-coordinate
  #--------------------------------------------------------------------------
  def check_event(x, y)
    for event in $game_map.events.values
      if event.x == x and event.y == y
        return event.id
      end
    end
  end
Code:
$game_map.check_event(x, y)
 
Last edited:

Windyhouser

Veteran
Veteran
Joined
Oct 6, 2015
Messages
56
Reaction score
52
First Language
English
Primarily Uses
RMMV
Oh my gosh, thank you so much! It works perfectly. :D
 

hiddenone

Lurker Extraordinaire
Global Mod
Joined
Feb 19, 2014
Messages
2,497
Reaction score
5,334
First Language
english
Primarily Uses
RMMZ

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

 
Status
Not open for further replies.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD

Forum statistics

Threads
105,868
Messages
1,017,078
Members
137,580
Latest member
Snavi
Top