is there a way to change a sprites Z (priority) without changing events page

I have searched around but can't find any scripts/plugins on this.

Say I have 2 events, both with larger than 48x48 sprites. They are right next to each other and both are set to priority same as player. I know that I can use switch/variables that change to another event page that has a different priority set. But I was wondering if there was a script call or plugin available that lets you change an events(or players) priority on the spot(for example during a common event) without changing event pages? The events are in a parallel process searching for conditions, that is why I'm searching for a way to change them without changing their pages.

Someone suggested I need to change the events Z. So that is what I'm trying to find out, how do I change its Z on the fly?

EDIT: Or does anyone know what determines which event sprite will show above another event sprite if both are set to same as player?
Events with higher ids will be shown over events with lower id if both are on the same layer.
Used that to make a Evented prototype for visual equipment in vx-ace. It should work the same in MV.
Iam not aware of a way to change the z layer of Events with a scriptcommand.
Events with higher ids will be shown over events with lower id if both are on the same layer.
Used that to make a Evented prototype for visual equipment in vx-ace. It should work the same in MV.
Thanks for the info, hopefully someone knows a way to manipulate this.
They are shown from lower id to higher id IIRC. There is no actual Z level property.
So you'd need to change the event position in the map event array, which would likely lead to trouble seeing that events are found by their position in the map array and not by their stored id property.

Manipulating an event priority is actually easy though if that would work. Just change it's _priorityType property.
Manipulating an event priority is actually easy though if that would work. Just change it's _priorityType property.
gotcha, so what would the script call be for that:
Code:
$gameMap.event(eventID).priorityType = 1;
?
Code:
$gameMap.event(eventID)._priorityType = 1;
The underscore is important.
Code:
$gameMap.event(eventID)._priorityType = 1;
The underscore is important.
gotcha! thank you
It should be noted that the _priorityType would be reset when you leave and return to the map as it will then recreate the Scene_Map which include loading the $dataMap from the JSON map file which have the old _priorityType.
It should be noted that the _priorityType would be reset when you leave and return to the map as it will then recreate the Scene_Map which include loading the $dataMap from the JSON map file which have the old _priorityType.
thanks, i actually need this to reset when returning, so that works

Original thread: https://forums.rpgmakerweb.com/threads/is-there-a-way-to-change-a-sprites-z-priority-without-changing-events-page.105525/