Script to determine if a weapon type is equipped [solved]

Hi, I'm new to rpgmaker mv. I used rmxp a long long time ago.



I trying to use a script to call the weapon type id of an equipped weapon, like http://www.rpgmakercentral.com/topi...n-type-is-equipped-in-the-second-weapon-slot/



I tried $gameActors.actor(actor_id).wTypeId and $gameActors.actor(actor_id).equippedWType()[slot_id] but they didn't work. I can't find the function in the script calls list.



Thanks in advance for your help!

I've moved this thread to Plugin Support. Thank you.

Thanks mlogan for moving it to the right place.
And never mind this post, I figured it out after looking at the database .json files.
This is the script call:
Code:
$gameActors.actor(actor_id).equips()[slot_id].wtypeId
This is the conditional script:
Code:
($gameActors.actor(actor_id).equips()[slot_id] && ($gameActors.actor(actor_id).equips()[slot_id].wtypeId === wtype_id) )
For dual wielding (right or left hand):
Code:
($gameActors.actor(actor_id).equips()[slot_id] && ($gameActors.actor(actor_id).equips()[slot_id].wtypeId === wtype_id) ) || ($gameActors.actor(actor_id).equips()[slot_id] && ($gameActors.actor(actor_id).equips()[slot_id].wtypeId === wtype_id) )
The first part has to be there or the game will crash when nothing is equipped.
I can't seem to get the code to work. I copied it into the script option of the conditional branch and changed the actor_id sections, slot_id sections and wtype_id. I'm not sure if it comes down to the wrong numbers, 3 in actor_id for the third character in the database, 2 for dual wield slot and 5 in wtype_id for the fifth weapon type in the database. Any suggestion for what went wrong?

Original thread: https://forums.rpgmakerweb.com/threads/script-to-determine-if-a-weapon-type-is-equipped-solved.83799/