How to change a skill's sprite animation?

Wasn't sure of any better way to phrase that question, but I'm pretty confident in my ability to explain what I'm trying to do.

So, in sideview battle, player character sprites do little animations when using their basic attack, or casting a spell, etc. I looked in the descriptions of the various Yanfly plugins I'm using, but couldn't find any mention of some way to make a sprite use a specific animation when using a certain skill. For example, the animation of a regular attack, instead of whatever they do when using some sort of skill.

See below for a more visual example.

1682464291514.png


There is the obvious solution of just changing out the magic frames for attack frames, but then I would have the opposite problem where I want the magic animation but am getting the attack one instead. Plus the weapon wouldn't appear if I did that.

I'm fully open to the possibility that I'm just extremely blind and missed something reading over Yanfly's plugin notes, but I've been looking through them for a couple of weeks now and finally decided I'll have to swallow my pride and go "I don't know how to do this and can't figure it out. Does anyone know?"
So the images you're asking about are called, by RPG Maker's documentation, motions.

You can see the chart with the names of the various motions in the instructions: Help -> Contents -> Documentation -> Side-View Character Standards

By default, when characters use a skill they will use the General Skill motion. If that skill's Skill Type is listed in the System tab of your database on the Magic Skills list, they will use the Magic motion.

If you want to use a different motion, such as slash, you'd have to program the skills using Yanfly's Action Sequences. Pack 2 has commands for you to execute specific motions.
I think I ran across this same issue while messing with my 8-bit project, which was my first time using the side-view system.

In any case, if I understand you correctly, you want to use the normal attack sprite animation for certain skills. I solved this with a really simple snippet which I'll reformat here for general use:

JavaScript:
const performAction = Game_Actor.prototype.performAction;
Game_Actor.prototype.performAction = function(action) {
    if (action.item().meta.NormalAttack) {
        this.performAttack();
    } else {
        performAction.call(this, action);
    }
}

You can run that as a plugin and add <NormalAttack> to any skill's note box and it'll use the same sprite animation as the standard weapon attack.

Edit: the above is for MZ, but seems to work fine in MV based on a quick test:

attack-mod.gif
Oh my god you're like a wizard. I cannot thank you enough this was bugging the hell out of me.

And now I know what to look for in the future when I'm doing other stuff too. Thanks to you too, Turan!

Problem solved! o7

Original thread: https://forums.rpgmakerweb.com/threads/how-to-change-a-skills-sprite-animation.156991/