User Tools

Site Tools


add_item_to_container

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
Next revisionBoth sides next revision
add_item_to_container [2020/01/17 09:37] justinadd_item_to_container [2020/01/25 10:18] justin
Line 2: Line 2:
 ---- ----
  
-Adds one or more of the specified item to an item container. The ID of the item is case-sensitive and should match the ID assigned to it in the [[item_editor|Item Editor]] (e.g. "ITEM_0001"). The item will be placed into the first open slot of the player's inventory.+Adds one or more of the specified item to an item container. The ID of the item is case-sensitive and should match the ID assigned to it in the [[item_editor|Item Editor]] (e.g. "ITEM_0001"). The item will be placed into the first open slot of the container.
  
 ====Signature:==== ====Signature:====
-<code lua>+<code python>
 add_item_to_container(entity, item_id, count) add_item_to_container(entity, item_id, count)
 </code> </code>
Line 15: Line 15:
  
 ====Example:==== ====Example:====
-<code python>+<code lua>
 add_item_to_container(self, "ITEM_0001", 1) add_item_to_container(self, "ITEM_0001", 1)
 </code> </code>
Line 21: Line 21:
  
 <WRAP center round tip 100%> <WRAP center round tip 100%>
-Use the **Add Item Container** function to ...+Use the **Add Item Container** function to place a new item into a chest or onto a table after the player has performed an action to build or "craft" it.
 </WRAP> </WRAP>
  
Line 34: Line 34:
 <WRAP half column> <WRAP half column>
 ====Visual Demo:==== ====Visual Demo:====
-{{:wiki:give_item_demo.gif?nolink|}}+{{:wiki:add_item_to_container_demo.gif?nolink|}}
 </WRAP> </WRAP>
 </WRAP> </WRAP>
add_item_to_container.txt · Last modified: 2023/01/02 21:08 by justin