Checking to see if you have something in your inventory

Guys,


I'm trying to create a Throw skill similar to Final Fantasy games of old. I am using Yanfly's Skill Core and Skill Require Items plugins. Basically I don't want the skill to show up in the menu unless you have a spare Sword to throw. I see they have a lunatic call to hide the skill in the menu like this 


<Custom Show Eval>


if (user.level > 50) {


visible = true;


} else {


visible = false;


}


</Custom Show Eval>


It won't show up unless the actor that can use the skill is level 51 or higher.


How would I change that to reflect whether or not the party has whichever weapon or armor is required to throw it at the enemy. 


I tried $gameParty.weapon(x) > 0 but it doesn't work. I have no knowledge of JavaScript either so anything helps.


Thanks.
Look at Game_Interpreter to see what it does under Conditional Branch when checking to see if a weapon is in inventory.
Look at Game_Interpreter to see what it does under Conditional Branch when checking to see if a weapon is in inventory.



 Shaz, I'm not sure what that is or how you would go about checking that.
In the rpg_objects.js script, search for Conditional Branch (the text you search for is the text on the button in the event editor).

Code:
    case 9:  // Weapon
        result = $gameParty.hasItem($dataWeapons[this._params[1]], this._params[2]);
        break;

parameter 1 is the weapon, parameter 2 is whether you want to also look for equipped stuff.


So your test should be something like

Code:
$gameParty.hasItem($dataWeapons[1], false)

replacing 1 with the appropriate weapon id (no leading zeros)
I figured out what you were talking about. Thanks for helping out!

Original thread: https://forums.rpgmakerweb.com/threads/checking-to-see-if-you-have-something-in-your-inventory.58184/