Possible to find a pictures X?

I'm finding myself needing to know the location of a pictures X coordinate and store it into a variable.

I had tried $gameScreen.picture(n).x;

It doesn't crash, but if I print the variable to a message box it just prints out the function.

Is what I want possible?

Edit: I.E I would like to replace a picture with a new one, however the picture is constantly moving, so I need a way to find it and replace it rather than resetting it's position
If it's printing out a function, you should probably run it as a function. Basically a lot of the data are exposed through getters, which are functions that retrieve the values you need for you.
If it's printing out a function, you should probably run it as a function. Basically a lot of the data are exposed through getters, which are functions that retrieve the values you need for you.

In all honesty, I barely understand Javascript, this is the first time I've used it. I'm not sure how I could run it as a function and store the value.

Edit: Maybe this should go into script requests, I have no idea where to begin, I just want to find the X of this picture
@SookyLala I'm on my phone ATM so I can't verify, but the format for the actual x coordinate is usually *._x so try instead $gameScreen.picture(n)._x
@SookyLala I'm on my phone ATM so I can't verify, but the format for the actual x coordinate is usually *._x so try instead $gameScreen.picture(n)._x

Ah dude, that worked like a charm, thank you very much, to think I was missing one simple character.
I had noticed in the JS scripts that somethings were written with '_' in front, but I am having trouble finding my around the scripts, it's definitely not as noob friendly as RGSS3.

Thanks again, man.
You can just do $gameScreen.picture(n)._pictureName = "new picture name" instead of having to pass in all the arguments again.
You can just do $gameScreen.picture(n)._pictureName = "new picture name" instead of having to pass in all the arguments again.


Hey thanks man, but I tried that in a script call and it didn't change my image. That would be a lot faster if I could get it to work
There would already have to be a picture there. Do you have any plugins that modify pictures? Can you show me the script call? Don't put the extension as part of the name - if your file is NewPicture.png then just put NewPicture
Yes, I had made sure the pictures were already there. The only Plugin I use is a Cache Preloader which I doesn't edit pictures.

I literally had an event with a wait time of 500 (To make sure all pictures were ready) and put ;

$gameScreen.picture(7)._pictureName = "Blood_Moon_Ripple_1"
It's not _pictureName, but only _name.
@Shaz & Poryg

Yeah, that works, and is a lot faster. It gives me a bit of confidence that I was actually close to these commands on my own which I found going through the js files. Thanks a lot guys, very helpful
If you want to learn scripting by going through the files, I would recommend starting with Game_Interpreter in rpg_objects.js. This class handles the processing behind all the event commands. Find an event command you want to "look behind the scenes" with, and search for that exact text in that file. You will see what the engine does when you tell it to execute that event command.
If you want to learn scripting by going through the files, I would recommend starting with Game_Interpreter in rpg_objects.js. This class handles the processing behind all the event commands. Find an event command you want to "look behind the scenes" with, and search for that exact text in that file. You will see what the engine does when you tell it to execute that event command.

Cool, thank you for that, I was looking in rpg_sprites.js

Original thread: https://forums.rpgmakerweb.com/threads/possible-to-find-a-pictures-x.92430/