User Tools

Site Tools



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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
item [2020/12/02 11:06]
item [2021/04/21 20:22] (current)
Line 5: Line 5:
 =====Scripting===== =====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:** **Retrieving an item's name and description:**
 <code bauxite> <code bauxite>
-$item_name = item["ITEM_0001"].name +$item_name = item["ITEM_0001"].name; 
-$item_desc = item["ITEM_0001"].description+$item_desc = item["ITEM_0001"].description;
 </code> </code>
-**Retrieving the ID and count (i.e. stack size) of an item in a [[storage slot]]:**+**Retrieving the ID and count (i.e. stack size) of an item in a storage slot:**
 <code bauxite> <code bauxite>
-$item_id = widget["test"].element["0001"] +$item_id = widget["test"].element["0001"]; 
-$item_count = widget["test"].element["0001"].item.count+$item_count = widget["test"].element["0001"].item.count;
 </code> </code>
 ~~NOTOC~~ ~~NOTOC~~
item.1606935987.txt.gz · Last modified: 2020/12/02 11:06 by justin