User Tools

Site Tools


item

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
item [2020/12/02 11:24] justinitem [2021/04/21 20:22] (current) justin
Line 5: Line 5:
  
 =====Scripting===== =====Scripting=====
-Certain properties of an item can be access from [[script]], 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]].+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 +$item_id = widget["test"].element["0001"].item.id; 
-$item_count = widget["test"].element["0001"].item.count+$item_count = widget["test"].element["0001"].item.count;
 </code> </code>
 +
 ~~NOTOC~~ ~~NOTOC~~
item.1606937090.txt.gz · Last modified: 2020/12/02 11:24 by justin