VoidExpanse/scope-station: Difference between revisions

From AtomicTorchWiki
No edit summary
No edit summary
 
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|GenerateStockDistribution|
* int: base_id|
object:
type: quantity|
<pre style="margin:0px;">station.GenerateStockDistribution(12);</pre> |
Generates stock distribution (type_of_good => quantity) based on xml data of station.
}}
{{Scripting_api|GetCivilianItems|
void|
arrqy of string IDs|
<pre style="margin:0px;">station.GetCivilianItems();</pre> |
Returns IDs of items with xml flag "civilian".
}}
{{Scripting_api|GetRandomTradeRoute|
* int: ship
* int: radus|
object:
* int: station_sell_id
* int: station_buy_id
* int: system_sell_id
* int: system__buy_id
* string: station_sell
* string: station_buy
* string: system_sell
* string: system_buy
* string: good
* int: jumps (length of route)
* double: time_left|
<pre style="margin:0px;">var route = station.GetRandomTradeRoute(1324, 4);</pre> |
Returns a trade route for ship withing systems of specified range.
}}
}}

Latest revision as of 03:57, 5 July 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
  • int: base_id

object:

  • string: faction
  • int: tech_level
  • string: name
  • double: coord_x
  • double: coord_y
station.GetBaseByID(131);
Description

Returns info about base.


GenerateStockDistribution
Arguments Returns Example
  • int: base_id

object: type: quantity

station.GenerateStockDistribution(12);
Description
{{{5}}}


GetCivilianItems
Arguments Returns Example

void

arrqy of string IDs

station.GetCivilianItems();
Description

Returns IDs of items with xml flag "civilian".


GetRandomTradeRoute
Arguments Returns Example
  • int: ship
  • int: radus

object:

  • int: station_sell_id
  • int: station_buy_id
  • int: system_sell_id
  • int: system__buy_id
  • string: station_sell
  • string: station_buy
  • string: system_sell
  • string: system_buy
  • string: good
  • int: jumps (length of route)
  • double: time_left
var route = station.GetRandomTradeRoute(1324, 4);
Description

Returns a trade route for ship withing systems of specified range.