Weapon Elemental Animation

This might be really simple but Im still pretty new to this but basically, when I use Fire weapon, Ice Weapon, Thunder weapon etc on a character Id like to see the attack animation switch from say a normal hit (Physical hit, slash, claw, pierce etc) to the corresponding elemental versions. I assumed this would happen after the character receiving either fire, ice, or thunder force states from the skill but it doesnt and I cant seem to figure it out. Also, is it possible to add more elements like Darkness weapon, quake weapon, etc? Again Im sure this is old news for a lot of you but Id really appreciate any help with this
-Thanks
Welcome! It sounds like you might want to work your way through some more tutorials, especially regarding the second half of your question. There's one built into MZ, and there are a bunch of series on YouTube for MZ and MV (they're practically identical outside of mapping layers and the animation section of the database).

Your elements are defined in the Types tab of the database - Darkness is actually an existing one, but you can add, remove, rename, do whatever you want to that list.

As far as the first part - skills (including attack) use whatever animation you define on the skill in the database. The way to do what you want without getting into plugins (which I'd say you shouldn't use, until you get more proficient with the editor itself), is by making copies of the Attack skill with different elemental animations selected.

Then, on the weapon in the database, add a Trait -> Attack -> Attack Skill and select the appropriate elemental attack. When an actor is wielding that weapon, their Attack skill will automatically use that instead.
As Turan mentioned, elements are defined on the Types tab of the database.

For offsetting weapon animations, I think you'd want a plugin. It may technically be possible with attack skills, e.g. by making 1 state per power-up, per weapon, and making each weapon give immunity to all except the applicable power-up. That's an awful lot of hassle, though. I wrote this a while ago:
Spoiler: plugin code
JavaScript:
/*:
 * @target MZ
 * @plugindesc Attack animation trait tags (base, offset).
 * @author Caethyril
 * @url https://forums.rpgmakerweb.com/threads/156047/
 * @help For use in the Note box of any trait-bearing object:
 *         <attack anim base: 5> => attacks without a weapon use anim ID 5.
 *         <attack anim plus: 2> => add 2 to the base ID value.
 * If multiple base/plus tags apply, the highest value will be used.
 * Default values (when no tags present): base = 1, plus = 0.
 *
 * ----------------------------------------------------------------------------
 * Terms of use:
 *   MIT License: https://opensource.org/licenses/mit-license.html
 *
 * [[ BEGIN LICENSE TEXT ]]
 *
 *   Copyright © 2023 Caethyril
 *
 *   Permission is hereby granted, free of charge, to any person obtaining a
 *   copy of this software and associated documentation files (the "Software"),
 *   to deal in the Software without restriction, including without limitation
 *   the rights to use, copy, modify, merge, publish, distribute, sublicense,
 *   and/or sell copies of the Software, and to permit persons to whom the
 *   Software is furnished to do so, subject to the following conditions:
 *
 *   The above copyright notice and this permission notice shall be included
 *   in all copies or substantial portions of the Software.
 *
 *   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 *   IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 *   FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
 *   THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 *   LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 *   FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 *   DEALINGS IN THE SOFTWARE.
 *
 * [[ END LICENSE TEXT ]]
 */

