An issue with events, trying to set a switch or variable based on where an event currently is.

So I'm making a chunk of the game where the player can load a minecart with dirt and then dump it into a pit to make the pit passable. The problem I'm currently having with this is that I don't know how to get the game to check if the cart is at x,y. I actually can't find any way for the game to pull where an event is at.

To be more specific, I found the 'get location info', set it to event ID, and set it to the spot next to the pit. Then set an event with the trigger of that variable=event ID, but the second event, set to trigger off of that variable, does not function. It's possible I'm misunderstanding what 'get location info->event ID' means. If somebody could enlighten me as to:

A: What the function 'get location info->event ID' does, what it's use is.

B: How I can set this up so the game will recognize event X has been moved to position Y, so that event Z can function. 

Thanks a ton in advance, and my apologies if the question is poorly worded or too vague, would gladly provide whatever detail's needed to be understood.
We would need to see your event to understand exactly what you're doing. Sounds like you just need to run it in a parallel process or something so it will continue checking.


If you post a screenshot of your event commands (include the whole event window, not just the list of commands), we can take a look and see.
I made this example for a different support question but it applies here as well, it's an example of how to get and how to compare an Event's location using variables to get the X and Y of the event

What this exact example does is gets th X and Y coordinates of the event and determins if the event is within a set boundry.

Map X and Y is calculated from top-left to bottom-right where top left is 0,0 and bottom right is the maximum for each. you need both X and Y to find the location of an event and compare it.

NPC Zoning Example.png
The way the OP is trying to do it would be much easier though - only a single command. Get Location Info, put the event id at that location into the specified variable, then test to see if the variable contains that value. I really suspect it's just a matter of not being called at the right time.
Thanks for the confirmation that get location info-event id does work how I thought it did originally, it was definitely just a mis-step at some point. I rebuilt it and everything works correctly now. Thanks a ton for the help.
It occurs to me that that function will only return a single event id. If you happen to have two events on the same tile (which can happen if one of them is set to Through), your event MIGHT be on that tile, but it might give you a different event id - like a boulder and a switch being on the same tile.


If that's a possibility, it would be more reliable to use Control Variables to get the event's X and Y position, then Get Location Info to get the region ID of the tile at that position (and of course, draw a Region 1 on the tile where the mine cart can empty out) - it's a matter of checking where the event is and if that's a valid tile, than looking at the valid tile and seeing what event is on it.
That may have been part of the issue as well, I did originally have events in the same location, but they were autorun/parallel, and when re-making the event I moved them out of the way.

Though I'm having some confusion with your recent message. Why would you need to check twice, once with event's position, and once with get location info? 
You're not checking twice. 

You're setting variables to the event's position, and then you're using Get Location Info to get the region at that position contained in those variables.

It's a different way of using the Get Location Info (you're getting the region on a certain tile, not an event id), but unfortunately the only options are to set a fixed location, or to use variables.  It would be nice to have a dropdown and be able to choose a player or event and just have it use their x/y coordinates, but you can't.
Alright, I'm just not following the utility of that in comparison to getting the event's location through variables, and then checking that those variables match the location you need the event to be in. I suppose the region thing would be more useful if there were multiple tiles that would work as a requirement for whatever the event was. Thanks again for the help, though.
Checking that the variables match the location means you have to have two conditional branches, and if you're doing an "else" something, you have to cater for one of them being the same, but not both.

Regions is good if you have several - say you have 3 switches and you want to move 3 boulders onto them, but you don't care which boulder goes onto which switch.  You can just do the above for all 3 events, and as long as all 3 are on the correct region ids, the puzzle is solved.
Ahh, thanks for the explanation. Appreciated, sir.

Original thread: https://forums.rpgmakerweb.com/threads/an-issue-with-events-trying-to-set-a-switch-or-variable-based-on-where-an-event-currently-is.50132/