I was wondering if anyone (and if its even properly possible) to change the Z index (layering priority) of an Actors battler sprite mid battle?
I assume as much since VS has settings related to it. The issue I'm running into is a Summon that comes in mid battle obviously is drawn "last" and as such ends up sometimes on top of other actors heads lol
For reference the actor being changed will always be party Index 4. But a catch all solution that others can use too would be nice.
SOLVED:
Use the following Script:
Adjust Z Layer of Actor
// Assuming a 4 member party
// Party Member 5
var partyMemberIndex = 4;
// Get the actor ID of the party member at index 4
var actorId = $gameParty.members()[partyMemberIndex].actorId();
// Get the corresponding game actor
var actor = $gameActors.actor(actorId);
// Get the sprite associated with the actor in battle
var actorSprite = BattleManager._spriteset._actorSprites.find(sprite => sprite._battler === actor);
// Now, actorSprite contains the sprite parent of the party member at index 4 in battle
// Make it changeable
actorSprite.parent.sortableChildren = true;
// Change to desired index. Default = 0, so reduce or increase by the amount needed.
actorSprite.zIndex = -2;
Result: