VoidExpanse/scope-items: Difference between revisions

From AtomicTorchWiki
Line 11: Line 11:
{{Scripting_api|AddItem|
{{Scripting_api|AddItem|
* int containerID, string item_type, int quantity|
* int containerID, string item_type, int quantity|
object with fields: item_id, xml_id, type, quantity ||
object with fields: item_id, xml_id, type, quantity||
Add item of specific type and quantity to the specified container ID.
Add item of specific type and quantity to the specified container ID.
Returned object contains "type" field, which can have "item" or "resource" value.
Returned object contains "type" field, which can have "item" or "resource" value.
}}
{{Scripting_api|GetGameObjectContainerId|
* int objId|
ID of the container||
Get container for any space object (currently it works for ship and crate containers)
}}
}}

Revision as of 09:10, 20 April 2015


Items scope

Used to access items containers, add or remove items.

Visibility: Global.

List of functions

AddItem
Arguments Returns Example
  • int containerID, string item_type, int quantity

object with fields: item_id, xml_id, type, quantity

Description

Add item of specific type and quantity to the specified container ID. Returned object contains "type" field, which can have "item" or "resource" value.


GetGameObjectContainerId
Arguments Returns Example
  • int objId

ID of the container

Description

Get container for any space object (currently it works for ship and crate containers)