??Change Battle Animation position??? a tricky one...

Hey guys,

I would like to play an animation in battle. The only thing I could find was

Code:
$gameActors.actor(1).startAnimation(126)

which works well. But the animation position on the screen should not depend on the actor's position.

I can change it by copying this out of rpg_sprites and adjusting the x and y:

Code:
Sprite_Animation.prototype.updatePosition = function() {
                this.x = 0;
                this.y = 0
};

But when I do that, the positions for ALL animations will be changed... But it should only happen for animation nr. 126!

Anyone knows what to do? 😅
Animations can only be played on Battlers or Events (when played on Maps). In order to play it at a set position you should need to make or find a plugin for that purpose. You may be able to do:

Code:
Sprite_Animation.prototype.updatePosition = function() {
    if (this._animation.id === 126) {
        this.x = WHERE_YOU_WANT_IT_X_POS;
        this.y = WHERE_YOU_WANT_IT_Y_POS;
    }
    if (this._animation.position === 3) {
        this.x = this.parent.width / 2;
        this.y = this.parent.height / 2;
    } else {
        var parent = this._target.parent;
        var grandparent = parent ? parent.parent : null;
        this.x = this._target.x;
        this.y = this._target.y;
        if (this.parent === grandparent) {
            this.x += parent.x;
            this.y += parent.y;
        }
        if (this._animation.position === 0) {
            this.y -= this._target.height;
        } else if (this._animation.position === 1) {
            this.y -= this._target.height / 2;
        }
    }
};

but I recommend getting a plugin to do this sort of thing for you, and not just modifying the core files.

- Liquidize
Thank you a million times for your help, but it doesn't work.... animation 126 is still displayed at actor 1's position....
Thank you a million times for your help, but it doesn't work.... animation 126 is still displayed at actor 1's position....
As I said, I didn't think it would work. You are best off looking for a plugin that lets you control animation positions, because you can't do it out of the box without a bit of scripting.
um ... set the animation's position to be Screen instead of Head/Center/Feet?

In the Animation's tab. No scripting changes required.
um ... set the animation's position to be Screen instead of Head/Center/Feet?

In the Animation's tab. No scripting changes required.
I forgot that existed...Can't remember every little detail 😛.

Original thread: https://forums.rpgmakerweb.com/threads/change-battle-animation-position-a-tricky-one.85045/