MZ Set and Merge Equipment Slots based on Notetags

Good morning forums!

I have been trying to find or build out a plugin that does this to no avail. Now before ya say "Item Equips Core!!!"

1 , trying to get away from VS when possible for compatibility reasons.
2. Item/Equip is limited to updating equipment slots based only on the primary class.


The Prompt:

I need a plugin that allows me to set Actor AND Class notetags designating Equipment Slots by Type ID that are merged on the Equip scene.

Example:

Actor notetag:
<baseSlots: 1,2,6>

Class notetags:
Class ID 1 - <classSlots: 6,4,4>
Class ID 2 - <classSlots: 5,6,6,7>


Resulting Equipment Slots:
<1,2,6,6,4,4,5,7>

Actor should be prioritized, followed by Primary Class, Tier 2 , etc

If it wasn't obvious this should work with Class Change System VS


If Actor note tags make it complicated, I can work with Class note tags alone so long as there is a plugin parameter to set default slots to be used if no class note tags are present.



Seems doable enough but this is above my experience grade lol.


Thanks in advance
Unfortunately, I don't know the command to access the 2nd class. Anyway, I have tried something for you:

Code:
(function() {

const alias_GameActor_equipSlots = Game_Actor.prototype.equipSlots;
Game_Actor.prototype.equipSlots = function() {
    const actorSlotIds = this.actor().meta.baseSlots ? this.actor().meta.baseSlots.split(',').map(Number) : [ ];
    const classSlotIds = this.currentClass().meta.classSlots ? this.currentClass().meta.classSlots.split(',').map(Number) : [ ];

    const combined = actorSlotIds;
    classSlotIds.forEach(id => combined.push(id));
    
    return combined.length > 0 ? combined : alias_GameActor_equipSlots.call(this);
}

})();

If no Notetags are given, then the default slots are returned.

Let me know if it's working for you; I haven't tested it in RPG Maker.
Spoke to soon actually so editting.


When selecting any equip slot that is below the weapons I receive the following error:

1676904070534.png


Initially i thought it was my dual wield plugin conflicting so I disabled to check. Still crashed out
Made some tweaks and came up with a working method that does what I need so far. :


(function() { const alias_GameActor_equipSlots = Game_Actor.prototype.equipSlots; Game_Actor.prototype.equipSlots = function() { const classSlotIds = this.currentClass().meta.classSlots ? this.currentClass().meta.classSlots.split(',').map(Number) : []; const allSlotIds = [1, 2, ...classSlotIds,3,4,5]; if (allSlotIds.length >= 3 && this.isDualWield()) { const shieldIndex = allSlotIds.indexOf(2); if (shieldIndex !== -1) { allSlotIds[shieldIndex] = 1; } } while (this._equips.length < allSlotIds.length) { this._equips.push(new Game_Item()); } return allSlotIds; }; })();

I shifted away from the actor notetag to make it a bit more simpler. Set default slots via the plugin that will always be present and built in the class slots to appear right after the Weapon and off-hand/shield to work with my projects set up.

Anyone that comes across this can remove or change the location of slots that are always present (like "3,4,5") to fit their needs.
So does it now work or do you need some support?
So does it now work or do you need some support?
Trying to break it before I call it done. Will report back by end of day to close the ticket if I'm good

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/set-and-merge-equipment-slots-based-on-notetags.155107/