Changing the attack animation with a skill

Hi! i registered here to ask a bunch of questions and a mod told me to do it in separate threads so here i go:


One of my characters (at least in my head) have a weapon that can transform into others. I want to do that using habilities, the default animation is the sword one, but i want to use a skill i.e. "gun" to make the character do a gun basic attack animation (and more damage), then when he uses a basic attack the next turn, he uses the regular sword animation. Is that posible?

Also, im using some addons from HimeWorks. I think pointing that is important if i have to instal a extra addon or something. Thanks for the help 🙂
You can do it using Yanfly's Action Sequence and Weapon Animation Plugin. Create a state, and give it the Weapon Animation notetags for gun image and shooting motion. With the default graphics, it is:
<Weapon Image: 9>
<Weapon Motion: missile>

In the skill notetag, put in an action sequence that assigns and removes that state from the user with a Javascript evaluation, like this:

<target action>
perform start
wait for movement
Eval: user.addState(12);
motion attack: user
Eval: user.removeState(12);

wait: 10
action animation: target
wait for animation
action effect
wait for animation
wait for movement
wait: 5
</target action>

The important part are the lines in bold, the rest just replicates the normal attack sequence for singe target attacks. Make sure to change the number 12 in addState / removeState to the ID of your "gun" state.

Hope that helps, and if you have any questions, let me know 🙂
hi! i copypasted the code you gave to me (changing of course the ID of the state) and the char glows and it hits but the weapon never shows up
like this:
Spoiler
imagedata.php
Ah, my bad - I misspelled a line. It should be motion attack: user, not motion attack: use. Sorry about that 😅
Thanks! its perfect! i really apreciate the help 🙂

EDIT: hey i have a question. in the story the character that changes the weapon animation is also an enemy in some points. so i was testing battles against him and i gave the same skills that i gave to the ally version and when he uses one of the skills, he does the motion but the weapon dont show up. can you help me?
Which plugin are you using to display the actor battler for the enemy? I just tried it with Yanfly's Animated Sideview Enemies and the weapon appears there. If you're using the same plugin and it's not working for you, could you show a screenshot of your enemy?

Additionally, I made another mistake in the sequence above - to make the skill animation display correctly, it should be action animation: target instead of attack animation: target. It's now corrected in the post.
here are some screenshots of my problem. I also cpypasted the fix there and tested again and it didn'd worked

Spoiler
imagedata.php

"Sam: Pistola" is the skill that is supposed to display the gun animation and as you can see, he only does the motion.

imagedata.php

This is the enemy page. He have the skills that i want to test (Sam: Escudo and Sam: Pistola) and in the note pad there im using the call to use the side view animation.

imagedata.php

And here are my plugins
Your plugins are in the wrong order - YEP_WeaponAnimation must be below YEP_X_AnimatedSVEnemies. For future reference, the order in which to place Yanfly's plugins is here: http://yanfly.moe/yep/
oooooooooh thanks! now it works! but there is still one last detail. now this guy as an ally and as an enemy can use the animation properly, but the "on enemy" animation allways is the same as the basic attack like this:

Spoiler
imagedata.php

imagedata.php

So here, the guy is using this animation on the target. That animation is the basic attack one for the weapon he have equipped

imagedata.php

and this is the animation of a gun attack (or at least a attempt to capture it on this screenshot)
so i was wondering if there is a way to fix this (the same happens with the sword skill)
Have you changed the line "attack animation: target" to "action animation: target"? Then it should use the animation you specify on the skill under Invocation. Otherwise please show a screenshot of you skill as well 🙂
Oh! right, i said that i did it but i didn't save 😛 now it works just as i wanted. I really apreciate you help ^^ now i can keep testing stuff and then start with my project 🙂 Thanks 😀

Original thread: https://forums.rpgmakerweb.com/threads/changing-the-attack-animation-with-a-skill.78549/