I could just add more equipment slots in the editor but some character in my game has different slots like a Weapon and a Sub-hand, no Weapon or even 2 more Flame or Essence by using the notetags.
I wonder if there is some kind of plugin that allow me to do that.
The Lock Equip trait in the database locks a whole equipment type, so it would lock all four Weapon slots, including the one with the Rocker Cola. I couldn’t find an MV plugin that locks just one slot, but a small plugin can do it. Save this as LockedEquipSlots.js in your js/plugins folder and put it below YEP_EquipCore in the Plugin Manager:
/*:
* @plugindesc Lock specific equip slots. Place below YEP_EquipCore.
* @help
* Actor notetag:
* <Locked Slots: 2, 3, 4>
* Slot numbers count from the top of the equip list, starting at 1.
*
* Script calls:
* $gameActors.actor(1).unlockSlot(2);
* $gameActors.actor(1).lockSlot(2);
*/
(function() {
Game_Actor.prototype.lockedSlots = function() {
if (!this._lockedSlots) {
var match = this.actor().note.match(/<Locked Slots:\s*([\d,\s]+)>/i);
this._lockedSlots = match ? match[1].split(',').map(Number) : [];
}
return this._lockedSlots;
};
Game_Actor.prototype.lockSlot = function(slot) {
if (!this.lockedSlots().contains(slot)) this._lockedSlots.push(slot);
};
Game_Actor.prototype.unlockSlot = function(slot) {
this._lockedSlots = this.lockedSlots().filter(function(s) {
return s !== slot;
});
};
// YEP_EquipCore's slot window calls this saved function directly,
// so hooking it here covers the menu, Optimize, and Clear
var _isEquipChangeOk = Yanfly.Equip.Game_Actor_isEquipChangeOk;
Yanfly.Equip.Game_Actor_isEquipChangeOk = function(slotId) {
if (this.lockedSlots().contains(slotId + 1)) return false;
return _isEquipChangeOk.call(this, slotId);
};
})();
Then add <Locked Slots: 2, 3, 4> to the actor’s note box. The numbers count from the top of the equip list, so in your screenshot that’s the three empty Weapon slots. They’ll show grayed out, the player can’t select them, and Optimize and Clear will skip them.
If you want a slot to open up later in the game, use a Script event command with $gameActors.actor(1).unlockSlot(2). That unlocks slot 2 for actor 1, and lockSlot locks it again.
Locking individual slots fits this case better than locking the whole weapon type, especially with characters who have different slot layouts. The unlock-later option also keeps progression flexible.
I put it below YEP_EquipCore in the Plugin Manager, just copy the text to make it, add the <Locked Slots: 2, 3, 4> on the Cielo Noteand yes! it work! thanks man!