How do I make skills count as normal attack, and allow changing equipment mid-battle?

I have replaced the normal attack with a skill list of different types of normal attacks, but none of them count as normal attacks in the game engine. I need this to change in order to make some features I want for my game.

Secondly, I can't figure out how to make the option to change equipment mid-battle. I need this as a workaround to being able to swap between dual wielding and not dual wielding using a skill, but not being able to switch weapons after using it.

No, I am not trying to use the weapon swap system from VisualStella, as it is incompatible with replacing the normal attack. I do have use of the battle core and item/equip core.

These were things I could easily do in VX Ace with scripts, but the methods used there obviously don't work in in MZ.
Can you clarify what you mean by "count as normal attacks"? Looking at the default, you have the Normal Attack damage element that should be selectable as well as the add Normal Attack state in the Effects list. Is there something else you mean?

I'm pretty sure there's a change equipment plugin in the dlc folder. Let me know if I'm mistaken.
Can you clarify what you mean by "count as normal attacks"? Looking at the default, you have the Normal Attack damage element that should be selectable as well as the add Normal Attack state in the Effects list. Is there something else you mean?

I'm pretty sure there's a change equipment plugin in the dlc folder. Let me know if I'm mistaken.
In the engine, certain Parameters only affect normal attacks. However, it distinguishes this by saying that only the skill in slot #1 is the normal attack. Removing that skill and replacing it with a skill least does not make the parameters which affect normal attacks affect those skills.

Say I replace the attack command with with a set of skills, and one of those is "heavy attack". If I select heavy attack, I can give it the normal attack element and state, but parameters such as "Atk Speed" don't take effect on that skill and things that trigger when a normal attack is done don't trigger.

Correct me if I'm wrong on any of this, as I'm used to the old engine.

I did find the plugin, though. It was hiding in the basic resources folder. But when I installed it and tried to run a test battle, it gave me this error:
Code:
TypeError
this[_0x21d412(...)] is not a function

Edit: I decided to just redo the entire method I was using to do dual wielding. It's not my preferred way of doing things, but it'll work. Still trying to figure out how to get the mid-battle equipment to work.
In the engine, certain Parameters only affect normal attacks. However, it distinguishes this by saying that only the skill in slot #1 is the normal attack. Removing that skill and replacing it with a skill least does not make the parameters which affect normal attacks affect those skills.
I think you're using parameters in a slightly different way than RPG Maker does - do you just mean fields on the skill in its database entry? I don't know of anything there that only applies to Skill #1.

Say I replace the attack command with with a set of skills, and one of those is "heavy attack". If I select heavy attack, I can give it the normal attack element and state, but parameters such as "Atk Speed" don't take effect on that skill and things that trigger when a normal attack is done don't trigger.
Ah! Okay, the Attack Speed Trait. I do believe that specifically refers to using the Attack command, but MZ allows you to change what skill the Attack command references (see the Attack Skill trait).

So you should be able to have your weapons have the Attack Skill trait to change what they do when you Attack and any Attack Speed modifier should apply to that.

If that doesn't appear to work properly, it shouldn't be difficult to look up the code for that trait and tweak it how you like.

I did find the plugin, though. It was hiding in the basic resources folder. But when I installed it and tried to run a test battle, it gave me this error:
Sorry, one of the updates must've broken compatibility with it. Try searching for an alternative, or maybe someone who uses this plugin will pop in with a fix.
I wonder if something else is causing the problem with that default change equipment plug-in. I have used it very recently and even highlighted it in a tutorial and it worked fine.

If you try testing it in a new project and it works, it will mean there is a conflict somewhere else.
Now that the OP mentions it, I believe I've seen a few other people mention it not working with newer versions of the MZ core scripts. I have not tested it myself.
I think you're using parameters in a slightly different way than RPG Maker does - do you just mean fields on the skill in its database entry? I don't know of anything there that only applies to Skill #1.


Ah! Okay, the Attack Speed Trait. I do believe that specifically refers to using the Attack command, but MZ allows you to change what skill the Attack command references (see the Attack Skill trait).

So you should be able to have your weapons have the Attack Skill trait to change what they do when you Attack and any Attack Speed modifier should apply to that.

If that doesn't appear to work properly, it shouldn't be difficult to look up the code for that trait and tweak it how you like.


Sorry, one of the updates must've broken compatibility with it. Try searching for an alternative, or maybe someone who uses this plugin will pop in with a fix.
Actually, I've messed around with the attack skill trait already. The problem it poses is that it only modifies the attack command, which I have replaced with a skill menu. My game specifically does not have the attack command, so I can't use attack skill or attack times on the trait section of the database for weapons. Because those modify only the attack command, not skills labeled normal attack or that give the normal attack status, I cannot use them without a script to specify certain skills as normal attacks.

I already tested this in the engine, creating this skill:
Spoiler: skill
Screenshot_27.png

And this weapon:
Spoiler: weapon
Screenshot_28.png

The result in battle test when selecting the skill was that the player character only attacked once, and no change was made to their action bar. As I am utilizing the ABS by VisuStella, skill and attack speed modifiers should give action bar back. The skill speed works. The attack speed doesn't. But I want certain weapons to be faster, and the only other way to do that is by multiplying agility, which is much more powerful than a flat bonus and works by accelerating the action bar instead of filling it after the action is complete.

Also, the equip screen mid-battle script seems to be conflicting with one of VisuStella's scripts. I found this thread on a japanese forum which has the same error.
Copy this into a text editor and save it as a *.js file, include it as a plugin. It should cause attack speed and attack times to work on any skill that's the Normal Attack element.

Code:
Game_Action.prototype.isAttack = function() {
    return this.item().damage.elementId < 0;
};

This is untested, so let us know if there's any problems. Also note that because VisuStella has obfuscated code it's not possible to check for whether it might conflict with anything in your VS plugins.
Copy this into a text editor and save it as a *.js file, include it as a plugin. It should cause attack speed and attack times to work on any skill that's the Normal Attack element.

Code:
Game_Action.prototype.isAttack = function() {
    return this.item().damage.elementId < 0;
};

This is untested, so let us know if there's any problems. Also note that because VisuStella has obfuscated code it's not possible to check for whether it might conflict with anything in your VS plugins.
Thanks, it works like a charm. Still wish I could define my own normal attacks by skill number, but I doubt I'll ever not use the normal attack element for things that I need those parameters for. It's sad about the code obfuscation, though. Didn't think plugins would go down this route.

Now the only problem I have to work through is the jank that is dual wielding a weapon and a gun, but that's beside this topic.
I don't want to get tangled in dual-wielding stuff, but...
Thanks, it works like a charm. Still wish I could define my own normal attacks by skill number,
This should be fairly easy to do. In case you're interested, here's some plugin code (untested):
JavaScript:
/*:
 * @target MZ
 * @plugindesc Skill tag <isAttack>. Tagged skills count as attacks.
 * @author Caethyril
 * @url https://forums.rpgmakerweb.com/threads/155368/
 * @help Free to use and/or modify for any project, no credit required.
 */
void (alias => {
  const TAG_NAME = "isAttack";
  Game_Action.prototype.isAttack = function() {
    return alias.apply(this, arguments) || !!this.item().meta[TAG_NAME];
  };
})(Game_Action.prototype.isAttack);
I.e. the default attack counts as an attack, as well as any Skill with <isAttack> in its Note box. Technically I think both Turan's suggestion and mine will also work for Items, in case that's relevant.
I don't want to get tangled in dual-wielding stuff, but...

This should be fairly easy to do. In case you're interested, here's some plugin code (untested):
JavaScript:
/*:
 * @target MZ
 * @plugindesc Skill tag <isAttack>. Tagged skills count as attacks.
 * @author Caethyril
 * @url https://forums.rpgmakerweb.com/threads/155368/
 * @help Free to use and/or modify for any project, no credit required.
 */
void (alias => {
  const TAG_NAME = "isAttack";
  Game_Action.prototype.isAttack = function() {
    return alias.apply(this, arguments) || !!this.item().meta[TAG_NAME];
  };
})(Game_Action.prototype.isAttack);
I.e. the default attack counts as an attack, as well as any Skill with <isAttack> in its Note box. Technically I think both Turan's suggestion and mine will also work for Items, in case that's relevant.
This also works. I'm not sure what I would use it for as an item, notetag, but after testing it, it does work and doesn't seem to conflict with any other plugins I have installed. Appreciate the option.

And yeah, I get the hesitation with dual wielding. Just figuring it out last night gave me a migraine because I couldn't figure out how to make it do what I wanted. If you're curious, I was trying to get the game to let the player equip either a gun or shield in their offhand, while allowing them to also equip a gun to the main hand. Unfortunately, I couldn't get it to also make the player choose which weapon they're attacking with so I could assign a different attack parameter to each weapon. It doesn't play nice with dual wielding melee and ranged weapons, basically. So I just ended up ditching the dual wielding guns idea and made them go in the shield slot. It means I can't have them perform their own normal attacks and thus the weapons will lose some variety, but I can still have them add weapon-unique skills with the add skill trait, so it at least functions. And now I have to figure out how to make 2H guns a thing. Probably just a shield-hand gun that seals the main hand. I could also probably take a note out of Dark Souls 3's book and turn the dual-wield gun idea into paired weapons that function similarly.

Edit: Actually, if anyone knows a script that can allow equipped armor or weapons to increase variables, I'd appreciate it.

Original thread: https://forums.rpgmakerweb.com/threads/how-do-i-make-skills-count-as-normal-attack-and-allow-changing-equipment-mid-battle.155368/