VoidExpanse/scope-items: Difference between revisions
Ai enabled (talk | contribs) |
Ai enabled (talk | contribs) |
||
| Line 15: | Line 15: | ||
* string: xml_id - xml item type ID | * string: xml_id - xml item type ID | ||
* string: type - can be "item" or "resource" | * string: type - can be "item" or "resource" | ||
* int: quantity - amount of item added| | * int: quantity - amount of item added | ||
| | |||
<pre style="margin:0px;">var obj = items.AddItem(24556, "SomeItem2", 5);</pre> | |||
| | |||
Add item of specific type and quantity to the specified container ID. | Add item of specific type and quantity to the specified container ID. | ||
}} | }} | ||
Revision as of 09:24, 20 April 2015
Items scope
Used to access items containers, add or remove items.
Visibility: Global.
List of functions
| AddItem | ||
|---|---|---|
| Arguments | Returns | Example |
|
object:
|
var obj = items.AddItem(24556, "SomeItem2", 5); |
| Description | ||
|
Add item of specific type and quantity to the specified container ID. | ||
| GetGameObjectContainerId | ||
|---|---|---|
| Arguments | Returns | Example |
|
ID of the container |
|
| Description | ||
|
Get container for any space object (currently it works for ship and crate containers). | ||
| GetItemsAndCargo | ||
|---|---|---|
| Arguments | Returns | Example |
|
ID of the container |
|
| Description | ||
|
Returns array of items and cargo of the container. Array contains of objects with fields "item_id", "xml_id", "quantity". | ||
| GetShipInventoryContainerId | ||
|---|---|---|
| Arguments | Returns | Example |
|
ID of the container |
|
| Description | ||
|
Returns ID of the ship inventory and cargo container. You can get it also by the GetGameObjectContainerId() function. | ||
| GetStationShopContainerId | ||
|---|---|---|
| Arguments | Returns | Example |
|
ID of the container |
|
| Description | ||
|
Returns ID of the station shop container, which contains all the items available for sale on the station. | ||
| GetStationStorageContainerId | ||
|---|---|---|
| Arguments | Returns | Example |
|
ID of the container |
|
| Description | ||
|
Returns ID of the station storage container for the specific ship. | ||
| RemoveCargo | ||
|---|---|---|
| Arguments | Returns | Example |
|
<no result> | |
| Description | ||
|
Remove cargo from container. | ||
| RemoveItem | ||
|---|---|---|
| Arguments | Returns | Example |
|
<no result> | |
| Description | ||
|
Remove item from container (if quantity not specified or zero - remove all quantity). | ||