Skip to content

ItemDefinitionBag ​

Inherits: ItemDefinitionEquipment < ItemDefinition < DatabaseResource < Resource

A bag: equipment that gives its wearer more slots while it is worn (a satchel, a quiver, an herb pouch). It goes in an equipment slot of the equipment type the developer made for bags (make slots for four bags, say), like any other equipment, and the slots of the bags worn are added to the slots of the character.

Description ​

The slots of all bags are one pooled list; the inventory window shows them grouped by bag. A bag can accept only some groups of items (an herb bag takes only herbs): such items go there first, and nothing else goes in. A bag cannot be taken off if what it holds would not fit in the other slots. Bags give slots in the slots style; in unlimited space they are not needed. See docs/systems/inventory-styles.md, section 6.

Properties ​

intbag_slots6
Array[int]accepted_groups[]
floatweight_multiplier1.0

Methods ​

boolaccepts( definition: ItemDefinition )
boolis_special()
Array[Dictionary]validate()

Property descriptions ​

Bag

int bag_slots = 6 ​

How many slots the bag gives while it is worn

Array[int] accepted_groups = [] ​

Only items of these groups go in the bag (empty = anything). The items go in a bag that takes them before they go in the other slots

float weight_multiplier = 1.0 ​

What the items in this bag weigh, as a share of their weight (0.5 = half: a bag that makes things lighter). It matters when the inventory style counts weight

Method descriptions ​

bool accepts( definition: ItemDefinition ) ​

Does the bag take an item of this definition?

bool is_special() ​

Does the bag take only some items (so such items go there first)?

Array[Dictionary] validate() ​

Checks the settings. Gives the problems found (empty when it is fine).