Off set issue with event

So I finally got my Health Bars working how I need them to. But the issue is this. When the enemy is clicked the health bar is drawn away from the enemy instead of under it.


I think it is cause I have the event set up like


event location x = this event screen x


event location y = this event screen y


what the different between map and screen location under self variables?


Should I have the event to have the health bar be equal to the map x,y location so that it follows the sprite around?
a map can be larger than the screen - the map XY will get the coordinates based on the entire mapsize (which might go up to 250), the screen XY will get the coordinates based on the part that is visible on the screen (which is usually limited to 17x13 or so).
So how would you link a HP bar to the event went is moving around or can you do this by script only?


Thank you also for your reply Andar
your best bet is probably a script.


There are ways to display an animation on an event, but using that would require a lot of tricks and different animations with different pictures and that would create a lot of lag.
You can link it using the event's Map X and Map Y, but you'd need to do a bit of a calculation after getting those figures to offset it the way you want.

Original thread: https://forums.rpgmakerweb.com/threads/off-set-issue-with-event.67755/