VoidExpanse/scope-items: Difference between revisions
Ai enabled (talk | contribs) |
Ai enabled (talk | contribs) (The method name corrected - RemoveItemQuantity) |
||
Line 72: | Line 72: | ||
}} | }} | ||
{{Scripting_api| | {{Scripting_api|RemoveItemQuantity| | ||
* int: container_id | * int: container_id | ||
* int: item_id | * int: item_id | ||
* int: quantity | * int: quantity | ||
|<no result>|| | |<no result>|| | ||
Remove item from container (if quantity | Remove item from container (if the quantity is zero - remove item completely). | ||
}} | }} |
Latest revision as of 04:57, 27 July 2017
Items scope
Used to access items/cargo containers, add or remove items. Please note that the cargo is stored in the same container (so ID for items/cargo containers is the same).
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 |
|
Array of objects.
|
|
Description | ||
Returns array of items and cargo of the container. |
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. |
RemoveItemQuantity | ||
---|---|---|
Arguments | Returns | Example |
|
<no result> | |
Description | ||
Remove item from container (if the quantity is zero - remove item completely). |