How to save picture location coordinates to variable?

Status
Not open for further replies.

cuby

Perpetual Toil
Regular
Joined
Jun 20, 2015
Messages
232
Reaction score
65
First Language
English
Primarily Uses
RMMV
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:
 
Last edited:

cuby

Perpetual Toil
Regular
Joined
Jun 20, 2015
Messages
232
Reaction score
65
First Language
English
Primarily Uses
RMMV
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!
 

Showsni

Villager
Member
Joined
Jun 21, 2022
Messages
27
Reaction score
19
First Language
English (UK)
Primarily Uses
RMMV
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.
 

Attachments

  • x coord rpgmaker.PNG
    x coord rpgmaker.PNG
    81.2 KB · Views: 4

cuby

Perpetual Toil
Regular
Joined
Jun 20, 2015
Messages
232
Reaction score
65
First Language
English
Primarily Uses
RMMV
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:
 

slimmmeiske2

Little Red Riding Hood
Global Mod
Joined
Sep 6, 2012
Messages
10,403
Reaction score
6,585
First Language
Dutch
Primarily Uses
RMXP

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.

 
Status
Not open for further replies.

Latest Threads

Latest Posts

Latest Profile Posts

Apologies for posting again so soon, but I just had to share what I believe to be my best map yet, I'm over the moon with the way this has turned out to be.

Definitely leaning on the "try to" part of the status feed rule and I really try not to sad post, but not only is my kitty Simone more or less confirmed to have IBD... but she has some pulmonary edema and a slightly enlarged heart. They say everything is early and mild and that I'm very diligent and observant about my pets but iunno...doesn't feel like a win right now.


So it turns out music is fun to make????
A lil concept for a prison level. It's intentional that the chords and sound is the same from the previous concept I posted cause it's related to a certain character... What do u think?
I was wondering if I should ask the question
"Who Is Dalph?"
But I met him pretty fast and his answer was extremely helpful. So yeah. That probably answers it.
So in hindsight, I could have made a double-post in this category instead of setting up a post on a different site and figuring out how to share and then linking...

Forum statistics

Threads
134,907
Messages
1,251,816
Members
177,731
Latest member
Joerg_Sothoth
Top