|
|
Line 30: |
Line 30: |
| <pre style="margin:0px;">station.GetBaseByID(131);</pre> | | | <pre style="margin:0px;">station.GetBaseByID(131);</pre> | |
| Returns info about base. | | Returns info about base. |
| }}
| |
|
| |
|
| |
| {{Scripting_api|GetAllItems|
| |
| void |
| |
| array: xml-ids (strings) of all items |
| |
| <pre style="margin:0px;">var res = station.GetAllItems();</pre> |
| |
| Gets all items.
| |
| }}
| |
|
| |
| {{Scripting_api|GetAllItemsFitsToStationLevel|
| |
| * int: station_id |
| |
| array: xml-ids (strings) of items |
| |
| <pre style="margin:0px;">var res = station.GetAllItemsFitsToStationLevel(132);</pre> |
| |
| Gets all items, which shops_level parameter is equal or below specified station's level (actually, station has no level, so system's tech level, in which station is situated, will be taken).
| |
| }}
| |
|
| |
| {{Scripting_api|GetAllItemsOfItemType|
| |
| * string: item_type |
| |
| array: xml-ids (strings) of items |
| |
| <pre style="margin:0px;">var res = station.GetAllItemsOfItemType("Hulls");</pre> |
| |
| Gets all items of specified type. Types are: "Devices", "Hulls", "Resources", "Weapons". All types can be gained with station.GetItemTypes.
| |
| }}
| |
|
| |
| {{Scripting_api|GetItemTypes|
| |
| void |
| |
| array: strings of types |
| |
| <pre style="margin:0px;">var res = station.GetItemTypes();</pre> |
| |
| Return all items types. Useful with function station.GetAllItemsOfItemType.
| |
| }} | | }} |
Revision as of 10:27, 18 February 2014
Scope station
Useful during store generation process.
Visibility: Global.
List of functions
AddItem
|
Arguments
|
Returns
|
Example
|
- int: base_id
- string: item_type
- (optional) int: quantity
|
void
|
station.AddItem(12, "SomeItemToSell", 10);
|
Description
|
Adds item to station's store.
|
GetBaseByID
|
Arguments
|
Returns
|
Example
|
|
object:
- string: faction
- int: tech_level
- string: name
- double: coord_x
- double: coord_y
|
station.GetBaseByID(131);
|
Description
|
Returns info about base.
|