Skip to content

Get Item Quantity

Get Item Quantity

Counts the total number of a specific item or equipment held in the party's inventory and stores the result in a variable.

Properties

System

Name Explanation Type
Include Equipped Items When enabled, equipment currently worn by party members is included in the count. Only applies when counting equipment. Toggle
Item When enabled, the command counts items. When disabled, the command counts equipment. Toggle
Reference Index The database index of the item or equipment to count in the inventory. Variable or Value
Result The variable where the total count of the specified item or equipment is stored. Variable or Value

Examples

Count Item 3 in the Inventory and Store in Global Variable 0

This counts how many of item 3 are in the party's inventory and stores the total in Global Variable 0.

$gv[0] = item_qty(3);
{"Data":{"IncludeEquipped":false,"IsItem":true,"ReferenceIndex":{"IsGlobalVariable":false,"IsLocalVariable":false,"IsValue":true,"Value":"3","VariableIndex":0,"Metadata":null},"Result":{"IsGlobalVariable":true,"IsLocalVariable":false,"IsValue":false,"Value":"","VariableIndex":0,"Metadata":null},"Metadata":null},"TypeName":"MAR.Game.RPGCore.Models.Scripts.Commands.Inventory.ItemQuantityCommand"}

Count Equipment 1 Including Equipped Copies

This counts how many of equipment 1 are in the inventory, including copies currently equipped by party members, and stores the result in Local Variable 0.

$lv[0] = item_qty(1, equipment, include_equipped);
{"Data":{"IncludeEquipped":true,"IsItem":false,"ReferenceIndex":{"IsGlobalVariable":false,"IsLocalVariable":false,"IsValue":true,"Value":"1","VariableIndex":0,"Metadata":null},"Result":{"IsGlobalVariable":false,"IsLocalVariable":true,"IsValue":false,"Value":"","VariableIndex":0,"Metadata":null},"Metadata":null},"TypeName":"MAR.Game.RPGCore.Models.Scripts.Commands.Inventory.ItemQuantityCommand"}

Count Equipment by Index from Global Variable 2

This counts equipment at the index stored in Global Variable 2 and stores the result in Global Variable 0.

$gv[0] = item_qty($gv[2], equipment);
{"Data":{"IncludeEquipped":false,"IsItem":false,"ReferenceIndex":{"IsGlobalVariable":true,"IsLocalVariable":false,"IsValue":false,"Value":"","VariableIndex":2,"Metadata":null},"Result":{"IsGlobalVariable":true,"IsLocalVariable":false,"IsValue":false,"Value":"","VariableIndex":0,"Metadata":null},"Metadata":null},"TypeName":"MAR.Game.RPGCore.Models.Scripts.Commands.Inventory.ItemQuantityCommand"}