Dynamic Weapon Animations

dynamicWeaponAnimations1

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.

You may also like...

18 Responses

  1. Anonymous says:

    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.

    • Hime says:

      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.

  2. Naveed Ashfaq says:

    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?

    • Hime says:

      You can check the actor ID. For example you can say

      if a.id == 1
        2
      elsif a.id == 2
        3
      end
      

      No, I don't have a script for dynamic damage elements.

  3. Matthew says:

    Okay, I know how to work this with states, but how do I work this with specific armor?

    • Hime says:

      If you want to see if the actor is wearing armor 5, you could say

      a.armors.include?($data_armors[5])
      

      However if you’re working with instance items that might not work.

      • Matthew says:

        the instance items, I'm not looking for, I'm just looking for the armor that is equipped. thank you

      • Matthew says:

        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.

  4. digger says:

    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?

  1. February 22, 2024

    … [Trackback]

    […] There you can find 44473 more Information on that Topic: himeworks.com/2014/03/dynamic-weapon-animations/ […]

  2. February 22, 2024

    … [Trackback]

    […] Info on that Topic: himeworks.com/2014/03/dynamic-weapon-animations/ […]

  3. March 3, 2024

    … [Trackback]

    […] Find More on on that Topic: himeworks.com/2014/03/dynamic-weapon-animations/ […]

  4. March 3, 2024

    … [Trackback]

    […] Read More Information here to that Topic: himeworks.com/2014/03/dynamic-weapon-animations/ […]

  5. March 3, 2024

    … [Trackback]

    […] Read More Information here on that Topic: himeworks.com/2014/03/dynamic-weapon-animations/ […]

  6. March 3, 2024

    … [Trackback]

    […] Info on that Topic: himeworks.com/2014/03/dynamic-weapon-animations/ […]

Leave a Reply to Hime Cancel reply

Your email address will not be published. Required fields are marked *