How to save picture location coordinates to variable?

Hi all!

I can't seem to find the answer to this but I have to think it can be done -- if I have a picture that is moving in a pattern, and stops at a random position, how do I query the picture's coordinates where it ended up, and save the X and Y (of upper left, or center etc) to variables?

To give some context, this would be for a "timed attack" style sequence (hit button when a moving picture is in a certain place), that I would like to event without using a plugin so I can customize it more easily.

Thanks for your thoughts :LZSgrin:
Bumping 🙂 Hope that's okay, it's been a few days.

Strange and specific question I know, but if anyone has any information on how to figure out a moving picture's position by origin coordinate, I'd love to know it!
The Script Call spreadsheet (check the sticky threads) says that it's simply picture.x() and picture.y() to get the current x and y co-ordinates of a picture's origin. So,
$gameScreen.picture(1).x()
would get the current x coordinate of picture 1's origin. (That is, either the upper left of the picture if the origin is 0 or centre if the origin is 1, depending how you set the picture up). To save that in a variable, use the "Script" operand when you're setting up the variable.
The Script Call spreadsheet (check the sticky threads) says that it's simply picture.x() and picture.y() to get the current x and y co-ordinates of a picture's origin. So,
$gameScreen.picture(1).x()
would get the current x coordinate of picture 1's origin. (That is, either the upper left of the picture if the origin is 0 or centre if the origin is 1, depending how you set the picture up). To save that in a variable, use the "Script" operand when you're setting up the variable.

@Showsni you totally got it -- I keep the script call spreadsheet open at all times, and searched it for the answer, but I totally missed it here.

Works as advertised! Thank you thank you! :LZScheeze::LZScheeze::LZScheeze:

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.

Original thread: https://forums.rpgmakerweb.com/threads/how-to-save-picture-location-coordinates-to-variable.157893/