MZ Enable/Disable Specific Armors

Hello Everyone, I am making a Plugin that gives the feel of having party members that are not in the battle party be helpful in a fight without them switching into battle.

Basically they give power boosts to the character they are attached to as they are, mechanically speaking, an armor type.

Now the limitation I am trying to put on this is any party armor associated as a battle party member should not be allowed to be equipped, while non-battle party members will be equip-able.

I have my plugin mostly completed. I have it triggering in the right spot, It checks for "isBattleMember" for the party, I even have the armor unequip if a non-battle party member becomes a battle party member.

I am at the final stage of this plugin and I have been looking all over the place to do this and that's to enable/disable specific armors so players don't equip armor associated with the battle party by accident.

Is there a simple way to Enable/Disable a $dataArmor[n]? or would I have do something drastic like remove the armor from the inventory if the actor ID that matches the Armor ID is in the battle Party or not.

Thank you anyone in advance for helping me out with this.

For those that would need to see this code That I have so far it is as follows (this works with the Visustella PartySystem. To get this to work with Vanilla The "Scene_Party.prototype.terminate" should be changed with "Scene_Menu.prototype.onFormationCancel"

const scenepartycancel = Scene_Party.prototype.terminate; Scene_Party.prototype.terminate = function(){ for(i=1;i<=$gameParty.members().length; i++){ if($gameActors.actor(i).isBattleMember()){ for(j=1;j<=$gameParty.members().length; j++){ if($gameActors.actor(j).hasArmor($dataArmors[i])){ $gameActors.actor(j).changeEquip(9, $dataArmors[0]); console.log("Just need to deactive armor[i] & reactivate the armor of the now-non-battle party member"); } } } else { } } scenepartycancel.call(this); }
Moved to: Javascript/Plugin Support
Moved to: Javascript/Plugin Support
Ah oops, sorry I thought I did. Thank you for moving this to the proper channel.
I am still wracking my brain in trying to figure this out.
Would sealing the armor and unsealing it be better after it is unequipped? What would the code for that be?

Would it be better to remove the armor associated with the battle party member?

Any help in figuring this out would be much appreciated. I will also continue to look into this my next post will be in response to another or that I figured this out.

Thank you anyone and everyone that can help me figure this out.
Final Update I have figured out how to do what I wanted by script calling to add and remove the armor type from inventory rather than enabling and disabling the armor. Thank you and have a nice day!

for(k=1;k<=$gameParty.members().length; k++){ if($gameActors.actor(k).isBattleMember()){ if($gameParty.hasItem($dataArmors[k])){ $gameParty.loseItem($dataArmors[k],1); } }else { if(!$gameParty.hasItem($dataArmors[k])){ $gameParty.gainItem($dataArmors[k],1); } } }

Original thread: https://forums.rpgmakerweb.com/threads/enable-disable-specific-armors.135202/