- Joined
- May 3, 2016
- Messages
- 91
- Reaction score
- 14
- First Language
- English
- Primarily Uses
- RMMV
I've been trying to tackle this one for a while. I would like to find a way for a Skills animation to play in front or behind of a target depending on its position. Currently the animations play on a layer above everything. For example, if there were two enemies, Target 1 and Target 2 and you attacked Target 2 which was in the back, the Skill animation would still play on Target 2 but the animation would play in front of both targets. When it actually would look more accurate if it played on top of Target 2 but behind Target 1.
I found this forum post:
forums.rpgmakerweb.com
They had some success by altering this code:
And like the original poster said, it worked perfectly for the Actors, but it no longer lines up the animations on enemies that are targeted. Does anyone have any ideas how I could fix that? Alternatively, if I could make it so the added code only affects actors, I could make the work too. Something along the line of:
"If animation is for actor do if (animation.position < 3) { this.addChild(sprite); }; else do nothing."
In a perfect world I would love to have it work for both but I'll take what I can get.
As always, thanks in advance for any help of advice you can give. It's greatly appreciated.
I found this forum post:
layer order of skill animation
maybe I missed something but I noticed that when playing skill animation in SV battle, the animation is always above all battlers (which does not make much sense) for example: supposedly the fire should be behind the bottom enemy sprite, but is showing above everything. I heard there is no...
They had some success by altering this code:
Code:
Sprite_Battler.prototype.setupAnimation = function() {
while (this._battler.isAnimationRequested()) {
var data = this._battler.shiftAnimation();
var animation = $dataAnimations[data.animationId];
var mirror = data.mirror;
var delay = animation.position === 3 ? 0 : data.delay;
this.startAnimation(animation, mirror, delay);
for (var i = 0; i < this._animationSprites.length; i++) {
var sprite = this._animationSprites[i];
sprite.visible = this._battler.isSpriteVisible();
//New stuff added
if (animation.position < 3) { this.addChild(sprite); };
//New Stuff Added
}
}
};
"If animation is for actor do if (animation.position < 3) { this.addChild(sprite); }; else do nothing."
In a perfect world I would love to have it work for both but I'll take what I can get.
As always, thanks in advance for any help of advice you can give. It's greatly appreciated.

