Change Skill Animation Based On Switch

I need to dynamically change skill's played animation if a certain switch is on
Using Yanfly Battle Engine, but I only need it for actors (really don't want to create dozens of identical classes with identical skills just to have different animation for it)
You can use action sequences and ifs to decide which animation to play, and let the animation on the skill definition blank.
@DarkHyudrA As far as I am aware, Action Sequences is only for MV and this is an Ace forum. If I am wrong, please link the appropriate web page.
I think he just means: have a skill do nothing but run a common event, where it will force different skills with different animations based on conditions
Still tedious
You may have to request someone to write a script for this. I had a thought but there is no script for it either...
Have multiple skills that are the same and when the switch is on, the actor losses one skill and gains another. Both skills would be the same but different animations.
You can change skill animation via this script call:
Code:
$data_skills[skill_id].animation_id = new_animation_id
You have to replace skill_id with the skill id from the database, and the new_animation_id with animation id you want from the database. Problem is, that changes the skill animation for everyone, who is going to use that skill. Turning to that skill via $game_actor.skills gives the same result, the skill animation is going to be changed for everyone, which is why my script call changes it directly from the database. Is that good enough?
Animations are unique for all actors, so that's fine
Does that change it permanently though? So, for instance, I call this script before battle, and for the whole battle that skill will play new animation?
Yes. Not only to the end of the battle, but to the end of the game. Unless you change it again to the original animation id.
Edit: Ah, problem. It doesn't stay after saving and closing the game, then opening and loading new game.
Well, if animation changes are tied to switches, and I refresh all the changes before starting any battle via common event (there's no random encounters) that shouldn't be an issue.
Thank you!
In the script call i provided earlier, the animation change is not tied to switch, but to the script call alone.
There is a way to preserve your changes in the save file, but that will inject all the skills data into the save file (around 37 kb with the default skill database).
What I meant is: run a conditional branch with switches, and then call script if switch is on, that's all. Before every battle. Common event.
Makes my life easier than if I was running a common event each time a skill was used
Instead of running a common event before every battle, could you use Yanfly's Base Troop Events script for that? Set it to run at turn zero, span set to turn. Then at the beginning of each and every battle it would do the work of the common event before anything else happens.
That's the same thing really. Doesn't warrant a script if it's easily done with a common event with the same results imo. I already have way too much scripts.

Original thread: https://forums.rpgmakerweb.com/threads/change-skill-animation-based-on-switch.94972/