RPGMAKERMZ Custom skill in battle that makes the character change equipped weapon

Hello,
I am working on a game in RPG MAKER MZ
I have a character that can equip 4 different weapons, and I want her to have a skill where she can change weapons during any battle.
I set up the skill with no damage, no costs, with target = user ; with a 100% success rate
And I added an event that I called "change weapon" where it's a branching
If Linda has weapon 1 equipped then the player has to choose between the three other weapons as options.
If player select weapon 2 then it's supposed to change the equipped weapon from weapon 1 to weapon 2 and show a text "Linda equipped weapon 2". I used the event "change equipment" and selected the weapon 2 for my character (in the event editor I mean)
When I test it, I do have the choices but when I select it, there is a text "this had no effect on Linda" and then "Linda equipped weapon 2".
But when I go into the skills, it kept the skills of weapon 1 so I think it didn't change the weapon equipped.

Does anyone know how to make a custom skill where you can switch weapons during a battle ?
I think the ChangeEquipOnBattleMZ plugin might be the solution to your problem,

It let's you change the Equipment during battle without the need of any skills that would potentially "waste" a turn.

check your DLC folder of your RPG Maker MZ, you will find it inside the Basic Resources > plugins > launch folder.
I remember adding this code to make sure that only weapons and offhands could be changed (not armors or accessories) - when using this plugin.


Code:
//We only want the party to be able to change weapons and offhands.
  Window_BattleEquipSlot.prototype.isEnabled = function(index)
  {
     if (! this._actor)
     {
       return false;
     }

     if (index > 1) //0 = weap, 1 = offh.
     {
        return false;
     }
     return this._actor.isEquipChangeOk(index);
  };
I think the ChangeEquipOnBattleMZ plugin might be the solution to your problem,

It let's you change the Equipment during battle without the need of any skills that would potentially "waste" a turn.

check your DLC folder of your RPG Maker MZ, you will find it inside the Basic Resources > plugins > launch folder.
It's working ! Thank you so much 🙂
I remember adding this code to make sure that only weapons and offhands could be changed (not armors or accessories) - when using this plugin.


Code:
//We only want the party to be able to change weapons and offhands.
  Window_BattleEquipSlot.prototype.isEnabled = function(index)
  {
     if (! this._actor)
     {
       return false;
     }

     if (index > 1) //0 = weap, 1 = offh.
     {
        return false;
     }
     return this._actor.isEquipChangeOk(index);
  };
Thank you, but I don't know how to add code... For now, I decided to only keep weapons in my game.
Hi everyone ! Little update on my project. I understand now how the VS battle core pluggin works so I managed to make my skill with the <Common Event: Change Weapon> notetag to summon the common event I made to change the weapon in battle.
The common event is
'If Character has equipped weapon 1 then
List of choices between Weapon 2, weapon 3 and weapon 4
If player selects weapon 2 then change equipment => weapon 2
Else If character has equipped weapon 2 then
List of choices between Weapon 2, weapon 3 and weapon 4'
etc, etc etc... (my character can choose between 4 weapons)

Original thread: https://forums.rpgmakerweb.com/threads/rpgmakermz-custom-skill-in-battle-that-makes-the-character-change-equipped-weapon.181494/