Check which actor is in the current scene?

Hello once again everyone,

Using Waynee95's Equip Eval plugin, I am trying to have a 2handed weapon, on equip, toggle the actor's slot type from Dual Wield to Normal (and also seal the off hand slot), and on unequip, toggle it back to dual wield. Here are my notetags:

<Custom On Equip Eval>

user.traits.push({code: 55, dataId: 0, value: 1})

</Custom On Equip Eval>

<Custom Remove Equip eval>

user.traits.splice({code: 55, dataId: 0, value: 1})

</custom remove equip eval>

However, this is causing a "CUSTOM ON EQUIP ERROR" error when I equip the weapon. My assumption is that it's because "user" is not defined as $gameActors.actor(x).

My workaround would be to have another line defining user as whatever actor is currently using the "equip" scene (since items can only be equipped/unequipped from the equip scene). Something like:

<Custom On Equip Eval>

var user = <whatever script call checks which actor is using the equip scene>

user.traits.push({code: 55, dataId: 0, value: 1})

</Custom On Equip Eval>

My problem is I don't actually know (and am having trouble finding out) how to check which actor is in the equip scene currently.
Would you be opposed to making Two handed weapons another weapon class, and using Yanfly's AutoPassiveStates?

In my project, I use two passive states to dictate when a character can dual wield, depending on the weapons equipped. For example:

Thief can dual wield daggers only, but he can equip swords and shields as well. Since he cannot dual wield swords, state 1 (which enables dual wield) checks the weapon type Thief is wielding, and if it is a dagger, enables Dual Wield. You could swap the true and false conditions to disallow dual wielding when equipped with the weapon ID for Two handed weapons (x).

<Custom Passive Condition>
if (user.isWtypeEquipped(x)) {
condition = true;
} else {
condition = false;
}
</Custom Passive Condition>

Spoiler: If the character can wield multiple different weapon types
<Custom Passive Condition>
if (user.isWtypeEquipped(x)) {
condition = true;
} else if (user.isWtypeEquipped(y)) {
condition = true;
} else if (user.isWtypeEquipped(z)) {
condition = true;
} else {
condition = false;
}
</Custom Passive Condition>

Of course you can add more "else if's" if necessary

The second state allows the equipping of other types of weapons, which would let the second weapon slot act as a Normal slot since Dual Wield is only applied by the other passive state. It would simply need to check if the character is equipped with a two handed weapon, and if they are not, they would have a Normal slot type. Simply sealing the shield slot would disallow use of that now "Normal" slot until the two handed weapon is unequipped.

<Custom Passive Condition>
if (user.isWtypeEquipped(x)) {
condition = false;
} else {
condition = true;
}
</Custom Passive Condition>

I hope this helps, I know it is not exactly the solution route you were hoping to take. Also, I haven't exactly tried out this version of it yet, but simply modified the method I used for a similar situation. I am by no means an expert but felt like it might be a potential solution for you.
Actually, this got solved in Discord by waynee95, I just forgot about this thread and forgot to ask to have it closed! I've got the system working perfectly how I envisioned it, and without needing to toggle anything, using two of waynee's plugins (and one he whipped up especially because he's an absolute legend). I posted a guide to how it works here in this thread 🙂
Thread closed IgnoreMe

Original thread: https://forums.rpgmakerweb.com/threads/check-which-actor-is-in-the-current-scene.81792/