// Q11) Attack animation trait tags.
void (() => {
'use strict';

    /**
     * Tag name for base attack animation ID.
     * Use on Actor/Class/Weapon/Armor/State/Enemy/Skill/Item.
     *
     * Applies for enemies, or actors without a weapon.
     */
    const TAG_NAME_BASE = 'attack anim base';

    /**
     * Tag name for additive bonus to attack animation ID.
     * Use on Actor/Class/Weapon/Armor/State/Enemy/Skill/Item.
     *
     * E.g. for an elemental power-up state.
     */
    const TAG_NAME_PLUS = 'attack anim plus';    // e.g. ice power-up state

    /** @returns {?$dataItem|$dataSkill} Item/Skill reference for current action, or `null`. */
    const getActionItem = function() {
        return BattleManager._action?.item() ?? null;
    };

    /**
     * @param {object} o
     * Reference meta-bearing object
     * @param {boolean} isBase -
     * - `true` => read {@linkcode TAG_NAME_BASE},
     * - `false` => read {@linkcode TAG_NAME_PLUS}.
     * @returns {?number}
     * Animation ID/offset from tag, or `null`.
     */
    const parseTag = function(o, isBase = false) {
        const v = parseInt(o?.meta[isBase ? TAG_NAME_BASE : TAG_NAME_PLUS]);
        return isNaN(v) ? null : v;
    };

    /**
     * Returns largest applicable value from `dFault` or tags.
     * @param {Game_Battler} battler reference battler
     * @param {number} [dFault=1] base value if no tags found (default: 1)
     * @returns {number} override base value for animation ID
     */
    const getAttackAnimBase = function(battler, dFault = 1) {
        const i = parseTag(getActionItem(), true);
        if (i)
            return i;   // has tag from item/skill - specific beats general
        return battler.traitObjects().reduce((a, c) => {
            const v = parseTag(c, true);
            return v > a ? v : a;
        }, dFault);
    };

    /**
     * Returns largest applicable offset.
     * @param {Game_Battler} battler reference battler
     * @returns {number} additive offset for attack animation ID
     */
    const getAttackAnimOffset = function(battler) {
        const i = parseTag(getActionItem(), false);
        if (i)
            return i;   // has tag from item/skill - specific beats general
        return battler.traitObjects().reduce((a, c) => {
            const v = parseTag(c, false);
            return v > a ? v : a;
        }, 0);
    };

    /**
     * @param {Game_Enemy} subject reference enemy
     * @returns {number} attack animation ID
     */
    Game_Enemy.prototype.attackAnimationId1 = function() {
        const base = getAttackAnimBase(this);
        if (!base)
            return 0;   // do not offset if anim ID = 0.
        return base + getAttackAnimOffset(this);
    };

    // Let enemies show attack animation (mirroring is done via anim target check).
    void (alias => {
        Window_BattleLog.prototype.showEnemyAttackAnimation = function(subject, targets) {
            alias.apply(this, arguments);
            this.showNormalAnimation(targets, subject.attackAnimationId1());
        };
    })(Window_BattleLog.prototype.showEnemyAttackAnimation);

    // Override bare hands attack animation for actors.
    void (alias => {
        Game_Actor.prototype.bareHandsAnimationId = function() {
            return getAttackAnimBase(this, alias.apply(this, arguments));
        };
    })(Game_Actor.prototype.bareHandsAnimationId);

    // Apply offsets for actor attack animations.
    void (alias => {
        Game_Actor.prototype.attackAnimationId1 = function() {
            const base = alias.apply(this, arguments);
            if (!base)
                return 0;   // do not offset if anim ID = 0 (e.g. weapon anim 0).
            return base + getAttackAnimOffset(this);
        };
    })(Game_Actor.prototype.attackAnimationId1);
    void (alias => {
        Game_Actor.prototype.attackAnimationId2 = function() {
            const base = alias.apply(this, arguments);
            if (!base)
                return 0;   // do not offset if anim ID = 0 (e.g. no secondary weapon).
            return base + getAttackAnimOffset(this);
        };
    })(Game_Actor.prototype.attackAnimationId2);

})();
Works pretty well with the default animation data: +2 for fire, +3 for ice, etc.

To use it, copy the code into a text editor (e.g. Notepad), then Save As:
  • File Type: All Files (so it doesn't automatically add a .txt extension);
  • Filename: whateverYouLike.js (i.e. manually save it with a .js extension).
Then import it as a plugin~
Welcome! It sounds like you might want to work your way through some more tutorials, especially regarding the second half of your question. There's one built into MZ, and there are a bunch of series on YouTube for MZ and MV (they're practically identical outside of mapping layers and the animation section of the database).

Your elements are defined in the Types tab of the database - Darkness is actually an existing one, but you can add, remove, rename, do whatever you want to that list.

As far as the first part - skills (including attack) use whatever animation you define on the skill in the database. The way to do what you want without getting into plugins (which I'd say you shouldn't use, until you get more proficient with the editor itself), is by making copies of the Attack skill with different elemental animations selected.

Then, on the weapon in the database, add a Trait -> Attack -> Attack Skill and select the appropriate elemental attack. When an actor is wielding that weapon, their Attack skill will automatically use that instead.
Thank you
It may technically be possible with attack skills, e.g. by making 1 state per power-up, per weapon...
Ah, see, I interpreted the OP as equipping, say, a flame sword, not that it was a spell enchanting the weapon.
Since you use MZ you could have a peek at my free resources. Visual Weapons lets you see what the hero is holding at all times with the Akea2 battle system plug-in. Then you can assign different animations to play when attacking and if they approach the target, go to the middle of the field or wherever.
Here's a couple of examples:
LancerTri.gif

LancerPetal.gif

WizardWand.gif

WizardMask.gif

Its the same actor, only has a different weapon equipped.
Ah, see, I interpreted the OP as equipping, say, a flame sword, not that it was a spell enchanting the weapon.
Yeah, I'm talking about enchanting. The thing is, there are things like slash+fire, pierce+fire animations I can use but I don't know how to make them conditional as in during the 5 turns the weapon is enchant with whatever element

Original thread: https://forums.rpgmakerweb.com/threads/weapon-elemental-animation.157490/