problem with having shown pictures appear above the player

Hey guys,

Im having a problem with pictures appearing above the player.
Im creating a interaction system, where if you talk to a NPC - a bunch of images appear over the head over the player, where you can decide what your action towards this npc will be. This will basically be an alternative to the regular "show choices", but more styleful.
Anyway my problem is that when ive set all the correct coordinates etc, it will only work in that specific map, when i go to a smaller, or bigger map - or if im talking to an NPC who is close to the borders of the map, the location of where the pictures are supposed to be, wont be correct anymore.
So far the only solution to this, that i can think of, would be for me to check how close the player, or npc, is to the borders of the map, and add or subtract from the coordinates based on that. But thatd be incredibly tedious, and difficult to pull off for me, and thats why im kinda hoping for a more efficient solution from you guys! To have the pictures always show over the correct tile in question.
Your problem is the differences between map coordinates and screen coordinates.

Show picture always used screen coordinates, but from the sound of it you some how mixed map x or map y in there.

Show us a screenshot of the event and we can help you correct it.
Show picture uses screen coordinates, so your position on the map should't matter.

There's also this easy to use plugin but somehow for me the popup is below the sprite: https://galvs-scripts.com/2016/03/23/mv-timed-message-popups/

What I do to avoid the whole borders problem and keep the player centered is make maps surrounded by blank space the player can't go to, but it's going to be hard to change that now.
mhtY5u8.png
This is all the lines i have so far, since it was still in testing phase, so i dont think a screenshot is necessary.
Code:
◆Control Variables:#0097 Interaction X = $gamePlayer.x - 9 + 48 * 10
◆Control Variables:#0098 Interaction Y = $gamePlayer.y - 10 + 48 * 6
◆Show Picture:#1, Friendly_Icon, Upper Left ({Interaction X},{Interaction Y}), (100%,100%), 255, Normal
Also, because of what you stated, I think the problem might be the gamePlayer.x,y, since it shows the map coordinates, instead of the screen coordinates(i think?).
Also, because of what you stated, I think the problem might be the gamePlayer.x,y, since it shows the map coordinates, instead of the screen coordinates(i think?).

Yes. The pictures are always adjusted relative to the player position, not the screen. You might want to just have the choices appear at a corner of the screen instead of relative to the player, like a mini menu. If you still want it relative to the player, you'll have to do the border math or enlarge your maps to include inaccessible space like the picture I have above. When you do the map thing, you ensure the player is always right smack in the middle of the screen, making picture positioning very easy. You won't even need their map coordinates anymore.
@Andar @dahlys Actually i did a little test with control variables>gamedata> screenx,y. And i think it does exactly what i need it to do. But i would prefer a script command for the screenx,y of the player/events instead of using gamedata. Do you guys happen to know what the command for screen x,y is?
$gamePlayer.screenX()
$gamePlayer.screenX()
And just like that, all my current problems are solved. Thanks again bro!😀

Original thread: https://forums.rpgmakerweb.com/threads/problem-with-having-shown-pictures-appear-above-the-player.84929/