I don't know if I get it right, but it seems that you want to see if the player is equipping something in a specific slot?
Sorry, actually I already know how to do what you suggested, but it's not what I'm looking for. I need to check what the slot the player is about to put the equipment into is a certain slot #. You know how you select which slot you want 1st then pick the equipment to put in? I'm looking for the code to reference the active/selected slot.
The
$gameActors.actor(id).equips()[slotNumber] you mentioned is essentially the same as
user.equips()[0]. It's basically what I'm using now:
JavaScript:
<Custom Equip Requirement Condition>
if (user.equips()[1]) {
condition = false;
} else {
condition = true;
}
</Custom Equip Requirement Condition>
I mentioned checking by weapon/armor type like in your example as loopholes. For instance, if you have a 1H (a weapon w/ the DW trait) in both slots (slot 0 & 1) and then you won't be able to use a 2H (a weapon w/ the
<Custom Equip Requirement Condition> code I pasted above. So that works so far, however, if you have a single 1H equipped in slot 0 and empty in the other weapon slot (slot 1), the player is able to equip the 2H into the second weapon slot. This is one of the loopholes I mentioned. If I add another conditional like so:
JavaScript:
<Custom Equip Requirement Condition>
if (user.equips()[1] || user.isDualWield) {
condition = false;
} else {
condition = true;
}
</Custom Equip Requirement Condition>
This helps, but it also prevents the player from equipping a 2H if they only have a single 1H equipped. The player would have to remove the 1H weapon 1st before being able to equip the 2H, which does not provide for a good player experience.
The best way I can think of is to simply check if the selected/active slot (the slot the player is trying to put the equipment into) is slot #1 (aka the 2nd slot).