Can I check the coordinate of an event?

Hello!
I try to keep myself simple, my situation is a bit complicated.

I'm working on a strategic minigame. The AI can place units on the field and rearrange them. I now want to use a conditional branch to check if there is already a unit on a certain field. If there is, the AI will place its unit somewhere else. I have a lot of events and I need an easy way.

Do you have any idea how I can do this? I am very grateful for help.
The Game Data field of Control Variables lets you select from the X and Y coordinates of any event on that map. You can then use Conditional Branch to see if it's a specific number, in range of numbers, whatever.

If you're doing something like spawning events - which you don't say in your post - then you'd need a code solution.
$gameMap.event(ID).x, $gameMap.event(ID).y
New events should not spawn.

Would I have to check every single event? Is there no way to check if there is any event in this place?
Get Location Info has an option for Event ID, which is 0 if no event is on the specified tile.

(Technically that's just a shortcut for checking the positions of all events.)
Is there no way to check if there is any event in this place?
Sure there is - but that's not the same thing that you asked initially:
1724433753990.png


Checking the coordinates of an event and checking whether a set of coordinates has any event are two separate things.

Conditional Branch -> Script -> $gameMap.eventsXy(x, y).length
replace the letters x and y with the coordinates you want to check. The conditional branch will be true if any events are there.

Edit: I forgot there was an event command option for this, as @caethyril pointed out.
Sorry for my imprecise question. It worked, thank you!

Original thread: https://forums.rpgmakerweb.com/threads/can-i-check-the-coordinate-of-an-event.171354/