MV change Enemy Sprite Priority during YEP action sequences?

I'm using Yanfly's action sequences as well as Yanfly's animated enemies. I'm trying to get the enemy Sprite to take priority over the actor when it attacks, since it looks weird when the enemy sprite goes under the actor when it goes to attack. Does anyone know of a command for that action sequences I can toggle which has priority?
Using YEP Battle Engine Core?

Look under the 5th topic: "Sideview"

Under there is an option regarding Priority.
Using YEP Battle Engine Core?

Look under the 5th topic: "Sideview"

Under there is an option regarding Priority.
Yes, I am, but I am looking for a way to change that depending on who's attacking who.
Did you try the different priority options?
I did, and all options seem to only give one side priority at all times.
Bump
Bump
Bump
Maybe you need to request a plugin.
No idea how to change it manually in an action sequence but if you want always attacker on top of everything.

Code:
Spriteset_Battle.prototype.battleFieldDepthCompare = function(a, b) {
var priority = BattleManager.getSpritePriority();
if (a._battler && b._battler) {
if (!$gameSwitches.value(1)) {
if (a._battler.isActor() && b._battler.isEnemy()) return 1;
if (a._battler.isEnemy() && b._battler.isActor()) return -1;
} else {
if (a._battler.isActor() && b._battler.isEnemy()) return -1;
if (a._battler.isEnemy() && b._battler.isActor()) return 1;
}
}
if (a.z < b.z) return -1;
if (a.z > b.z) return 1;
if (a.y < b.y) return -1;
if (a.y > b.y) return 1;
return 0;
};
and run a check at beginning of every skill for the switch.

if user.isEnemy()
CHANGE SWITCH 1: on
else
CHANGE SWITCH 1: off
end

Put it below battle engine core.
Battle engine core also without said plugin lets you choose between actors or enemy on top or normal which is only based off position, I think it defaults to actors on top, so try switching to 0 first and see if that is better in side view sprite priority.

Found it, credit @glaphen
Hi,

i didn't succeed to make your plugin to work. I failed creating the plugin or my commands are not right. When you run the check at beginning of every skill, is there anything else to write in the notetag before ?
'if user.isEnemy()
CHANGE SWITCH 1: on
else
CHANGE SWITCH 1: off
end '

Anyway, I found another interesting way to resolve this - and I'm so happy that I want to share 😀.

1. In the Battle Engine Core plugin - change "Side Sprite Priority" to 0.
But the problem is : if ennemies and actors have the same Y, wich happens when one move to the other, then ennemies have priority and appear on the top.
2. In the notetag of your skills, add this to movement command : 'offset y+1'
So when the user of the skill will arrive in front of the target, the sprite will be 1 pixel lower, and so it will appear above the target. The only inconvenient is that it's not totally clean cause the sprite will move a bit - but just 1 pixel so it's pratically invisible.

Example :
NOTETAG SKILL n°1 ("Basic Attack")
<target action>
...
move user: targets, front, 20, offset y +1
...
</target action>

I hope it will be usefull.

Bye
Hi,

i didn't succeed to make your plugin to work. I failed creating the plugin or my commands are not right. When you run the check at beginning of every skill, is there anything else to write in the notetag before ?
'if user.isEnemy()
CHANGE SWITCH 1: on
else
CHANGE SWITCH 1: off
end '

Anyway, I found another interesting way to resolve this - and I'm so happy that I want to share 😀.

1. In the Battle Engine Core plugin - change "Side Sprite Priority" to 0.
But the problem is : if ennemies and actors have the same Y, wich happens when one move to the other, then ennemies have priority and appear on the top.
2. In the notetag of your skills, add this to movement command : 'offset y+1'
So when the user of the skill will arrive in front of the target, the sprite will be 1 pixel lower, and so it will appear above the target. The only inconvenient is that it's not totally clean cause the sprite will move a bit - but just 1 pixel so it's pratically invisible.

Example :
NOTETAG SKILL n°1 ("Basic Attack")
<target action>
...
move user: targets, front, 20, offset y +1
...
</target action>

I hope it will be usefull.

Bye
I believe that note tag is supposed to be at the very beginning, inside your action sequence.

But that second fix apparently fixes the job 😀

Original thread: https://forums.rpgmakerweb.com/threads/mv-change-enemy-sprite-priority-during-yep-action-sequences.104816/