This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
equipment_slot [2020/11/30 18:48] – justin | equipment_slot [2021/07/03 22:47] – justin | ||
---|---|---|---|
Line 2: | Line 2: | ||
---- | ---- | ||
- | An **equipment slot** is a [[widget]] element for equipping an [[item]] to (for example, a sword or shield). The player can equip an [[item]] to the slot if the [[item]] has been configured as equippable in the [[Item Editor]] and it includes a tag matching the slot ID assigned to the equipment slot. | + | An **equipment slot** is a [[widget]] element for equipping an [[item]] to (for example, a sword or shield). The player can equip an [[item]] to the slot if the [[item]] has been configured as equippable in the [[Item Editor]] and it includes a valid tag assigned |
=====Element Properties===== | =====Element Properties===== | ||
^Icon^Property^Description^ | ^Icon^Property^Description^ | ||
+ | |{{: | ||
+ | |{{: | ||
=====Scripting===== | =====Scripting===== | ||
+ | You can access certain properties of an equipment slot from a [[script]] by simply referencing the parent [[widget]] and the element by their unique IDs. See below for examples of retrieving the slot's [[item]]. In this case, we are assuming that the slot currently contains an [[item]], the [[widget]] has an ID of " | ||
- | (Accessing/ | + | **Retrieving |
+ | <code bauxite> | ||
+ | $item_id = widget[" | ||
+ | $item_count = widget[" | ||
+ | </ | ||
+ | |||
+ | **Checking if an item exists in an equipment slot:** | ||
+ | <code bauxite> | ||
+ | if widget[" | ||
+ | | ||
+ | end; | ||
+ | </ | ||
~~NOTOC~~ | ~~NOTOC~~ |