Conditional Attack Animations

There are very few scripts out there that can manipulate attack animations on weapons. 

Visually, it would make sense for a weapon that was enchanted with an element to have a different attack animation.

I'd like to see a script where the attack animation would change based on a script eval.

So for example, on a weapon notetag, we could put:

<atk ani eval: 13>

a.state?(2)

</atk ani eval>

Where 13 is the Animation ID that the weapon is being changed to, and 2 is the state that gives the actor the attack element.

The eval would give us the flexibility to base the attack animation off of multiple things like states, equips, who's in the party, and so on.
How would you determine which one to use if there were several conditions that were met?
I never wrote such a script due to compatibility issues.

Scene_Battle

def use_item item = @subject.current_action.item @log_window.display_use_item(@subject, item) @subject.use_item(item) refresh_status targets = @subject.current_action.make_targets.compact show_animation(targets, item.animation_id) targets.each {|target| item.repeats.times { invoke_item(target, item) } } endThere is absolutely zero flexibility in this method despite it being one of the critical elements of the battle system.If I could I would re-write the whole thing appropriately.
How would you determine which one to use if there were several conditions that were met?
I envisioned using separate tags. The concept of my request is based off of Tsuki's Conditional Effects script, which functions similarly. I just wasn't sure if this effect could carry over to attack animations. Thanks anyway.

If anyone else happens to stumble on this topic, a post of a workaround would be greatly appreciated.
A better way is to just use a weapon attack replace script... that changes attack skill depending on the weapon...


now if you want it based on other things, Hime's post explains why it's not too good of an idea...


you can also opt to just remove the attack animation and just use for example Hime's script for doing things when you use skills, and show the animation that way
I thought of that, but in order to get the desired effect, I'd have to make elemental states for each individual equipment type. (Fire Slash, Fire Pierce, Fire Hit, Ice Slash, Ice Pierce, etc. etc.).

Then when it comes to actually applying the state... I would have to write a damage formula that checks the target's equipment type and apply different states accordingly. Not the workaround I had in mind. 
I understand you want separate tags. But what if more than one has conditions that are met?


Let's say tag 1 has the condition "Actor 1 in party"


Let's say tag 2 has the condition "Gold is > 50"


If gold > 50 AND actor 1 is in the party, they are both met. Which animation should play?
I understand you want separate tags. But what if more than one has conditions that are met?

Let's say tag 1 has the condition "Actor 1 in party"

Let's say tag 2 has the condition "Gold is > 50"

If gold > 50 AND actor 1 is in the party, they are both met. Which animation should play?
Ahh, I follow. Well if we keep it within the scope of states, there shouldn't be any conflicts. Ideally, the states that are used can only be applied one at a time. You can have multiple tags on one weapon, but applying one state should mean cancelling another.

To answer your question. I guess I would have it prioritize the first animation - or return an error or some sort. I see what you mean though. It wouldn't be a very efficient script based on the concept I outlined.
I made it so that conflicting conditions are up to you to figure out.


This saves me lots of work because I'm not interested in hardcoding a specific prioritization scheme.


http://www.himeworks.com/2014/03/23/dynamic-weapon-animations/


dynamicWeaponAnimations1.jpg



This solution is a bit more compatible, but it still overwrites stuff.
And once again Tsukihime pulls through. Gonna run a test as soon as I can, but this is exactly what I need. 

This topic can be closed. 
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/conditional-attack-animations.25291/