Dynamic Weapon Animations
This script allows you to dynamically determine a weapon’s animation.
When using a skill or item, you can choose to show a “normal attack” animation. This will tell the engine to use the animation that you have selected for the weapon.
However, sometimes this is not enough. You might want a single weapon to show different animations depending on factors such as the current state or who the actor is.
By using dynamic weapon animations, you can use formulas to determine which animation will be played based on a variety of conditions.
Download
Script: download here
Installation
In the script editor, place this script below Materials and above Main
Usage
To specify an animation formula for a weapon, note-tag it with
<animation formula> FORMULA </animation formula>
Where the formula is any valid formula that returns the ID of the animation
that you want to use.
The following formula variables are available:
a - the user p - game party t - game troop s - game switches v - game variables
To use the weapon’s animation, your skill or item must use “normal attack”
animation.
Remember that your formula must always return an ID. There is no default ID.
Is there a way to define multiple animations that are played in sequence within a single formula, or perhaps simultaneously? So as to, for example, show a character bust on screen, and then reference a different battle animation for the actual special effect? That would cut down greatly on the number of different permutations of animations that'd be needed, which would likely violate the database's max of 999 anyway. I'm guessing there's a chance that this might do that anyway if you put multiple numbers in sequential rows under each If statement, but haven't tested it.
By default (as in, without additional animation-related scripts), no. The way animations are done is that each sprite can only have one animation playing at a time.
You could potentially play them in sequence, but you would need to be able to queue them up, which is also not supported by default.
I want to make the weapon's animation based on which actor it is equipped on, as the weapon can be used by many actor's who each have different elements.
What's the formula I should use?
Also, by any chance is there a way to change the element of a weapon based on actor?
You can check the actor ID. For example you can say
No, I don't have a script for dynamic damage elements.
Okay, I know how to work this with states, but how do I work this with specific armor?
If you want to see if the actor is wearing armor 5, you could say
However if you’re working with instance items that might not work.
the instance items, I'm not looking for, I'm just looking for the armor that is equipped. thank you
Okay, I’m now wondering what the weapon equivalent to ‘a.armors.include?($data_armors[5])’ is. It’s not for this exact script, it’s for a different matter relating to Yanfly’s ‘Skill Restrictions’ script.
change
armors
toweapons
Could one just use a rand(3) and have it do a random animation out of 3 different types?
Also is there a way to check for critical hit and have a special animation on critical hit?
If you want to pick a random animation from a specified list use
Critical requires access to the target, which this script does not have.
http://www.rpgmakervxace.net/topic/3241-critical-flash-se/
does this work for you? On a critical hit, you can have a flash and an optional sound effect, and this is separate from the attack animation