User Tools

Site Tools


item

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
item [2017/10/16 12:19] – created justinitem [2021/04/21 20:22] (current) justin
Line 3: Line 3:
  
 An **item** represents anything that the player is able to pick up and collect in their [[inventory]] or place into [[item container|item containers]]. This includes potions, keys, weapons, or even quest items that the player must retrieve for an [[NPC]]. The items for your game are defined in the [[Item Editor]]. An **item** represents anything that the player is able to pick up and collect in their [[inventory]] or place into [[item container|item containers]]. This includes potions, keys, weapons, or even quest items that the player must retrieve for an [[NPC]]. The items for your game are defined in the [[Item Editor]].
 +
 +=====Scripting=====
 +Certain item properties can be accessed from [[script|scripts]], for example to get the display name of an item by ID or to check the stack size of an item in a particular [[item_storage_slot|storage slot]].
 +
 +**Retrieving an item's name and description:**
 +<code bauxite>
 +$item_name = item["ITEM_0001"].name;
 +$item_desc = item["ITEM_0001"].description;
 +</code>
 +
 +**Retrieving the ID and count (i.e. stack size) of an item in a storage slot:**
 +<code bauxite>
 +$item_id = widget["test"].element["0001"].item.id;
 +$item_count = widget["test"].element["0001"].item.count;
 +</code>
  
 ~~NOTOC~~ ~~NOTOC~~
item.txt · Last modified: 2021/04/21 20:22 by justin