Get coordinates of player and save to variable

Zwataketa

Villager
Member
Joined
Nov 10, 2020
Messages
22
Reaction score
2
First Language
English
Primarily Uses
RMXP
Hello, I'm trying to make an event that causes an object to spawn on top of the player. I believe the best way to manage that for my purposes would be to make a command that takes the player's current coordinates and saves them to two variables (one for x and one for y). I'm not experienced with scripting in RPG Maker yet, so I'm not sure how to start with this. Could someone help me out?
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
33,356
Reaction score
8,390
First Language
German
Primarily Uses
RMMV
no need for any script
playerx.png
 

kyonides

Reforged is laughable
Veteran
Joined
Nov 17, 2019
Messages
306
Reaction score
77
First Language
English
Primarily Uses
RMXP
Code:
$game_variables[1] = $game_player.x
$game_variables[2] = $game_player.y

Just replace 1 and 2 with the positions you might prefer.
 

Latest Threads

Latest Posts

Latest Profile Posts

Me: "I don't to use other engines because I'd have to do a lot of coding."

Also my desktop right now....
mycurrentdesktop.jpg

...I literally spend more time using VS Code than MZ. :kaoswt:
actually, are there any JRPG type games (I guess turn based, so not ARPGs like say, Vagrant Story) where you have only one party member for the majority of the game? (I wonder if I'm forgetting something obvious.)
*sigh* This one turned out really well... except for the left arm pose...
fPRzKSp.jpg

Yes I purposely cutout the arm cause from the pic
A month into making my life/dating sim game and I've finally finished making all of the love interests :kaocry: I still have to make most of their emotion range and overworld sprites but aye I'm proud of myself.
would i get in trouble if i didn't take out the computer icons on my fake computer screen i had Discord, Messanger, and rpg maker up

Forum statistics

Threads
113,793
Messages
1,077,537
Members
147,842
Latest member
JeremyDoesSS
Top