MZ Auto Unequipping Items from Slots when no longer usable

Good morning,

When Actors in my project change classes, they're equipment slots and slot order update as well sometimes. Because of this, their base slots can go from:

1682176111791.png


To:

1682176130849.png


Due to class change (and sometimes equipment change)

In this scenario the slots went from [1, 2, 5, 3, 4] to [1, 2, 14, 5, 3 ,4 ] (( 5's display name just changed but its still the same equipment type) when the class was changed to "Bow".

The problem I'm running into is when an armor is already set to any slot:

1682176358562.png


and the slots update:

1682176444801.png



Equipment that should no longer be able to be equipped, remains in the slot.


Is there a script I could set into a plugin to force a check that unequips things that shouldn't be in use every time equipment changes and class changes? There is a need for both checks as Equipment Drives Class Change and sometimes Slots change, while Class Drives Slots change and Equipment and Armor Type Access.


Bonus if the equipment can look for an appropriate empty slot and be moved there instead. But definitely not a need!


Thanks in advance
it should be possible to common event character to unequip all gear when u class change. That might solve your issue. Also might consider checking out this post has a few scripts that might be helpful.

https://forums.rpgmakerweb.com/index.php?threads/unequip-all-equipment.75198/#post-706969
it should be possible to common event character to unequip all gear when u class change

Unfortunately I can't have all equipped removed at once since then the class would be changed again xD. The 2 weapon slots (everyone dual wields) drive class changes. So the trigger really should be grounded in when equipment changes to check slots in use. I'll take a look at the post ya sent tho!
This is a question about a plugin, so...

I've moved this thread to JavaScript/Plugin Support (from MZ Support). Thank you.

Also, I suggest you link to the plugin you're talking about.

Usually it'd be actor.releaseUnequippableItems(). That gets called automatically by the core scripts when changing equipment. I assume it's failing here because whatever plugin you're using to change the equip slots is not correctly defining "needs correct slot" as an equip requirement.
This is a question about a plugin, so...
Moved to: JavaScript/Plugin Support (from MZ Support) Also, I suggest you link to the plugin you're talking about.

Usually it'd be actor.releaseUnequippableItems(). That gets called automatically by the core scripts when changing equipment. I assume it's failing here because whatever plugin you're using to change the equip slots is not correctly defining "needs correct slot" as an equip requirement.
Appreciate that move and callout caethyril. I'll see if that script works. Its a couple of my own plugins working in tandem that make the changes I've described, so I wanted to isolate the needed script in its own plugin to do a clean sweep after haha.

I'll give it a try and report back if fixed and where
I see, good luck! 👋

Original thread: https://forums.rpgmakerweb.com/threads/auto-unequipping-items-from-slots-when-no-longer-usable.156892/