User Tools

Site Tools


fr:add_item_to_container

This is an old revision of the document!


FIXME Cette page n'est pas encore traduite entièrement. Merci de terminer la traduction
(supprimez ce paragraphe une fois la traduction terminée)

Ajouter un Objet au Conteneur


Ajoute un ou plusieurs objets spécifiés à un conteneur d'objets. L'ID de l'objet est sensible à la casse et doit correspondre à l'ID qui lui a été attribué dans l'Editeur d'Objets (e.g. “ITEM_0001”). Le/Les objet(s) sera/seront placé(s) dans le premier emplacement ouvert du conteneur.

Signature:

add_item_to_container(entity, item_id, count)
ArgumentDescriptionTypeRequired
entityContainer entity to which the item will be added.EntityYes
item_idID of the item (as assigned in the Item Editor).StringYes
countHow many of the item to add (defaults to 1).NumberNo

Example:

add_item_to_container(self, "ITEM_0001", 1)

Results: One of ITEM_0001 is placed into the container entity from which the script was triggered.

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, generate, or “craft” the item.


Editor Node:

Visual Demo:

fr/add_item_to_container.1591719845.txt.gz · Last modified: 2020/06/09 09:24 by cdrix