[Solved] How to check for an player position as a condition

i was searching around the forums/google but i got nothing i want

Something similar i see is this  b.jpg


but i got just no idea how it work at all...
it is easy, but you need a sequence of commands - it can't be done with conditional branches alone.


Use control variables (and two variables) to get the player X and player Y into those two variables (those coordinates are part of the "game data" option that only defaults to the map ID as the third part of the coordinates), and then use two (or three for map ID) conditional branches to compare those numbers with the coordinates you want.
What exactly is it you want to do, than we can offer more detailed Eventing or Eventing Script snippet Solutions.
What exactly is it you want to do, than we can offer more detailed Eventing or Eventing Script snippet Solutions.

i want the players use this pen infront of the wall to open it.


I'm not using the "key items" since i don't want to give player the clue that they should use item at there but let them figure out themself.

it is easy, but you need a sequence of commands - it can't be done with conditional branches alone.


Use control variables (and two variables) to get the player X and player Y into those two variables (those coordinates are part of the "game data" option that only defaults to the map ID as the third part of the coordinates), and then use two (or three for map ID) conditional branches to compare those numbers with the coordinates you want.

this is what i did here but it doesn't work is there any error here?


Untitled.png
"doesn't work" isn't really a bug report - you should be more specific.


That said, there is no direct error in the code, which suggests that you're either checking for the wrong coordinates or that you're not calling the common event correctly.


Please add a show text after the control variable commands but before the position check to display the current coordinates with a text "Position: x-\V[5], Y-\V[6], M-\V[7]".


If you don't get the message, the skill (or whatever) calling this common event is wrong. If you get the wrong numbers, you either misread the coordinate grid or the variables are used by a script in addition to your use.
"doesn't work" isn't really a bug report - you should be more specific.


That said, there is no direct error in the code, which suggests that you're either checking for the wrong coordinates or that you're not calling the common event correctly.


Please add a show text after the control variable commands but before the position check to display the current coordinates with a text "Position: x-\V[5], Y-\V[6], M-\V[7]".


If you don't get the message, the skill (or whatever) calling this common event is wrong. If you get the wrong numbers, you either misread the coordinate grid or the variables are used by a script in addition to your use.

Yes the map id condition is wrong. --- my bad.

thanks for that ^^

Original thread: https://forums.rpgmakerweb.com/threads/solved-how-to-check-for-an-player-position-as-a-condition.68055/