Item Definitions

Item Definitions
All relevant code is contained in Inventory/script/INV_Structs.dh

The Inventory is an array made up of index pointers which refer to the Item List, along with a minimal set of data relative to the item being held. The Item Struct struct ItemDef { 	str NAME; str DESCRIPTION; str ACTOR; str WEAPONACTOR; str PICKUPSOUND; str DROPSOUND; str ICON; str TOGGLEICON; int CLASS; int RUNSCRIPT; int MAXDURABILITY; int MAXAMOUNT; int VALUE; int KEYINDEX; int[CRAFT_MAX_ITEMS] RECIPE; fixed WEIGHT; bool CANSTACK; bool NODURABILITY; Index2DDef SIZE; ContextCommand[3] CONTEXT; };
 * NAME - String name of this item, displayed in combination with any present modifier prefix.
 * DESCRIPTION - Displayed as a TextBox on hovering this item.
 * ACTOR - String name of the pickup actor for this item
 * WEAPONACTOR - String name of the weapon actor associated with this item.
 * PICKUPSOUND/DROPSOUND - Played when this item is picked up, or moved in the inventory
 * ICON - String name of the icon image
 * TOGGLEICON - String name of the toggled icon image
 * CLASS - Defined list of classes available. Checked by many item functions.
 * RUNSCRIPT - The script number this item runs when toggled.
 * MAXDURABILITY - The maximum durability of this item
 * MAXAMOUNT - The maximum amount allowed in a stack
 * VALUE - Integer monetary worth
 * KEYINDEX - Index to compare against locks.
 * RECIPE[n] - Index of ingredient, 9 slots
 * WEIGHT - Fixed point value, representing kilograms.
 * CANSTACK - Does this item stack?
 * NODURABILITY - Does this item take damage?
 * SIZE.X/Y - Integer size (in tiles) of this item
 * CONTEXT[n] - Contains .VERB and .SCRIPT, allowing contextual item usage.

ItemList[]
All relevant code is contained within Inventory/script/ITEM_Database.dh

ItemList is populated with all the information for every item in the game. Inventory spots are filled with indexes which point to ItemList[n]. Item usage is varied so the struct is quite large, but remains static and is therefore only initialized once.

Links:

 * Current Item Database ODS