You can reference item ID X, where X is the value of game variable 1, like this:
JavaScript:
$dataItems[$gameVariables.value(1)]
Replace the
1 with your variable ID. For Weapon or Armor items, replace
$dataItems with
$dataWeapons or
$dataArmors respectively.
There are a few relevant native methods available:
$gameParty.hasItem(item, includeEquips)
True iff the party has at least one of the specified item, optionally including equipped items.
$gameParty.numItems(item)
Counts the number of the specified item currently in the inventory...does not include equips!
$gameParty.isAnyMemberEquipped(item)
True iff at least one party member has the specified item equipped.
So here's a couple of examples for use in
Conditional Branch > Script:
- True if at least one of item ID X either in inventory or equipped by a party member:
JavaScript:
$gameParty.hasItem($dataItems[$gameVariables.value(1)], true)
- True if inventory contains at least 5 of item ID X:
JavaScript:
$gameParty.numItems($dataItems[$gameVariables.value(1)]) >= 5
[Edit: added isAnyMemberEquipped to method list.]