<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.atomictorch.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Damonwall</id>
	<title>AtomicTorchWiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.atomictorch.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Damonwall"/>
	<link rel="alternate" type="text/html" href="https://wiki.atomictorch.com/Special:Contributions/Damonwall"/>
	<updated>2026-05-30T11:39:58Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://wiki.atomictorch.com/index.php?title=VoidExpanse/scope-ship&amp;diff=237</id>
		<title>VoidExpanse/scope-ship</title>
		<link rel="alternate" type="text/html" href="https://wiki.atomictorch.com/index.php?title=VoidExpanse/scope-ship&amp;diff=237"/>
		<updated>2014-07-05T04:02:15Z</updated>

		<summary type="html">&lt;p&gt;Damonwall: /* List of functions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:VoidExpanse/api_scopes]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Scope ship =&lt;br /&gt;
Used to get info and manipulate objects if type &amp;quot;ship&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Visibility:&#039;&#039;&#039; Global.&lt;br /&gt;
&lt;br /&gt;
== List of functions ==&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddItem|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: xml_item_type&lt;br /&gt;
* int: quantity|&lt;br /&gt;
object:&lt;br /&gt;
* int: quantity - amount added&lt;br /&gt;
* string: type - &amp;quot;item&amp;quot; or &amp;quot;resource&amp;quot;|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var obj = ship.Add(24556, &amp;quot;SomeItem2&amp;quot;, 5);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds item to ship&#039;s inventory.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddItemToStorage|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: xml_item_type&lt;br /&gt;
* int: quantity|&lt;br /&gt;
object:&lt;br /&gt;
* int: quantity - amount added&lt;br /&gt;
* string: type - &amp;quot;item&amp;quot; or &amp;quot;resource&amp;quot;|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var obj = ship.AddItemToStorage(24556, &amp;quot;BFG&amp;quot;, 0);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds item to ship&#039;s storage, not inventory (only works on a base). Useful when you need to add new hull through scripts, but&lt;br /&gt;
it cannot be added to inventory, only to storage.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RemoveItem|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* int: item_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.RemoveItem(24556, 5562);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes item from ship&#039;s inventory.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RemoveItemByType|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: item_xml_type|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.RemoveItemByType(24556, &amp;quot;SomeItem2&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes item from PLAYER&#039;s inventory by type. If there&#039;s no item of specified type in ship&#039;s&lt;br /&gt;
inventory, nothing will happen.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RemoveItemByTypeCount|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: item_xml_type&lt;br /&gt;
* int: quantity|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.RemoveItemByTypeCount(24556, &amp;quot;SomeItem2&amp;quot;, 5);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes item from PLAYER&#039;s inventory by type. If there&#039;s no item of specified type in ship&#039;s&lt;br /&gt;
inventory, nothing will happen.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RemoveCargoByType|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: cargo_type&lt;br /&gt;
* &#039;&#039;(optional) int: cargo_quantity&#039;&#039;|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.RemoveCargoByType(24556, &amp;quot;SomeCargo&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes cargo from PLAYER&#039;s inventory by type. If there&#039;s no cargo of specified type in ship&#039;s&lt;br /&gt;
inventory, nothing will happen.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddSkillPointsToPlayer|&lt;br /&gt;
* string: player_name&lt;br /&gt;
* int: skillpoints|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.AddSkillPointsToPlayer(&amp;quot;DLirry&amp;quot;, 20);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds skill points to specified player.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddSkillPointsToShip|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* int: skillpoints|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.AddSkillPointsToShip(12335, 20);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds skill points to specified ship (works only on player&#039;s ships, non-npc).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetCargoAmount|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: cargo_type|&lt;br /&gt;
int: amount|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var left = ship.GetCargoAmount(24556, &amp;quot;SomeCargo&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns amount of specified cargo in player&#039;s inventory.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetCoordinates|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
vector2: coordinates|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var coords = ship.GetCoordinates(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns current coordinates of specified ship. Alias of GetPosition.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetShipsInScope|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
array of int: ids|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var ships = ship.GetShipsInScope(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns IDs of all ships, that are currently in specified ship&#039;s scope.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetProjectilesInScope|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
array of int: ids|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var bullets = ship.GetProjectilesInScope(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns IDs of all projectiles, that are currently in specified ship&#039;s scope.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetDistanceToObj|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* int: object_id |&lt;br /&gt;
double: distance|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var dist = ship.GetDistanceToObj(24556, 25225);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns distance from specified ship to specified object.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetFreeInventorySlots|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
int: number of free slots|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var slotsNum= ship.GetFreeInventorySlots(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns number of empty inventory slots in ship&#039;s inventory.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|HasCargoAmount|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: cargo_type&lt;br /&gt;
* int: amount|&lt;br /&gt;
bool|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var hasCargo = ship.HasCargoAmount(24556, &amp;quot;SomeCargo&amp;quot;, 14);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Checks if player has specified amount of cargo.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|HasItemOfType|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: item_id|&lt;br /&gt;
bool: if player&#039;s ship has item of specified type|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var hasItem = ship.HasItemOfType(24556, &amp;quot;SomeItem1&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Useful in quests.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|CountItemOfType|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: item_id|&lt;br /&gt;
int: count|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var quantity = ship.CountItemOfType(24556, &amp;quot;SomeItem1&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Useful in quests.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|CountItemOfType|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: item_id|&lt;br /&gt;
int: count|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var quantity = ship.CountItemOfType(24556, &amp;quot;SomeItem1&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Useful in quests.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetBuffs|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
array of objects:&lt;br /&gt;
* int: caster - id of ship casted this active effect&lt;br /&gt;
* double: time_left - time left&lt;br /&gt;
* double: effect_base&lt;br /&gt;
* double: effect_cap&lt;br /&gt;
* double: effect_per_level&lt;br /&gt;
* string: effect_type|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var effects = ship.GetBuffs(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns all specified ship&#039;s active effects. Active effects are temporary effects, which are usually&lt;br /&gt;
effects of consumables or devices.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetBuffsCache|&lt;br /&gt;
* int: ship_id |&lt;br /&gt;
array: key - value |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var cache = ship.GetBuffsCache(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns current buffs cache. Used in FinalCacheCalculations.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetCurrentValue|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: name|&lt;br /&gt;
double: current value with specified key|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var val = ship.GetCurrentValue(24556, &amp;quot;structure&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns current value of ship.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetCurrentValuesList|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
array: key -&amp;gt; value|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var values = ship.GetCurrentValuesList(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns all current values of ship.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetEquipment|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
array: unique IDs (int) of equipped items|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var equipment = ship.GetEquipment(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns current equipment of player&#039;s ship. Npc ship has no equipment, so it cannot be retreieved this way.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetWeapons|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
array: unique IDs (int) of equipped weapons|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var weapons = ship.GetWeapons(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns currently equipped weapons of a ship. Npc ship has no equipment, so it cannot be retireved this way.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetWeaponsOfType|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* int: weapon_type (1 for energy, 2 for ballistic, 3 for missile)|&lt;br /&gt;
array: unique IDs (int) of equipped weapons|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var weapons = ship.GetWeapons(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns currently equipped weapons of a ship of a specified type. Npc ship has no equipment, so it cannot be retireved this way.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RefillAmmoForWeapon|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* int: weapon_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.RefillAmmoForWeapon(24556, 15252);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Refills ammo for weapon with specified unique in-game id (GID).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetHullXmlID|&lt;br /&gt;
* int: ship_id |&lt;br /&gt;
string: current ship&#039;s hull&#039;s xml type|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var hull = ship.GetHullXmlID(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns currently equipped hull&#039;s xml_id.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetEquipmentCache|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
array: key-value|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var cache = ship.GetEquipmentCache(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns current equipment cache of ship.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetFinalCache|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
array: key-value|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var cache = ship.GetFinalCache(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns current final cache of ship.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetFinalCacheValue|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: name|&lt;br /&gt;
double: specified cache value|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var val = ship.GetFinalCacheValue(24556, &amp;quot;structure&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns final cache value.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetSkills|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
array of objects:&lt;br /&gt;
* string: id&lt;br /&gt;
* int: level&lt;br /&gt;
* string: skill_id|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var skills = ship.GetSkills(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns all current skills of ship.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetSkillsCache|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
array: key-value|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var cache = ship.GetSkillsCache(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns current skills cache.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetLevel|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
int: current level of ship|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var level = ship.GetLevel(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetTags|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
object: tags of a ship|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var tags = ship.GetTags(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetSystemID|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
int: ID of ship&#039;s current system|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var sys_id = ship.GetSystemID(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|IsDocked|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
bool: returns whether ship is currently docked|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var docked = ship.IsDocked(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|EnteringJumpgate|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
int: returns ID of jumpgate ship is entering (or 0 if none)|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var current_jumpgate = ship.EnteringJumpgate(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetCurrentBase|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
int: returns ID of base to which ship is docked (or -1 if none)|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var current_base = ship.GetCurrentBase(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetTimeSinceLastHit|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
double: time since ship last time dealt damage to someone|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var time = ship.GetTimeSinceLastHit(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Used in AI&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetTimeSinceLastHitted|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
double: time since ship last time took damage from someone|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var time = ship.GetTimeSinceLastHitted(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Used in ship&#039;s shield reestablishment calculations.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|IsShieldUp|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
bool: returns whether ship&#039;s shield is up|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var shield_up = ship.IsShieldUp(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|IsNpc|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
bool: returns whether ship is npc-controlled|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var is_npc = ship.IsNpc(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|IsEngineOn|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
bool: returns whether ship&#039;s engine is working|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var is_engine_on = ship.IsEngineOn(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RegenerateWeapons|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* double: energy&lt;br /&gt;
* double: mult|&lt;br /&gt;
double: amount of energy spent on weapons regeneration|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var energy_spent = ship.RegenerateWeapons(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Hardcoded part - trying to regenerate weapons with energy. Only usable on PLAYER&#039;s ships. Returns amount of energy spent on weapons regeneration.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|ReleaseGrappler|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.ReleaseGrappler(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Release all current grappled objects.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetGrappledCount|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
int: number of grappled objects|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var grappled = ship.GetGrappledCount(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Get number of grappled objects. Useful in caluclation of grappler energy consumption.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetBuffsCacheValue|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: field_name&lt;br /&gt;
* double: value|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.SetBuffsCacheValue(24556, &amp;quot;structure&amp;quot;, 2);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets buff cache value.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|ClearBuffsCache|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.ClearBuffsCache(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Clears all current buffs cache values.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetCurrentValue|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: field_name&lt;br /&gt;
* double: val|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.SetCurrentValue(24556, &amp;quot;structure&amp;quot;, 59);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets current value of ship&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetCurrentValueDelta|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: field_name&lt;br /&gt;
* double: val|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.SetCurrentValueDelta(24556, &amp;quot;structure&amp;quot;, -10);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Alters current value to specified value. Value will be clamped automatically between 0 and it&#039;s max value (which is governed by ship params.)&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetCurrentArea|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: area_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.SetCurrentArea(24556, &amp;quot;command_deck&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets current area of a player to specified one. Area determines in which section on a station NPC or player is.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetCurrentArea|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
string: area_id|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var area = ship.GetCurrentArea(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Gets current area of the ship.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetDrift|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* double: time|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.SetDrift(24556, 5000);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Enables driftmode of ship - in this mode ship cannot be controlled and can gain torque (which is always 0 when driftmode is off). Useful in explosion effects.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetEquipmentCacheValue|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: field_name&lt;br /&gt;
* double: value|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.SetEquipmentCacheValue(24556, &amp;quot;structure&amp;quot;, 5000);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets equipment cache value.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|ClearEquipmentCache|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.ClearEquipmentCache(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Clears equipment cache.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetFinalCacheValue|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: field_name&lt;br /&gt;
* double: value|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.SetFinalCacheValue(24556, &amp;quot;structure&amp;quot;, 5000);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets final cache value. Final cache is the one used in all in-game caluclations.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetShieldUp|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* bool: status - true or false|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.SetShieldUp(24556, true);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets shield up/down status. Affects collision and damage models. Does not applies visual effects (see more in [[VoidExpanse/scope-visual|VisualScope]]). &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetSkillsCacheValue|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: field_name&lt;br /&gt;
* double: value|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.SetSkillsCacheValue(24556, &amp;quot;structure&amp;quot;, 5000);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets skill cache value.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|ClearSkillsCache|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.ClearSkillsCache(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Clear skills cache.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetShipAsArrivedFromJumpgate|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* int: jumpgate_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.SetShipAsArrivedFromJumpgate(24556, 15);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Set visual and physical effects, that looks like ship just arrived from specified jumpgate.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetDamageByShip|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* double: damage&lt;br /&gt;
* int: caster_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.SetDamageByShip(24556, 15, 44535);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets damage from ship. Useful in AI - you can count damage from player ship and decide, whether to attack or not.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetDamageByShip|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* int: caster_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var dmg = ship.SetDamageByShip(24556, 44535);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Gets damage by ship, which was set by ship.SetDamageByShip method.&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Damonwall</name></author>
	</entry>
	<entry>
		<id>https://wiki.atomictorch.com/index.php?title=VoidExpanse/scope-config&amp;diff=236</id>
		<title>VoidExpanse/scope-config</title>
		<link rel="alternate" type="text/html" href="https://wiki.atomictorch.com/index.php?title=VoidExpanse/scope-config&amp;diff=236"/>
		<updated>2014-07-05T03:58:42Z</updated>

		<summary type="html">&lt;p&gt;Damonwall: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:VoidExpanse/api_scopes]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
= Config scope =&lt;br /&gt;
Used to get access to server variables from config file.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Visibility:&#039;&#039;&#039; Global.&lt;br /&gt;
&lt;br /&gt;
== List of functions ==&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetSetting|&lt;br /&gt;
* string: name|&lt;br /&gt;
string- a particular value of config.|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px&amp;quot;&amp;gt;var a = config.GetSetting(&amp;quot;some_var&amp;quot;);&amp;lt;/pre&amp;gt;|&lt;br /&gt;
Returns a server variable value by name. Basically used to read server config options from script.&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Damonwall</name></author>
	</entry>
	<entry>
		<id>https://wiki.atomictorch.com/index.php?title=VoidExpanse/scope-station&amp;diff=235</id>
		<title>VoidExpanse/scope-station</title>
		<link rel="alternate" type="text/html" href="https://wiki.atomictorch.com/index.php?title=VoidExpanse/scope-station&amp;diff=235"/>
		<updated>2014-07-05T03:57:47Z</updated>

		<summary type="html">&lt;p&gt;Damonwall: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:VoidExpanse/api_scopes]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Scope station =&lt;br /&gt;
Useful during store generation process.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Visibility:&#039;&#039;&#039; Global.&lt;br /&gt;
&lt;br /&gt;
== List of functions ==&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddItem|&lt;br /&gt;
* int: base_id&lt;br /&gt;
* string: item_type&lt;br /&gt;
* &#039;&#039;(optional) int: quantity&#039;&#039;|&lt;br /&gt;
void |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;station.AddItem(12, &amp;quot;SomeItemToSell&amp;quot;, 10);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds item to station&#039;s store.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetBaseByID|&lt;br /&gt;
* int: base_id|&lt;br /&gt;
object:&lt;br /&gt;
* string: faction&lt;br /&gt;
* int: tech_level&lt;br /&gt;
* string: name&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;station.GetBaseByID(131);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns info about base.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GenerateStockDistribution|&lt;br /&gt;
* int: base_id|&lt;br /&gt;
object:&lt;br /&gt;
type: quantity|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;station.GenerateStockDistribution(12);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Generates stock distribution (type_of_good =&amp;gt; quantity) based on xml data of station.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetCivilianItems|&lt;br /&gt;
void|&lt;br /&gt;
arrqy of string IDs|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;station.GetCivilianItems();&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns IDs of items with xml flag &amp;quot;civilian&amp;quot;.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetRandomTradeRoute|&lt;br /&gt;
* int: ship&lt;br /&gt;
* int: radus|&lt;br /&gt;
object:&lt;br /&gt;
* int: station_sell_id&lt;br /&gt;
* int: station_buy_id&lt;br /&gt;
* int: system_sell_id&lt;br /&gt;
* int: system__buy_id&lt;br /&gt;
* string: station_sell&lt;br /&gt;
* string: station_buy&lt;br /&gt;
* string: system_sell&lt;br /&gt;
* string: system_buy&lt;br /&gt;
* string: good&lt;br /&gt;
* int: jumps (length of route)&lt;br /&gt;
* double: time_left|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var route = station.GetRandomTradeRoute(1324, 4);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns a trade route for ship withing systems of specified range.&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Damonwall</name></author>
	</entry>
	<entry>
		<id>https://wiki.atomictorch.com/index.php?title=VoidExpanse/scope-game&amp;diff=234</id>
		<title>VoidExpanse/scope-game</title>
		<link rel="alternate" type="text/html" href="https://wiki.atomictorch.com/index.php?title=VoidExpanse/scope-game&amp;diff=234"/>
		<updated>2014-07-05T03:51:11Z</updated>

		<summary type="html">&lt;p&gt;Damonwall: /* List of functions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:VoidExpanse/api_scopes]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Scope game =&lt;br /&gt;
Used for various in-game functions.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Visibility:&#039;&#039;&#039; Global.&lt;br /&gt;
&lt;br /&gt;
== List of functions ==&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|ApplyForceToObject|&lt;br /&gt;
* int: object_id&lt;br /&gt;
* double: force_x&lt;br /&gt;
* double: force_y |&lt;br /&gt;
void |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;game.ApplyForceToObject(153, 10, 0); // add x-axis force&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Applies force to physics object. Will work on any interactive object.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|ApplyTorqueToObject|&lt;br /&gt;
* int: object_id&lt;br /&gt;
* double: torque |&lt;br /&gt;
void |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;game.ApplyTorqueToObject(153, 10); // add torque&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Applies torque to physics object. Will work on any interactive object.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|DamageProjectile|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* int: projectile_id&lt;br /&gt;
* double: damage |&lt;br /&gt;
void |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;game.DamageProjectile(1, 12, 10);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Damages projectile. Projectile, that took enough damage, will explode.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|TryToRemoveContentFromAsteroid|&lt;br /&gt;
* int: asteroid_id&lt;br /&gt;
* string: name&lt;br /&gt;
* int: amount |&lt;br /&gt;
int: amount of content extracted from asteroid|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;game.TryToRemoveContentFromAsteroid(12, &amp;quot;ResourceOre&amp;quot;, 10);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Tries to remove specified resource from asteroid&#039;s contents. Returns extracted amount.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetItemEffects|&lt;br /&gt;
* string: xml_item_id|&lt;br /&gt;
array of objects:&lt;br /&gt;
* double: effect_base&lt;br /&gt;
* double: effect_cap&lt;br /&gt;
* double: effect_per_level&lt;br /&gt;
* double: effect_type|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var effects = game.GetItemEffects(&amp;quot;SomeItem&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns an array of all effects of specified item.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetStationDockedNpcs|&lt;br /&gt;
* int: station_id|&lt;br /&gt;
array of int|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var npcs = game.GetStationDockedNpcs(25353);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns an array of IDs of all ships, that are docked to a station.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetItemPrice|&lt;br /&gt;
* string: xml_item_id|&lt;br /&gt;
int: item_price|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var price = game.GetItemPrice(&amp;quot;SomeItem&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetItemSID|&lt;br /&gt;
* int: unique_item_id |&lt;br /&gt;
string: xml_item_id |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var xml_item_id = game.GetItemSID(12352);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns xml_id of item by it&#039;s instance ID.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetProjectileDescriptionByXmlID|&lt;br /&gt;
* string: projectile_xml_id |&lt;br /&gt;
object:&lt;br /&gt;
* double: damage&lt;br /&gt;
* string: damage_type|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var xml_item_id = game.GetProjectileDescriptionByXmlID(&amp;quot;wpn_0&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Gets projectile description. Projectile xml ID is constructed by the following rule: wpn_id + &amp;quot;_&amp;quot; + projectile_order (starting with 0).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetSecondsMultiplier|&lt;br /&gt;
void |&lt;br /&gt;
void |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var multiplier = game.GetSecondsMultiplier();&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns time passed since last frame. Useful when calculating time-depended stuff, like health-regeneration or damage.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetGameObjectTags|&lt;br /&gt;
* int: object_id |&lt;br /&gt;
void |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var tags = game.GetGameObjectTags(131);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Gets game object tags. Any physical object, such as asteroid, space object, ship or else, has it&#039;s own tags. This function can retrieve it. Alias of game.GetTags.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetTags|&lt;br /&gt;
* int: object_id |&lt;br /&gt;
void |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var tags = game.GetTags(131);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Gets game object tags. Any physical object, such as asteroid, space object, ship or else, has it&#039;s own tags. This function can retrieve it. The same as game.GetGameObjectTags.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetShipOwner|&lt;br /&gt;
* int: ship_id |&lt;br /&gt;
string: owner_name |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var name = game.GetShipOwner(123142);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns name of ship&#039;s owner. If ship is npc-controller, that would be npc name, else - player&#039;s name.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetAsteroidMiningListByID|&lt;br /&gt;
* int: asteroid_id |&lt;br /&gt;
array of objects:&lt;br /&gt;
* string: xml_id&lt;br /&gt;
* int: quantity&lt;br /&gt;
* int: extraction|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var list = game.GetAsteroidMiningListByID(1252);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns actual ateroid mining list.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetAsteroidDescriptionByID|&lt;br /&gt;
* int: asteroid_id |&lt;br /&gt;
object:&lt;br /&gt;
* int: type&lt;br /&gt;
* int: difficulty|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var desc = game.GetAsteroidDescriptionByID(1252);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns asteroid description.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetSkillEffects|&lt;br /&gt;
* string: skill_xml_id |&lt;br /&gt;
array of objects:&lt;br /&gt;
* int: cost&lt;br /&gt;
* int: page&lt;br /&gt;
* string: title|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var effects = game.GetSkillEffects(&amp;quot;SomeSkill&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns array of specified skills&#039; effects.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|IsResource|&lt;br /&gt;
* string: item_xml_id |&lt;br /&gt;
bool: is specified item resource|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var is_res = game.IsResource(&amp;quot;SomeItemOrResource&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|IsHull|&lt;br /&gt;
* string: item_xml_id |&lt;br /&gt;
bool: is specified item is hull|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var is_hull = game.IsHull(&amp;quot;SomeItemOrResource&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|IsDevice|&lt;br /&gt;
* string: item_xml_id |&lt;br /&gt;
bool: is specified item is device|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var is_dev = game.IsDevice(&amp;quot;SomeItemOrResource&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|IsWeapon|&lt;br /&gt;
* string: item_xml_id |&lt;br /&gt;
bool: is specified item is weapon|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var is_wpn = game.IsWeapon(&amp;quot;SomeItemOrResource&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|IsShipPlayerControlled|&lt;br /&gt;
* int: ship_id |&lt;br /&gt;
bool: is ship controlled by player|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var is_player = game.IsShipPlayerControlled(123252);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetSystemJumpgates|&lt;br /&gt;
* int: system_id |&lt;br /&gt;
array: IDs of system jumpgates |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var jumpgates = game.GetSystemJumpgates(1);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns all jumpgates of specified system.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetSystemBases|&lt;br /&gt;
* int: system_id |&lt;br /&gt;
array: IDs of system bases |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var bases = game.GetSystemBases(1);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns all bases of specified system.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetSystemShips|&lt;br /&gt;
* int: system_id |&lt;br /&gt;
array: IDs of system ships |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var ships = game.GetSystemShips(1);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns all ships of specified system.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetSystemShipsOfClass|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* string: tags_class |&lt;br /&gt;
array: IDs of system ships |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var miner_ships = game.GetSystemShipsOfClass(1, &amp;quot;miner&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns all ships of specified system, which tag &amp;quot;class&amp;quot; is equal to specified value.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetSystemPlayersShips|&lt;br /&gt;
* int: system_id |&lt;br /&gt;
array: IDs of system players&#039; ships |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var ships = game.GetSystemPlayersShips(1);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns all player-controlled ships of specified system.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetObjectCoordinates|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* int: object_id |&lt;br /&gt;
vector2: coordinates |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var coords = game.GetObjectCoordinates(1, 25442);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns coordinates of specified object.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|DeleteGameObject|&lt;br /&gt;
* int: object_id |&lt;br /&gt;
void |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;game.DeleteGameObject(25442);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Deletes game object from game world.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetBaseEntryPointsByID|&lt;br /&gt;
* int: base_id |&lt;br /&gt;
array of vector2 |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var points = game.GetBaseEntryPointsByID(353);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns bases&#039; actual entry points coordinates.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetSecondsBetweenStarSystemUpdates|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* int: seconds |&lt;br /&gt;
void |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;game.SetSecondsBetweenStarSystemUpdates(1, 60);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets interval between event &amp;quot;OnStarSystemUpdate&amp;quot; for this system calls.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SendNotification|&lt;br /&gt;
* string: player_name&lt;br /&gt;
* string: title&lt;br /&gt;
* string: message |&lt;br /&gt;
void |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;game.SendNotification(&amp;quot;dlirry&amp;quot;, &amp;quot;Server notification&amp;quot;, &amp;quot;You are great player!&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sends notification to connected player.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetAllItems|&lt;br /&gt;
void |&lt;br /&gt;
array: xml-ids (strings) of all items |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var res = game.GetAllItems();&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Gets all items.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetItems|&lt;br /&gt;
* int: level&lt;br /&gt;
* string[]: item_types |&lt;br /&gt;
array: xml-ids (strings) of items |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var res = game.GetItems(15, [&amp;quot;Hull&amp;quot;, &amp;quot;Consumable&amp;quot;]);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Gets all items of specified type.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetItemTypes|&lt;br /&gt;
void |&lt;br /&gt;
array: strings of types |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var res = game.GetItemTypes();&amp;lt;/pre&amp;gt; |&lt;br /&gt;
&#039;&#039;&#039;not implemented&#039;&#039;&#039;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetProjectileFromSystemByID|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* int: projectile_id |&lt;br /&gt;
object:&lt;br /&gt;
* string: id&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y&lt;br /&gt;
* int: caster_id |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var proj = game.GetProjectileFromSystemByID(15,2524);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns basic information about specified projectile. ID in returned object is full projectile ID, which is&lt;br /&gt;
xml_weapon_id + &amp;quot;_&amp;quot; + number_of_projectile_in_weapon.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|ProjectileFromSystemDestroy|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* int: projectile_id |&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;game.ProjectileFromSystemDestroy(15,2524);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Destroys specified projectile.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|ProjectileFromSystemSetSpeed|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* int: projectile_id&lt;br /&gt;
* double: speed_x&lt;br /&gt;
* double: speed_y|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;game.ProjectileFromSystemSetSpeed(15,2524, 0, 0); //stop projectile&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets projectile linear speed. Useful for manipulating projectile speed, doesn&#039;t affect it&#039;s direction.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|PlaySound|&lt;br /&gt;
* string: player_name&lt;br /&gt;
* string: sound |&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;game.PlaySound(&amp;quot;Neolog&amp;quot;, &amp;quot;special/blast_sound.ogg&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Plays a special sound on a client&#039;s side for specified player.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|ShipPlaySound|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: sound_id&lt;br /&gt;
* string: sound_path&lt;br /&gt;
* double: delay&lt;br /&gt;
* bool: isLooping|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;game.ShipPlaySound(123, &amp;quot;grappler_1&amp;quot;, &amp;quot;special/grappler_process.ogg&amp;quot;, 0.1, true);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Emits specified sound from specified ship. If isLooping is on, then sound must be stopped with game.ShipStopSound command. Sound_id argument must be unique inside ship&#039;s sounds and used for stopping looping sounds.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|ShipStopSound|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: sound_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;game.ShipStopSound(123, &amp;quot;grappler_1&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Stops the looping sound, that was started with game.ShipPlaySound command.&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Damonwall</name></author>
	</entry>
	<entry>
		<id>https://wiki.atomictorch.com/index.php?title=VoidExpanse/scope-generator&amp;diff=233</id>
		<title>VoidExpanse/scope-generator</title>
		<link rel="alternate" type="text/html" href="https://wiki.atomictorch.com/index.php?title=VoidExpanse/scope-generator&amp;diff=233"/>
		<updated>2014-07-05T03:44:45Z</updated>

		<summary type="html">&lt;p&gt;Damonwall: /* List of functions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:VoidExpanse/api_scopes]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Scope generator =&lt;br /&gt;
Used for generation items, objects, systems in game, and also for getting some specific info about them.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Visibility:&#039;&#039;&#039; Global.&lt;br /&gt;
&lt;br /&gt;
== List of functions ==&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddAsteroid|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y&lt;br /&gt;
* string: type - xml id of asteroid&lt;br /&gt;
* double: scale&lt;br /&gt;
* double: resQ - resouces modifier&lt;br /&gt;
* object: rotation&lt;br /&gt;
* object: rotationSpeed |&lt;br /&gt;
int: identifier of created object|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var id = generator.AddAsteroid(1,100,100,&amp;quot;Asteroid01&amp;quot;,1, 0, {x:0,y:0,z:0}, {x:0,y:0,z:0});&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds asteroid with specified parameters into game world. Asteroid contents (extractable resources), asteroid&#039;s look and other parameters&lt;br /&gt;
can be modified only in .xml file, which is specified in this function by parameter &amp;quot;type&amp;quot;. &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddBase|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y&lt;br /&gt;
* string: type - xml id of base&lt;br /&gt;
* string: name&lt;br /&gt;
* &#039;&#039;(optional) object: tags&#039;&#039; |&lt;br /&gt;
int: identifier of created object|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var id = generator.AddBase(1, 100, 100, &amp;quot;Base01&amp;quot;, &amp;quot;Station Horizon&amp;quot;, {class: &amp;quot;order&amp;quot;});&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds space station to game world.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddItem|&lt;br /&gt;
* int: object_id&lt;br /&gt;
* string: item_xml_id&lt;br /&gt;
* int: quantity |&lt;br /&gt;
object:&lt;br /&gt;
* quantity - quantity was actually added&lt;br /&gt;
* type - can be &amp;quot;item&amp;quot; or &amp;quot;resource&amp;quot;|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var obj = generator.AddItem(1, &amp;quot;SomeItem&amp;quot;, 5);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds item to some object&#039;s inventory. In VoidExpanse not all objects do have inventory, so this function must be applied&lt;br /&gt;
only to those, which have it, such as ships, space stations, containers.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddItemToSpecifiedContainer|&lt;br /&gt;
* int: container_id&lt;br /&gt;
* string: item_xml_id&lt;br /&gt;
* int: quantity |&lt;br /&gt;
object:&lt;br /&gt;
* quantity - quantity was actually added&lt;br /&gt;
* type - can be &amp;quot;item&amp;quot; or &amp;quot;resource&amp;quot;|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var obj = generator.AddItemToSpecifiedContainer(1525, &amp;quot;SomeItem&amp;quot;, 5);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Important notice: container_id - is a special, unique in-game identifier for containers, which cannot be obtained by any way through API. Container id can only be obtained as a function parameter in events.&lt;br /&gt;
Currently used in OnInstancedContainerGeneration event. &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GenerateItemsWithItemlist|&lt;br /&gt;
* int: item_list_xml_id|&lt;br /&gt;
array of objects:&lt;br /&gt;
* quantity - quantity was actually added&lt;br /&gt;
* id - xml-id of item|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var items = generator.GenerateItemsWithItemlist(1, &amp;quot;SomeItem&amp;quot;, 5);&lt;br /&gt;
for(var i = 0; i &amp;lt; items.length; i++)&lt;br /&gt;
{&lt;br /&gt;
	generator.AddItemToSpecifiedContainer(&lt;br /&gt;
		args.container_id,&lt;br /&gt;
		items[i].id,&lt;br /&gt;
		items[i].quantity );&lt;br /&gt;
}&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Generates set of items with itemlist. After generation, items can be added to any container.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddContainer|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y&lt;br /&gt;
* string: xml_type&lt;br /&gt;
* string: droplist&lt;br /&gt;
* &#039;&#039;(optional) object: tags&#039;&#039; |&lt;br /&gt;
int: identifier of object created|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var id = generator.AddContainer(1, 0, 0, &amp;quot;Container01&amp;quot;, &amp;quot;DropList01&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds a floating container to game world. By default container is empty. Also containers, which has no contents, are unstable (self-destroyed as soon as&lt;br /&gt;
someone will look at it&#039;s contents), so it&#039;s better not to create empty containers. Content can be added with generator.AddItem function.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddDecoration|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* string: item_xml_id&lt;br /&gt;
* vector2: position&lt;br /&gt;
* double: depth&lt;br /&gt;
* vector2: rotation&lt;br /&gt;
* vector2: rotation_speed,&lt;br /&gt;
* double: scale |&lt;br /&gt;
int: ID of created object|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var id = generator.AddDecoration(1, &amp;quot;Decoration01&amp;quot;, {x:0,y:0}, 100, {x:5, y:5}, {x:5, y:5}, 2);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds a decoration to game world. Decoration is a non-interactive object, which is used as a... decoration.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddJumpgate|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* int: system_to&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y&lt;br /&gt;
* double: angle&lt;br /&gt;
* string: xml_type&lt;br /&gt;
* &#039;&#039;(optional) object: tags&#039;&#039;|&lt;br /&gt;
int: ID of created object|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var id = generator.AddJumpgate(1, 2, 100, 100, 20, &amp;quot;Jumpgate01&amp;quot;, {sometag: &amp;quot;sometag&amp;quot;});&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds a jumpgate - an object, which allows ships to travel between systems. Every jumpgate must be paired with another one,&lt;br /&gt;
for example, if in system A theres a jumpgate, that leads to system B, then in system B must be a jumpgate, that leads to system A.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddNPCShipToSystem|&lt;br /&gt;
* string: npc_name&lt;br /&gt;
* string: behavior - AI-script (&amp;quot;brains&amp;quot;)&lt;br /&gt;
* int: level&lt;br /&gt;
* string: xml_type - npc xml type&lt;br /&gt;
* int: system_id&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y&lt;br /&gt;
* &#039;&#039;(optional) object: tags&#039;&#039;|&lt;br /&gt;
int: ID of created object|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var id = generator.AddNPCShipToSystem(&amp;quot;Pirate&amp;quot;,&lt;br /&gt;
	&amp;quot;PirateAI&amp;quot;, 100, &amp;quot;PirateNpc01&amp;quot;,&lt;br /&gt;
	1, 105, 223, &lt;br /&gt;
	{class: &amp;quot;pirate&amp;quot;, uniq_id: &amp;quot;boss&amp;quot;});&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds an npc ship into game. NPC&#039;s avatar and faction are set through another functions - generator.SetNPCAvatar and relations.SetShipFaction&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|OverrideDropList|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* array: droplists - strings array of droplists|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.OverrideDropList(23303, [&amp;quot;DropList01&amp;quot;, &amp;quot;DropList02&amp;quot;]);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds specified droplists to npc&#039;s droplists list.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddPlanet|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y&lt;br /&gt;
* string: name&lt;br /&gt;
* int: seed |&lt;br /&gt;
int: ID of created object|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var id = generator.AddPlanet(1, 0, 0, &amp;quot;Earth&amp;quot;, 123);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds planet to game world. Planet&#039;s look is driven by seed, based on which planet&#039;s look will be defined&lt;br /&gt;
by random generator. If you want a particular planet, you should either use seed with defined results (by our tool - SeedGenerator), or use another function - AddPlanetWithType.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddPlanetWithType|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y&lt;br /&gt;
* string: name&lt;br /&gt;
* int: seed&lt;br /&gt;
* string: planet_config_type |&lt;br /&gt;
int: ID of created object|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var id = generator.AddPlanetWithType(1, 0, 0, &amp;quot;Earth&amp;quot;, 123, &amp;quot;EarthTypePlanet&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds planet to game world. Planet&#039;s look is driven partially be seed, but mostly by the specified type.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddSpaceObject|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y&lt;br /&gt;
* string: xml_type_id&lt;br /&gt;
* object: tags |&lt;br /&gt;
int: ID of created object|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var id = generator.AddSpaceObject(1, 0, 0, &amp;quot;Debris01&amp;quot;, {class: &amp;quot;mine&amp;quot;})&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds a space object to game world. Space objects are interactive object. They cannot be destroyed, but they are interactive and collision-enabled. For example, spacemines are created with space objects. &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddLever|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y&lt;br /&gt;
* string: xml_type_id&lt;br /&gt;
* int: visible_to&lt;br /&gt;
* object: tags |&lt;br /&gt;
int: ID of created object|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var id = generator.AddLever(1, 0, 0, &amp;quot;Debris01&amp;quot;, 0, {class: &amp;quot;mine&amp;quot;})&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds a lever object to world. Lever - is a special object, which can be activated. Parameter &amp;quot;visible_to&amp;quot; specifies, to whom lever is visible. If 0, it&#039;s visible to all, else - only to specified ship. Useful when you need to create a special object only to a man, who took the quest.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddStar|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y&lt;br /&gt;
* int: seed&lt;br /&gt;
* int: heat - how much damage star deals, when ship approaches&lt;br /&gt;
* &#039;&#039;(optional) string: typeID&#039;&#039;&lt;br /&gt;
|&lt;br /&gt;
int: ID of created object|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var id = generator.AddStar(1, 0, 0, 234, 0)&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds a star. Conventionally, you shouldn&#039;t add more then 1 star to a system.&lt;br /&gt;
If typeID is not specified, type will be picked by random, based on seed parameter.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddSystem|&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y&lt;br /&gt;
* string: name&lt;br /&gt;
* int: seed|&lt;br /&gt;
int: ID of created system|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var id = generator.AddSystem(0, 0, &amp;quot;Hawkins Eta&amp;quot;, 123)&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds a star system. Star system can be added anywhere, and by default it won&#039;t be connected to any other systems. See tutorial to see, how systems generation works.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetSystemTags|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* object: tags|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.SetSystemTags(1, {&amp;quot;show_clouds&amp;quot;: &amp;quot;yes&amp;quot;})&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets tags of specified star system. Can be expanded with generator.AddSystemTag and retrieved by&lt;br /&gt;
generator.GetSystemTags.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddSystemTag|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* string: name&lt;br /&gt;
* object: value|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.AddSystemTag(1, &amp;quot;show_clouds&amp;quot;, &amp;quot;yes&amp;quot;)&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds tag to star system tags (or overwrites existing one with the same name).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetSystemTags|&lt;br /&gt;
* int: system_id|&lt;br /&gt;
object: tags set by methods above|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var tags = generator.GetSystemTags(1);&lt;br /&gt;
if(tags != null &amp;amp;&amp;amp; tags[&amp;quot;show_clouds&amp;quot;] == &amp;quot;yes&amp;quot;)&lt;br /&gt;
{&lt;br /&gt;
	console.Print(&amp;quot;System 1 was told to show clouds&amp;quot;);&lt;br /&gt;
}&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Retrieves tags of star system, which were set by SetSystemTags and AddSystemTag.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddAnomaly|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* string: anomaly_id&lt;br /&gt;
* object: args |&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.AddAnomaly(args.sys_id, &amp;quot;radar_disable&amp;quot;, {});&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds anomaly to star system. There are few predefined anomalies (see more in the article [[VoidExpanse/anomalies|Anomalies]]), but you can specify and implement your own anomalies.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SystemClose|&lt;br /&gt;
* int: system_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.SystemClose(20);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets system status to closed. Can be used anywhere, has no hardcoded implementation. For example, now&lt;br /&gt;
it&#039;s being used to prevent player to travel to alien systems. System can be opened with generator.SystemOpen.&lt;br /&gt;
All systems are opened by default.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SystemOpen|&lt;br /&gt;
* int: system_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.SystemOpen(20);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets system status to opened. Can be used anywhere, has no hardcoded implementation. For example, now&lt;br /&gt;
it&#039;s being used to prevent player to travel to alien systems. System can be closed with generator.SystemClose.&lt;br /&gt;
All systems are opened by default.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|IsSystemClosed|&lt;br /&gt;
* int: system_id|&lt;br /&gt;
bool|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var closed = generator.IsSystemClosed(20);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Check whether system is closed or not.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|CountNpcInSystemByTags|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* object: tags|&lt;br /&gt;
int|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var numOfPirates= generator.CountNpcInSystemByTags(20, {class: &amp;quot;pirate&amp;quot;});&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Counts npcs with specified tags in specified system.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|ClearDropList|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.ClearDropList(20025);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Clears droplist of a specified NPC.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetSystemPlaylists|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* object: key-&amp;gt;value object|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.SetSystemPlaylists(args.sys_id,&lt;br /&gt;
				{&lt;br /&gt;
					&amp;quot;explore&amp;quot;: &amp;quot;playlist_generic_explore&amp;quot;,&lt;br /&gt;
					&amp;quot;combat&amp;quot;: &amp;quot;playlist_generic_combat&amp;quot;&lt;br /&gt;
				}&lt;br /&gt;
			);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets system music playlists. There are few possible keys, see more in [[VoidExpanse/MusicPlaylists|MusicPlaylists]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddSystemsLink|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* int: system_2_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.AddSystemsLink(1,2);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
This function creates a link between two systems. This links are simply logical, but there are&lt;br /&gt;
few hardcoded rules about them. There are some specific rules, that are applied to every link:&lt;br /&gt;
* Duplication - cannot create a link between already linked systems&lt;br /&gt;
* Future Linking - cannot create a link between systems, that aren&#039;t exist yet&lt;br /&gt;
* Proximity - link cannot pass closer then 2 units to a star&lt;br /&gt;
* Intersections - link cannot intersect any other link&lt;br /&gt;
Links created this way are displayed on galaxy map. By this links jumpgates are created (though, there is no hard rule about that - you can create jumpgate without link between two star systems, but this connection won&#039;t be displayed on galaxy map).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|FixConnectivity|&lt;br /&gt;
void|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.FixConnectivity();&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Should be called after all stars and links were created. It checks, if all stars are reachable from one another, and, if not, it creates missing star systems links.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|DockShipToBase|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* int: base_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.DockShipToBase(12253,2);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Immediately, without any animations, checkups and routines, docks ship to a space station. It&#039;s better not to use it on players, because it&#039;ll have unpredictable behavior.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|ExpandArea|&lt;br /&gt;
* array: array of stars IDs |&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var stars = [3];&lt;br /&gt;
while(true)&lt;br /&gt;
{&lt;br /&gt;
	stars = generator.ExpandArea(stars);&lt;br /&gt;
	if(newstars.length &amp;gt;= 10) break;&lt;br /&gt;
}&lt;br /&gt;
console.Print(&amp;quot;Now we have an area of 10 or more stars around star with id 3&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Function, which returns the same array, as input + all stars, which are linked to input ones by 1 link. In other words, it returns an area, expanded by 1 link. Very useful during generation of zones in galaxy, such as faction territories.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetAllSystems|&lt;br /&gt;
void|&lt;br /&gt;
array: IDs of all systems|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var arr = generator.GetAllSystems();&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetAsteroidTypes|&lt;br /&gt;
void|&lt;br /&gt;
array: xml_ids (strings) of all asteroids|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var arr = generator.GetAsteroidTypes();&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetClosestSystemToPoint|&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y|&lt;br /&gt;
int: ID of picked system of 0, if none|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var sys_id = generator.GetClosestSystemToPoint(0,0);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Useful during generation process.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetDebrisTypes|&lt;br /&gt;
void|&lt;br /&gt;
array: xml_ids (strings) of all space objects|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var arr = generator.GetDebrisTypes();&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Useful during generation process. Alias of generator.GetSpaceObjectsTypes.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetSpaceObjectsTypes|&lt;br /&gt;
void|&lt;br /&gt;
array: xml_ids (strings) of all space objects|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var arr = generator.GetSpaceObjectsTypes();&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Useful during generation process. The same as generator.GetDebrisTypes.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetIntersection|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y |&lt;br /&gt;
string: intersection in format &amp;quot;coord_x;coord_y&amp;quot; or empty string|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var intersection = generator.GetIntersection(0, 15, 15);&lt;br /&gt;
if(intersection.length &amp;gt; 0)&lt;br /&gt;
{&lt;br /&gt;
	var arr = intersection.split(&#039;;&#039;);&lt;br /&gt;
	console.Print(&amp;quot;Intersection was found: point X:&amp;quot; + arr[0] +&amp;quot;, Y:&amp;quot; + arr[1]);&lt;br /&gt;
}&amp;lt;/pre&amp;gt; |&lt;br /&gt;
The function answers the question: if a put a link between system with specified id and point with&lt;br /&gt;
coordinates coord_x;coord_y, will it intersect any other links? Useful during galaxy generation process.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetJumpsBetweenSystems|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* int: system_2_id|&lt;br /&gt;
int: number of jumps|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var jumps = generator.GetJumpsBetweenSystems(1,1000);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns length (number of links) of the minimal way between two systems.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetLinkedSystems|&lt;br /&gt;
* int: sys_id|&lt;br /&gt;
array: IDs of systems|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var arr = generator.GetLinkedSystems(1);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns an array with IDs of all systems linked to the specified one.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetRoute|&lt;br /&gt;
* int: sys_id_from&lt;br /&gt;
* int: sys_id_to|&lt;br /&gt;
array: IDs of systems|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var route = generator.GetRoute(1,5);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns an array with IDs of all systems, which makes the shortes route between two points.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetItemPrice|&lt;br /&gt;
* string: item|&lt;br /&gt;
int: price|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var price = generator.GetItemPrice(&amp;quot;object_alien_relic_01&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns a price of item by it&#039;s xml id.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetItemTitle|&lt;br /&gt;
* string: item|&lt;br /&gt;
string: title|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var title = generator.GetItemTitle(&amp;quot;object_alien_relic_01&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns a name of item by it&#039;s xml id.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetMinDistanceToSystem|&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y|&lt;br /&gt;
double: distance to the closest system (or maximum double value if none)|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var dist = generator.GetLinkedSystems(1);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Return distance to the closest system to a specified point.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetNumberOfLinks|&lt;br /&gt;
* int: system_id|&lt;br /&gt;
int: number of links to specified system|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var links = generator.GetNumberOfLinks(1);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetPlanetCoordinates|&lt;br /&gt;
* int: planet_id|&lt;br /&gt;
vector2: coordinates of a planet|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var coords = generator.GetPlanetCoordinates(242);&lt;br /&gt;
console.Print(&amp;quot;Planet coordinates: X:&amp;quot; + coords.x + &amp;quot;, Y:&amp;quot; + coords.y);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns coordinates of specified planet.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetRandomPlanetInSystem|&lt;br /&gt;
* int: system_id|&lt;br /&gt;
int: ID of a planet|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var id = generator.GetRandomPlanetInSystem(1);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns ID of random planet in system (or 0 if there are no planets).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetSystemPlanets|&lt;br /&gt;
* int: system_id|&lt;br /&gt;
array: IDs of planets|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var arr = generator.GetSystemPlanets(1);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns an array with IDs of all planets in system.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetSystemByID|&lt;br /&gt;
* int: system_id|&lt;br /&gt;
object:&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y&lt;br /&gt;
* int: seed&lt;br /&gt;
* string: faction&lt;br /&gt;
* int: danger_level&lt;br /&gt;
* int: tech_level&lt;br /&gt;
* string: name|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var obj = generator.GetSystemByID(1);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns basic info about specified system. Tags of star system can be gained with generator.GetSystemTags.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetBaseByID|&lt;br /&gt;
* int: base_id|&lt;br /&gt;
object:&lt;br /&gt;
* string: faction&lt;br /&gt;
* int: tech_level&lt;br /&gt;
* string: name&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var obj = generator.GetBaseByID(1);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns space station basic description. Tags cannot be retrieved with this function - use game.GetTags instead.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetSystemsByDistanceTo|&lt;br /&gt;
* int: system_id|&lt;br /&gt;
array: IDs of systems|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var arr = generator.GetSystemsByDistanceTo(1);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns an array with IDs of systems, which are sorted by distance to specified system. Specified system is included into resulting array.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetPopulatedSystems|&lt;br /&gt;
void|&lt;br /&gt;
array: IDs of systems|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var arr = generator.GetPopulatedSystems();&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns an array with IDs of systems in which there are currently players.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetAllResources|&lt;br /&gt;
void|&lt;br /&gt;
array: xml_ids (strings) of resources|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var arr = generator.GetAllResources();&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns an array of all resources of VoidExpanse.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetResourcesWithFlags|&lt;br /&gt;
* array of strings: flags|&lt;br /&gt;
array: xml_ids (strings) of resources|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var arr = generator.GetResourcesWithFlags([&amp;quot;mineable&amp;quot;, &amp;quot;highlevel&amp;quot;]);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns an array of resources of VoidExpanse, contains all specified flags in it&#039;s XML description.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetResourceByID|&lt;br /&gt;
* string: xml_id|&lt;br /&gt;
object:&lt;br /&gt;
* double: price - standard price of this item&lt;br /&gt;
* int: shops_level - level of shops in which this resource should be sold&lt;br /&gt;
* string: name - name of resource&lt;br /&gt;
* string: id - xml id of resource|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var obj = generator.GetResourceByID(&amp;quot;Resource01&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns a description of a resource by it&#039;s xml_id.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetItemByXmlID|&lt;br /&gt;
* string: xml_id|&lt;br /&gt;
object:&lt;br /&gt;
* double: price - standard price of this item&lt;br /&gt;
* int: shops_level - level of shops in which this resource should be sold&lt;br /&gt;
* string: name - name of resource&lt;br /&gt;
* string: id - xml id of resource|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var obj = generator.GetItemByXmlID(&amp;quot;Item01&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns a description of an item by it&#039;s xml_id.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RemoveAsteroid|&lt;br /&gt;
* int: asteroid_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.RemoveAsteroid(123);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes asteroid from a game world.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RemoveBase|&lt;br /&gt;
* int: base_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.RemoveBase(123);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes base (space station) from a game world.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RemoveDecoration|&lt;br /&gt;
* int: decoration_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.RemoveDecoration(123);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes decoration from a game world.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RemoveJumpgate|&lt;br /&gt;
* int: jumpgate_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.RemoveJumpgate(123);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes a jumpgate from a game world.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RemovePlanet|&lt;br /&gt;
* int: planet_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.RemovePlanet(123);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes a planet from a game world.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RemoveSpaceObject|&lt;br /&gt;
* int: space_object_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.RemoveSpaceObject(123);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes a space object from a game world.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RemoveLever|&lt;br /&gt;
* int: lever_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.RemoveLever(123);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes specified lever from a game world.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RemoveStar|&lt;br /&gt;
* int: star_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.RemoveStar(123);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes a star from a game world.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RemoveSystemsLink|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* int: system_2_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.RemoveSystemsLink(1,2);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes a link between two systems.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|ReportLoadingPhase|&lt;br /&gt;
* string: phase|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.ReportLoadingPhase(&amp;quot;Loading galaxy&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds message to singleplayer client with loader (then to alter loader use generator.ReportLoadingProgress).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|ReportLoadingPhaseNoLoader|&lt;br /&gt;
* string: phase|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.ReportLoadingPhaseNoLoader(&amp;quot;Loading galaxy&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds message to singleplayer client.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|ReportLoadingProgress|&lt;br /&gt;
* double: percent - a value from 0 to 1|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.ReportLoadingProgress(0.5);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds message to singleplayer client.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetNPCAvatar|&lt;br /&gt;
* int: npc_ship_id&lt;br /&gt;
* object: avatar parameters|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.SetNPCAvatar(12553, [1,2,3,4,5,6]);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets npc avatar.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetNPCAvatarImg|&lt;br /&gt;
* int: npc_ship_id&lt;br /&gt;
* string: path_to_image|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.SetNPCAvatarImg(id, &amp;quot;avatars/unique/terminal_01.png&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets npc avatar image instead of standart avatar system.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetSystemDangerLevel|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* int: danger_level - from 0 to 100|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.SetSystemDangerLevel(1, 99);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Set star system danger level. Danger level usually affects a level of system&#039;s npc and many other parameters.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetSystemTechLevel|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* int: tech_level - from 0 to 100|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.SetSystemTechLevel(1, 99);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Set star system tech level. Tech level usually affects shops store items.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|ShipExists|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
bool: whether ship exists or not|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.ShipExists(12552);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Damonwall</name></author>
	</entry>
	<entry>
		<id>https://wiki.atomictorch.com/index.php?title=VoidExpanse/scope-generator&amp;diff=213</id>
		<title>VoidExpanse/scope-generator</title>
		<link rel="alternate" type="text/html" href="https://wiki.atomictorch.com/index.php?title=VoidExpanse/scope-generator&amp;diff=213"/>
		<updated>2014-05-27T08:27:20Z</updated>

		<summary type="html">&lt;p&gt;Damonwall: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:VoidExpanse/api_scopes]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Scope generator =&lt;br /&gt;
Used for generation items, objects, systems in game, and also for getting some specific info about them.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Visibility:&#039;&#039;&#039; Global.&lt;br /&gt;
&lt;br /&gt;
== List of functions ==&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddAsteroid|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y&lt;br /&gt;
* string: type - xml id of asteroid&lt;br /&gt;
* double: scale&lt;br /&gt;
* double: resQ - resouces modifier&lt;br /&gt;
* object: rotation&lt;br /&gt;
* object: rotationSpeed |&lt;br /&gt;
int: identifier of created object|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var id = generator.AddAsteroid(1,100,100,&amp;quot;Asteroid01&amp;quot;,1, 0, {x:0,y:0,z:0}, {x:0,y:0,z:0});&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds asteroid with specified parameters into game world. Asteroid contents (extractable resources), asteroid&#039;s look and other parameters&lt;br /&gt;
can be modified only in .xml file, which is specified in this function by parameter &amp;quot;type&amp;quot;. &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddBase|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y&lt;br /&gt;
* string: type - xml id of base&lt;br /&gt;
* string: name&lt;br /&gt;
* &#039;&#039;(optional) object: tags&#039;&#039; |&lt;br /&gt;
int: identifier of created object|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var id = generator.AddBase(1, 100, 100, &amp;quot;Base01&amp;quot;, &amp;quot;Station Horizon&amp;quot;, {class: &amp;quot;order&amp;quot;});&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds space station to game world.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddItem|&lt;br /&gt;
* int: object_id&lt;br /&gt;
* string: item_xml_id&lt;br /&gt;
* int: quantity |&lt;br /&gt;
object:&lt;br /&gt;
* quantity - quantity was actually added&lt;br /&gt;
* type - can be &amp;quot;item&amp;quot; or &amp;quot;resource&amp;quot;|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var obj = generator.AddItem(1, &amp;quot;SomeItem&amp;quot;, 5);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds item to some object&#039;s inventory. In VoidExpanse not all objects do have inventory, so this function must be applied&lt;br /&gt;
only to those, which have it, such as ships, space stations, containers.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddItemToSpecifiedContainer|&lt;br /&gt;
* int: container_id&lt;br /&gt;
* string: item_xml_id&lt;br /&gt;
* int: quantity |&lt;br /&gt;
object:&lt;br /&gt;
* quantity - quantity was actually added&lt;br /&gt;
* type - can be &amp;quot;item&amp;quot; or &amp;quot;resource&amp;quot;|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var obj = generator.AddItemToSpecifiedContainer(1525, &amp;quot;SomeItem&amp;quot;, 5);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Important notice: container_id - is a special, unique in-game identifier for containers, which cannot be obtained by any way through API. Container id can only be obtained as a function parameter in events.&lt;br /&gt;
Currently used in OnInstancedContainerGeneration event. &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GenerateItemsWithItemlist|&lt;br /&gt;
* int: item_list_xml_id|&lt;br /&gt;
array of objects:&lt;br /&gt;
* quantity - quantity was actually added&lt;br /&gt;
* id - xml-id of item|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var items = generator.GenerateItemsWithItemlist(1, &amp;quot;SomeItem&amp;quot;, 5);&lt;br /&gt;
for(var i = 0; i &amp;lt; items.length; i++)&lt;br /&gt;
{&lt;br /&gt;
	generator.AddItemToSpecifiedContainer(&lt;br /&gt;
		args.container_id,&lt;br /&gt;
		items[i].id,&lt;br /&gt;
		items[i].quantity );&lt;br /&gt;
}&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Generates set of items with itemlist. After generation, items can be added to any container.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddContainer|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y&lt;br /&gt;
* string: xml_type&lt;br /&gt;
* string: droplist&lt;br /&gt;
* &#039;&#039;(optional) object: tags&#039;&#039; |&lt;br /&gt;
int: identifier of object created|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var id = generator.AddContainer(1, 0, 0, &amp;quot;Container01&amp;quot;, &amp;quot;DropList01&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds a floating container to game world. By default container is empty. Also containers, which has no contents, are unstable (self-destroyed as soon as&lt;br /&gt;
someone will look at it&#039;s contents), so it&#039;s better not to create empty containers. Content can be added with generator.AddItem function.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddDecoration|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* string: item_xml_id&lt;br /&gt;
* vector2: position&lt;br /&gt;
* double: depth&lt;br /&gt;
* vector2: rotation&lt;br /&gt;
* vector2: rotation_speed,&lt;br /&gt;
* double: scale |&lt;br /&gt;
int: ID of created object|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var id = generator.AddDecoration(1, &amp;quot;Decoration01&amp;quot;, {x:0,y:0}, 100, {x:5, y:5}, {x:5, y:5}, 2);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds a decoration to game world. Decoration is a non-interactive object, which is used as a... decoration.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddJumpgate|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* int: system_to&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y&lt;br /&gt;
* double: angle&lt;br /&gt;
* string: xml_type&lt;br /&gt;
* &#039;&#039;(optional) object: tags&#039;&#039;|&lt;br /&gt;
int: ID of created object|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var id = generator.AddJumpgate(1, 2, 100, 100, 20, &amp;quot;Jumpgate01&amp;quot;, {sometag: &amp;quot;sometag&amp;quot;});&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds a jumpgate - an object, which allows ships to travel between systems. Every jumpgate must be paired with another one,&lt;br /&gt;
for example, if in system A theres a jumpgate, that leads to system B, then in system B must be a jumpgate, that leads to system A.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddNPCShipToSystem|&lt;br /&gt;
* string: npc_name&lt;br /&gt;
* string: behavior - AI-script (&amp;quot;brains&amp;quot;)&lt;br /&gt;
* int: level&lt;br /&gt;
* string: xml_type - npc xml type&lt;br /&gt;
* int: system_id&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y&lt;br /&gt;
* &#039;&#039;(optional) object: tags&#039;&#039;|&lt;br /&gt;
int: ID of created object|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var id = generator.AddNPCShipToSystem(&amp;quot;Pirate&amp;quot;,&lt;br /&gt;
	&amp;quot;PirateAI&amp;quot;, 100, &amp;quot;PirateNpc01&amp;quot;,&lt;br /&gt;
	1, 105, 223, &lt;br /&gt;
	{class: &amp;quot;pirate&amp;quot;, uniq_id: &amp;quot;boss&amp;quot;});&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds an npc ship into game. NPC&#039;s avatar and faction are set through another functions - generator.SetNPCAvatar and relations.SetShipFaction&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|OverrideDropList|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* array: droplists - strings array of droplists|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.OverrideDropList(23303, [&amp;quot;DropList01&amp;quot;, &amp;quot;DropList02&amp;quot;]);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds specified droplists to npc&#039;s droplists list.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddPlanet|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y&lt;br /&gt;
* string: name&lt;br /&gt;
* int: seed |&lt;br /&gt;
int: ID of created object|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var id = generator.AddPlanet(1, 0, 0, &amp;quot;Earth&amp;quot;, 123);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds planet to game world. Planet&#039;s look is driven by seed, based on which planet&#039;s look will be defined&lt;br /&gt;
by random generator. If you want a particular planet, you should either use seed with defined results (by our tool - SeedGenerator), or use another function - AddPlanetWithType.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddPlanetWithType|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y&lt;br /&gt;
* string: name&lt;br /&gt;
* int: seed&lt;br /&gt;
* string: planet_config_type |&lt;br /&gt;
int: ID of created object|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var id = generator.AddPlanetWithType(1, 0, 0, &amp;quot;Earth&amp;quot;, 123, &amp;quot;EarthTypePlanet&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds planet to game world. Planet&#039;s look is driven partially be seed, but mostly by the specified type.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddSpaceObject|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y&lt;br /&gt;
* string: xml_type_id&lt;br /&gt;
* object: tags |&lt;br /&gt;
int: ID of created object|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var id = generator.AddSpaceObject(1, 0, 0, &amp;quot;Debris01&amp;quot;, {class: &amp;quot;mine&amp;quot;})&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds a space object to game world. Space objects are interactive object. They cannot be destroyed, but they are interactive and collision-enabled. For example, spacemines are created with space objects. &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddLever|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y&lt;br /&gt;
* string: xml_type_id&lt;br /&gt;
* int: visible_to&lt;br /&gt;
* object: tags |&lt;br /&gt;
int: ID of created object|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var id = generator.AddLever(1, 0, 0, &amp;quot;Debris01&amp;quot;, 0, {class: &amp;quot;mine&amp;quot;})&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds a lever object to world. Lever - is a special object, which can be activated. Parameter &amp;quot;visible_to&amp;quot; specifies, to whom lever is visible. If 0, it&#039;s visible to all, else - only to specified ship. Useful when you need to create a special object only to a man, who took the quest.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddStar|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y&lt;br /&gt;
* int: seed&lt;br /&gt;
* int: heat - how much damage star deals, when ship approaches&lt;br /&gt;
* &#039;&#039;(optional) string: typeID&#039;&#039;&lt;br /&gt;
|&lt;br /&gt;
int: ID of created object|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var id = generator.AddStar(1, 0, 0, 234, 0)&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds a star. Conventionally, you shouldn&#039;t add more then 1 star to a system.&lt;br /&gt;
If typeID is not specified, type will be picked by random, based on seed parameter.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddSystem|&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y&lt;br /&gt;
* string: name&lt;br /&gt;
* int: seed|&lt;br /&gt;
int: ID of created system|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var id = generator.AddSystem(0, 0, &amp;quot;Hawkins Eta&amp;quot;, 123)&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds a star system. Star system can be added anywhere, and by default it won&#039;t be connected to any other systems. See tutorial to see, how systems generation works.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetSystemTags|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* object: tags|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.SetSystemTags(1, {&amp;quot;show_clouds&amp;quot;: &amp;quot;yes&amp;quot;})&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets tags of specified star system. Can be expanded with generator.AddSystemTag and retrieved by&lt;br /&gt;
generator.GetSystemTags.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddSystemTag|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* string: name&lt;br /&gt;
* object: value|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.AddSystemTag(1, &amp;quot;show_clouds&amp;quot;, &amp;quot;yes&amp;quot;)&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds tag to star system tags (or overwrites existing one with the same name).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetSystemTags|&lt;br /&gt;
* int: system_id|&lt;br /&gt;
object: tags set by methods above|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var tags = generator.GetSystemTags(1);&lt;br /&gt;
if(tags != null &amp;amp;&amp;amp; tags[&amp;quot;show_clouds&amp;quot;] == &amp;quot;yes&amp;quot;)&lt;br /&gt;
{&lt;br /&gt;
	console.Print(&amp;quot;System 1 was told to show clouds&amp;quot;);&lt;br /&gt;
}&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Retrieves tags of star system, which were set by SetSystemTags and AddSystemTag.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddAnomaly|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* string: anomaly_id&lt;br /&gt;
* object: args |&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.AddAnomaly(args.sys_id, &amp;quot;radar_disable&amp;quot;, {});&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds anomaly to star system. There are few predefined anomalies (see more in the article [[VoidExpanse/anomalies|Anomalies]]), but you can specify and implement your own anomalies.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SystemClose|&lt;br /&gt;
* int: system_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.SystemClose(20);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets system status to closed. Can be used anywhere, has no hardcoded implementation. For example, now&lt;br /&gt;
it&#039;s being used to prevent player to travel to alien systems. System can be opened with generator.SystemOpen.&lt;br /&gt;
All systems are opened by default.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SystemOpen|&lt;br /&gt;
* int: system_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.SystemOpen(20);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets system status to opened. Can be used anywhere, has no hardcoded implementation. For example, now&lt;br /&gt;
it&#039;s being used to prevent player to travel to alien systems. System can be closed with generator.SystemClose.&lt;br /&gt;
All systems are opened by default.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|IsSystemClosed|&lt;br /&gt;
* int: system_id|&lt;br /&gt;
bool|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var closed = generator.IsSystemClosed(20);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Check whether system is closed or not.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|CountNpcInSystemByTags|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* object: tags|&lt;br /&gt;
int|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var numOfPirates= generator.CountNpcInSystemByTags(20, {class: &amp;quot;pirate&amp;quot;});&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Counts npcs with specified tags in specified system.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|ClearDropList|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.ClearDropList(20025);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Clears droplist of a specified NPC.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetSystemPlaylists|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* object: key-&amp;gt;value object|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.SetSystemPlaylists(args.sys_id,&lt;br /&gt;
				{&lt;br /&gt;
					&amp;quot;explore&amp;quot;: &amp;quot;playlist_generic_explore&amp;quot;,&lt;br /&gt;
					&amp;quot;combat&amp;quot;: &amp;quot;playlist_generic_combat&amp;quot;&lt;br /&gt;
				}&lt;br /&gt;
			);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets system music playlists. There are few possible keys, see more in [[VoidExpanse/MusicPlaylists|MusicPlaylists]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddSystemsLink|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* int: system_2_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.AddSystemsLink(1,2);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
This function creates a link between two systems. This links are simply logical, but there are&lt;br /&gt;
few hardcoded rules about them. There are some specific rules, that are applied to every link:&lt;br /&gt;
* Duplication - cannot create a link between already linked systems&lt;br /&gt;
* Future Linking - cannot create a link between systems, that aren&#039;t exist yet&lt;br /&gt;
* Proximity - link cannot pass closer then 2 units to a star&lt;br /&gt;
* Intersections - link cannot intersect any other link&lt;br /&gt;
Links created this way are displayed on galaxy map. By this links jumpgates are created (though, there is no hard rule about that - you can create jumpgate without link between two star systems, but this connection won&#039;t be displayed on galaxy map).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|FixConnectivity|&lt;br /&gt;
void|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.FixConnectivity();&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Should be called after all stars and links were created. It checks, if all stars are reachable from one another, and, if not, it creates missing star systems links.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|DockShipToBase|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* int: base_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.DockShipToBase(12253,2);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Immediately, without any animations, checkups and routines, docks ship to a space station. It&#039;s better not to use it on players, because it&#039;ll have unpredictable behavior.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|ExpandArea|&lt;br /&gt;
* array: array of stars IDs |&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var stars = [3];&lt;br /&gt;
while(true)&lt;br /&gt;
{&lt;br /&gt;
	stars = generator.ExpandArea(stars);&lt;br /&gt;
	if(newstars.length &amp;gt;= 10) break;&lt;br /&gt;
}&lt;br /&gt;
console.Print(&amp;quot;Now we have an area of 10 or more stars around star with id 3&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Function, which returns the same array, as input + all stars, which are linked to input ones by 1 link. In other words, it returns an area, expanded by 1 link. Very useful during generation of zones in galaxy, such as faction territories.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetAllSystems|&lt;br /&gt;
void|&lt;br /&gt;
array: IDs of all systems|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var arr = generator.GetAllSystems();&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetAsteroidTypes|&lt;br /&gt;
void|&lt;br /&gt;
array: xml_ids (strings) of all asteroids|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var arr = generator.GetAsteroidTypes();&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetClosestSystemToPoint|&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y|&lt;br /&gt;
int: ID of picked system of 0, if none|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var sys_id = generator.GetClosestSystemToPoint(0,0);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Useful during generation process.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetDebrisTypes|&lt;br /&gt;
void|&lt;br /&gt;
array: xml_ids (strings) of all space objects|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var arr = generator.GetDebrisTypes();&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Useful during generation process. Alias of generator.GetSpaceObjectsTypes.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetSpaceObjectsTypes|&lt;br /&gt;
void|&lt;br /&gt;
array: xml_ids (strings) of all space objects|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var arr = generator.GetSpaceObjectsTypes();&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Useful during generation process. The same as generator.GetDebrisTypes.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetIntersection|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y |&lt;br /&gt;
string: intersection in format &amp;quot;coord_x;coord_y&amp;quot; or empty string|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var intersection = generator.GetIntersection(0, 15, 15);&lt;br /&gt;
if(intersection.length &amp;gt; 0)&lt;br /&gt;
{&lt;br /&gt;
	var arr = intersection.split(&#039;;&#039;);&lt;br /&gt;
	console.Print(&amp;quot;Intersection was found: point X:&amp;quot; + arr[0] +&amp;quot;, Y:&amp;quot; + arr[1]);&lt;br /&gt;
}&amp;lt;/pre&amp;gt; |&lt;br /&gt;
The function answers the question: if a put a link between system with specified id and point with&lt;br /&gt;
coordinates coord_x;coord_y, will it intersect any other links? Useful during galaxy generation process.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetJumpsBetweenSystems|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* int: system_2_id|&lt;br /&gt;
int: number of jumps|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var jumps = generator.GetJumpsBetweenSystems(1,1000);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns length (number of links) of the minimal way between two systems.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetLinkedSystems|&lt;br /&gt;
* int: sys_id|&lt;br /&gt;
array: IDs of systems|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var arr = generator.GetLinkedSystems(1);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns an array with IDs of all systems linked to the specified one.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetMinDistanceToSystem|&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y|&lt;br /&gt;
double: distance to the closest system (or maximum double value if none)|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var dist = generator.GetLinkedSystems(1);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Return distance to the closest system to a specified point.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetNumberOfLinks|&lt;br /&gt;
* int: system_id|&lt;br /&gt;
int: number of links to specified system|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var links = generator.GetNumberOfLinks(1);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetPlanetCoordinates|&lt;br /&gt;
* int: planet_id|&lt;br /&gt;
vector2: coordinates of a planet|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var coords = generator.GetPlanetCoordinates(242);&lt;br /&gt;
console.Print(&amp;quot;Planet coordinates: X:&amp;quot; + coords.x + &amp;quot;, Y:&amp;quot; + coords.y);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns coordinates of specified planet.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetRandomPlanetInSystem|&lt;br /&gt;
* int: system_id|&lt;br /&gt;
int: ID of a planet|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var id = generator.GetRandomPlanetInSystem(1);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns ID of random planet in system (or 0 if there are no planets).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetSystemPlanets|&lt;br /&gt;
* int: system_id|&lt;br /&gt;
array: IDs of planets|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var arr = generator.GetSystemPlanets(1);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns an array with IDs of all planets in system.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetSystemByID|&lt;br /&gt;
* int: system_id|&lt;br /&gt;
object:&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y&lt;br /&gt;
* int: seed&lt;br /&gt;
* string: faction&lt;br /&gt;
* int: danger_level&lt;br /&gt;
* int: tech_level&lt;br /&gt;
* string: name|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var obj = generator.GetSystemByID(1);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns basic info about specified system. Tags of star system can be gained with generator.GetSystemTags.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetBaseByID|&lt;br /&gt;
* int: base_id|&lt;br /&gt;
object:&lt;br /&gt;
* string: faction&lt;br /&gt;
* int: tech_level&lt;br /&gt;
* string: name&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var obj = generator.GetBaseByID(1);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns space station basic description. Tags cannot be retrieved with this function - use game.GetTags instead.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetSystemsByDistanceTo|&lt;br /&gt;
* int: system_id|&lt;br /&gt;
array: IDs of systems|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var arr = generator.GetSystemsByDistanceTo(1);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns an array with IDs of systems, which are sorted by distance to specified system. Specified system is included into resulting array.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetPopulatedSystems|&lt;br /&gt;
void|&lt;br /&gt;
array: IDs of systems|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var arr = generator.GetPopulatedSystems();&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns an array with IDs of systems in which there are currently players.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetAllResources|&lt;br /&gt;
void|&lt;br /&gt;
array: xml_ids (strings) of resources|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var arr = generator.GetAllResources();&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns an array of all resources of VoidExpanse.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetResourcesWithFlags|&lt;br /&gt;
* array of strings: flags|&lt;br /&gt;
array: xml_ids (strings) of resources|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var arr = generator.GetResourcesWithFlags([&amp;quot;mineable&amp;quot;, &amp;quot;highlevel&amp;quot;]);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns an array of resources of VoidExpanse, contains all specified flags in it&#039;s XML description.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetResourceByID|&lt;br /&gt;
* string: xml_id|&lt;br /&gt;
object:&lt;br /&gt;
* double: price - standard price of this item&lt;br /&gt;
* int: shops_level - level of shops in which this resource should be sold&lt;br /&gt;
* string: name - name of resource&lt;br /&gt;
* string: id - xml id of resource|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var obj = generator.GetResourceByID(&amp;quot;Resource01&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns a description of a resource by it&#039;s xml_id.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetItemByXmlID|&lt;br /&gt;
* string: xml_id|&lt;br /&gt;
object:&lt;br /&gt;
* double: price - standard price of this item&lt;br /&gt;
* int: shops_level - level of shops in which this resource should be sold&lt;br /&gt;
* string: name - name of resource&lt;br /&gt;
* string: id - xml id of resource|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var obj = generator.GetItemByXmlID(&amp;quot;Item01&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns a description of an item by it&#039;s xml_id.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RemoveAsteroid|&lt;br /&gt;
* int: asteroid_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.RemoveAsteroid(123);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes asteroid from a game world.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RemoveBase|&lt;br /&gt;
* int: base_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.RemoveBase(123);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes base (space station) from a game world.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RemoveDecoration|&lt;br /&gt;
* int: decoration_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.RemoveDecoration(123);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes decoration from a game world.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RemoveJumpgate|&lt;br /&gt;
* int: jumpgate_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.RemoveJumpgate(123);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes a jumpgate from a game world.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RemovePlanet|&lt;br /&gt;
* int: planet_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.RemovePlanet(123);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes a planet from a game world.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RemoveSpaceObject|&lt;br /&gt;
* int: space_object_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.RemoveSpaceObject(123);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes a space object from a game world.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RemoveLever|&lt;br /&gt;
* int: lever_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.RemoveLever(123);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes specified lever from a game world.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RemoveStar|&lt;br /&gt;
* int: star_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.RemoveStar(123);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes a star from a game world.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RemoveSystemsLink|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* int: system_2_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.RemoveSystemsLink(1,2);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes a link between two systems.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|ReportLoadingPhase|&lt;br /&gt;
* string: phase|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.ReportLoadingPhase(&amp;quot;Loading galaxy&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds message to singleplayer client with loader (then to alter loader use generator.ReportLoadingProgress).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|ReportLoadingPhaseNoLoader|&lt;br /&gt;
* string: phase|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.ReportLoadingPhaseNoLoader(&amp;quot;Loading galaxy&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds message to singleplayer client.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|ReportLoadingProgress|&lt;br /&gt;
* double: percent - a value from 0 to 1|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.ReportLoadingProgress(0.5);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds message to singleplayer client.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetNPCAvatar|&lt;br /&gt;
* int: npc_ship_id&lt;br /&gt;
* object: avatar parameters|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.SetNPCAvatar(12553, [1,2,3,4,5,6]);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets npc avatar.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetNPCAvatarImg|&lt;br /&gt;
* int: npc_ship_id&lt;br /&gt;
* string: path_to_image|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.SetNPCAvatarImg(id, &amp;quot;avatars/unique/terminal_01.png&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets npc avatar image instead of standart avatar system.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetSystemDangerLevel|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* int: danger_level - from 0 to 100|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.SetSystemDangerLevel(1, 99);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Set star system danger level. Danger level usually affects a level of system&#039;s npc and many other parameters.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetSystemTechLevel|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* int: tech_level - from 0 to 100|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.SetSystemTechLevel(1, 99);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Set star system tech level. Tech level usually affects shops store items.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|ShipExists|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
bool: whether ship exists or not|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.ShipExists(12552);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Damonwall</name></author>
	</entry>
	<entry>
		<id>https://wiki.atomictorch.com/index.php?title=VoidExpanse/scope-npc&amp;diff=212</id>
		<title>VoidExpanse/scope-npc</title>
		<link rel="alternate" type="text/html" href="https://wiki.atomictorch.com/index.php?title=VoidExpanse/scope-npc&amp;diff=212"/>
		<updated>2014-05-27T08:24:54Z</updated>

		<summary type="html">&lt;p&gt;Damonwall: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:VoidExpanse/api_scopes]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Scope npc =&lt;br /&gt;
Manages NPC bahavior, interactions and parameters.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Visibility:&#039;&#039;&#039; Global.&lt;br /&gt;
&lt;br /&gt;
== List of functions ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Objectives ==&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|CountObjectives|&lt;br /&gt;
* int: npc_ship_id |&lt;br /&gt;
int: current number of objectives|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var obj = npc.CountObjectives(25334);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddObjective|&lt;br /&gt;
* int: npc_ship_id&lt;br /&gt;
* string: name&lt;br /&gt;
* &#039;&#039;(optional) object: parameters&#039;&#039; |&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;npc.AddObjective(25334, &amp;quot;go_to_jumpgate&amp;quot;, {jumpgate_id: 15});&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds new objective to npc. All objectives must be implemented in npc&#039;s behavior script.&lt;br /&gt;
NOTE: in object parameters there shouldn&#039;t be parameters &amp;quot;name&amp;quot; - it will be overriden by name of objective.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|CleanObjectives|&lt;br /&gt;
* int: npc_ship_id |&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;npc.CleanObjectives(25334);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes all objectives from npc ship.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|NextObjective|&lt;br /&gt;
* int: npc_ship_id |&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;npc.NextObjective(25334);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Moves current objective pointer to next position, removes previous objective.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetCurrentObjective|&lt;br /&gt;
* int: npc_ship_id |&lt;br /&gt;
object:&lt;br /&gt;
* string: name - name of objective, specified in AddObjective&lt;br /&gt;
* string: key - value - other parameters, specified in AddObjective|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var objective = npc.GetCurrentObjective(25334);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Gets current npc&#039;s objective (or null if none)&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetCurrentObjectiveTimer|&lt;br /&gt;
* int: npc_ship_id |&lt;br /&gt;
double: time - how long npc is doing his current objective|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var time = npc.GetCurrentObjectiveTimer(25334);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== NODES ==&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddNode|&lt;br /&gt;
* int: npc_ship_id&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;npc.AddNode(25334, 100, 100);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds a node to npc. NPC can use nodes for patrolling, or for any other reason.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|ClearNodes|&lt;br /&gt;
* int: npc_ship_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;npc.ClearNodes(25334);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes all nodes from npc.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetDistanceToNode|&lt;br /&gt;
* int: npc_ship_id&lt;br /&gt;
* int: node_id - number of node|&lt;br /&gt;
double: distance_to_node|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var dist = npc.GetDistanceToNode(25334, 1);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetNodes|&lt;br /&gt;
* int: npc_ship_id|&lt;br /&gt;
array of objects:&lt;br /&gt;
* double: CoordX&lt;br /&gt;
* double: CoordY|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var nodes = npc.GetNodes(25334);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RemoveNode|&lt;br /&gt;
* int: npc_ship_id&lt;br /&gt;
* int: node_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;npc.RemoveNode(25334, 1);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes node from npc nodes.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|FollowRouteToObject|&lt;br /&gt;
* int: npc_ship_id&lt;br /&gt;
* int: object_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;npc.FollowRouteToObject(25334, 2535);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Creates route to object and follow it.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|FollowRouteToBase|&lt;br /&gt;
* int: npc_ship_id&lt;br /&gt;
* int: base_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;npc.FollowRouteToBase(25334, 2535);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Creates route to base and follow it.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|StopFollowingRoute|&lt;br /&gt;
* int: npc_ship_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;npc.StopFollowingRoute(25334);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Stops following current route.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|IsNodeReached|&lt;br /&gt;
* int: npc_ship_id&lt;br /&gt;
* int: is_node_reached|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var res = npc.IsNodeReached(25334, 0);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Checks if node is reached.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Battle ==&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|Fire|&lt;br /&gt;
* int: npc_ship_id&lt;br /&gt;
* int: slot|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;npc.Fire(25334, 0);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Fires from specified slot.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetWeaponUsage|&lt;br /&gt;
* int: npc_ship_id&lt;br /&gt;
* string: projectile_type - &amp;quot;Ray&amp;quot;,&amp;quot;DirectHit&amp;quot;,&amp;quot;BulletOrMissile&amp;quot;&lt;br /&gt;
* double: min_dist&lt;br /&gt;
* double: max_dist&lt;br /&gt;
* double: delay|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;npc.SetWeaponUsage(25334, &amp;quot;Ray&amp;quot;, 2,10, 200);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets weapon usage. It means npc will try to shoot with it&#039;s weapons of specified type&lt;br /&gt;
only on specified distance and will make specified delays between shots.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Movement ==&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|CapSpeed|&lt;br /&gt;
* int: npc_ship_id&lt;br /&gt;
* double: value|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;npc.CapSpeed(25334, 2);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Caps npc&#039;s ship speed.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|FaceFromObj|&lt;br /&gt;
* int: npc_ship_id&lt;br /&gt;
* int: object_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;npc.FaceFromObj(25334, 235);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
NPC faces from object.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|FaceObj|&lt;br /&gt;
* int: npc_ship_id&lt;br /&gt;
* int: object_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;npc.FaceObj(25334, 235);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
NPC faces to object.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|FaceStickPoint|&lt;br /&gt;
* int: npc_ship_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;npc.FaceStickPoint(25334, 235);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
NPC faces current stick point.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|FaceCoord|&lt;br /&gt;
* int: npc_ship_id&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;npc.v(25334, 100, 105);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
NPC faces specified coordinates.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GoBackward|&lt;br /&gt;
* int: npc_ship_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;npc.GoBackward(25334);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GoForward|&lt;br /&gt;
* int: npc_ship_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;npc.GoForward(25334);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RotLeft|&lt;br /&gt;
* int: npc_ship_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;npc.RotLeft(25334);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RotRight|&lt;br /&gt;
* int: npc_ship_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;npc.RotRight(25334);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|Stop|&lt;br /&gt;
* int: npc_ship_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;npc.Stop(25334);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|InstantStop|&lt;br /&gt;
* int: npc_ship_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;npc.InstantStop(25334);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|StrafeLeft|&lt;br /&gt;
* int: npc_ship_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;npc.StrafeLeft(25334);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|StrafeRight|&lt;br /&gt;
* int: npc_ship_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;npc.StrafeRight(25334);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|StopEvasion|&lt;br /&gt;
* int: npc_ship_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;npc.StopEvasion(25334);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Turns evasion mode off. Evasion mode is the mode, when npc can avoid attacks with rockets and ballistics by strafing.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|StartEvasion|&lt;br /&gt;
* int: npc_ship_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;npc.StartEvasion(25334);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Turns evasion mode on. Evasion mode is the mode, when npc can avoid attacks with rockets and ballistics by strafing.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Locks ==&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|FriendlyLockOnTarget|&lt;br /&gt;
* int: npc_ship_id&lt;br /&gt;
* int: target_id&lt;br /&gt;
* double: get_away_dist|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;npc.FriendlyLockOnTarget(25334, 16);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Friendly lock is a type of lock, when npc facing it&#039;s target, but do not attack.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetLockTarget|&lt;br /&gt;
* int: npc_ship_id|&lt;br /&gt;
int: lock target object ID|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var lockTarget = npc.GetLockTarget(25334);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Gets current target, on which npc is locked.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetStickObject|&lt;br /&gt;
* int: npc_ship_id|&lt;br /&gt;
int: object_id - current stick object id|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var stickObject = npc.GetStickObject(25334);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Get current stick object.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetFriendlyLockTarget|&lt;br /&gt;
* int: npc_ship_id|&lt;br /&gt;
int: object_id - current friendly lock target|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var lockTarget = npc.GetFriendlyLockTarget(25334);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Get current lock target&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|IsFriendlyLocked|&lt;br /&gt;
* int: npc_ship_id|&lt;br /&gt;
bool: is npc friendly locked|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var is_locked = npc.IsFriendlyLocked(25334);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns whether npc is friendly locked.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|IsLocked|&lt;br /&gt;
* int: npc_ship_id|&lt;br /&gt;
bool: is npc locked on target|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var is_locked = npc.IsLocked(25334);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns whether npc is locked on target.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|Unlock|&lt;br /&gt;
* int: npc_ship_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;npc.Unlock(25334);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Unlocks from target or frienly lock target.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|IsStickToPoint|&lt;br /&gt;
* int: npc_ship_id|&lt;br /&gt;
bool: is_sticked - whether npc is sticked to point|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var res = npc.IsStickToPoint(25334);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|IsStickToObject|&lt;br /&gt;
* int: npc_ship_id|&lt;br /&gt;
bool: is_sticked - whether npc is sticked to point|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var res = npc.IsStickToObject(25334);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetDistanceToStickPoint|&lt;br /&gt;
* int: npc_ship_id|&lt;br /&gt;
double: distance|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var distance = npc.GetDistanceToStickPoint(25334);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns distance to current stick point.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetDistanceToStickObject|&lt;br /&gt;
* int: npc_ship_id|&lt;br /&gt;
double: distance|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var distance = npc.GetDistanceToStickObject(25334);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns distance to current stick object.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|LockOnTarget|&lt;br /&gt;
* int: npc_ship_id&lt;br /&gt;
* int: target_id&lt;br /&gt;
* double: get_away_dist|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;npc.LockOnTarget(25334, 25343, 20);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Locks on target. Npc will automatically unlock, when distance to target object will be more then get_away_dist.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|StickToObject|&lt;br /&gt;
* int: npc_ship_id&lt;br /&gt;
* int: target_object&lt;br /&gt;
* &#039;&#039;(optional) double: get_away_dist&#039;&#039;|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;npc.StickToObject(25334, 24000, 20);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sticks NPC to object. Npc will try to approach sticked object. Will automatically unstick, when distance to object will exceed get_away_dist parameter.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|StickToPoint|&lt;br /&gt;
* int: npc_ship_id&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y&lt;br /&gt;
* double: get_back_distance|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;npc.StickToPoint(25334, 100, 100, 20);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
NPC sticks to specified point. If NPC goes further then get_back_distance, npc will try to get back to stick point.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|Unstick|&lt;br /&gt;
* int: npc_ship_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;npc.Unstick(25334);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Unsticks NPC from point or object.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetLockedTime|&lt;br /&gt;
* int: npc_ship_id|&lt;br /&gt;
double: locked_time|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var time = npc.GetLockedTime(25334);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns time, during which NPC is locked on it&#039;s current target.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Interaction ==&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|DeviceActivateOnObject|&lt;br /&gt;
* int: npc_ship_id&lt;br /&gt;
* string: id&lt;br /&gt;
* int: target|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;npc.DeviceActivateOnObject(25334, &amp;quot;device&amp;quot;, 1541);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
NPC tries to activate device on specified target.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|DeviceActivateOnCoords|&lt;br /&gt;
* int: npc_ship_id&lt;br /&gt;
* string: id&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;npc.DeviceActivateOnCoords(25334, &amp;quot;device&amp;quot;, 100, 100);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
NPC tries to activate device on specified coordinates.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|DeviceActivateOnSelf|&lt;br /&gt;
* int: npc_ship_id&lt;br /&gt;
* string: id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;npc.DeviceActivateOnSelf(25334, &amp;quot;device&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
NPC tries to activate device on self.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|DeviceDeactivate|&lt;br /&gt;
* int: npc_ship_id&lt;br /&gt;
* string: id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;npc.DeviceDeactivate(25334, &amp;quot;device&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Deactivates device.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|EnterBase|&lt;br /&gt;
* int: npc_ship_id&lt;br /&gt;
* int: base_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;npc.EnterBase(25334, 15);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Npc enters base (with animation, routine etc.)&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|EnterJumpgate|&lt;br /&gt;
* int: npc_ship_id&lt;br /&gt;
* int: jumpgate_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;npc.EnterJumpgate(25334, 16);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Npc enters jumpgate (with animation, routine etc.) After entering jumpgate, ship will be destroyed.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|TravelThroughJumpgate|&lt;br /&gt;
* int: npc_ship_id&lt;br /&gt;
* int: jumpgate_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;npc.TravelThroughJumpgate(25334, 16);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Npc enters jumpgate (with animation, routine etc.). After travel, ship will actually appear in destination system.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetDistanceToObj|&lt;br /&gt;
* int: npc_ship_id&lt;br /&gt;
* int: object_id|&lt;br /&gt;
double: distance|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var distance = npc.GetDistanceToObj(25334, 165);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns distance from npc to specified object.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetCurrentCoordinates|&lt;br /&gt;
* int: npc_ship_id|&lt;br /&gt;
vector2: distance|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var coords = npc.GetCurrentCoordinates(25334);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns current coordinates of NPC.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetDockedTime|&lt;br /&gt;
* int: npc_ship_id|&lt;br /&gt;
double: docked_time|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var time = npc.GetDockedTime(25334);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetObstacleOnTheWay|&lt;br /&gt;
* int: npc_ship_id&lt;br /&gt;
* double: distance|&lt;br /&gt;
int: ID of first obstacle on the way of NPC|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var obstacle_id = npc.GetObstacleOnTheWay(25334, 7);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetSystemAsteroidsByDistanceToNPC|&lt;br /&gt;
* int: npc_ship_id&lt;br /&gt;
* int: limit|&lt;br /&gt;
array: IDs of asteroids|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var asteroids = npc.GetSystemAsteroidsByDistanceToNPC(25334, 8);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns an array of asteroids, which are ordered by distance to NPC (from closest to furthest)&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetShipsInScope|&lt;br /&gt;
* int: npc_ship_id|&lt;br /&gt;
array: IDs of all ships in scope (int)|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var ships = npc.GetShipsInScope(25334);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns an array of ships in NPC&#039;s scope.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetCurrentSystemID|&lt;br /&gt;
* int: npc_ship_id|&lt;br /&gt;
int: current system id|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var sys_id = npc.GetCurrentSystemID(25334);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|IsOnBase|&lt;br /&gt;
* int: npc_ship_id|&lt;br /&gt;
bool: whether npc is docked to base right now|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var res = npc.IsOnBase(25334);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|IsAtBaseEntry|&lt;br /&gt;
* int: npc_ship_id&lt;br /&gt;
* int: base_id|&lt;br /&gt;
bool: whether npc is at base entry point|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var res = npc.IsAtBaseEntry(25334);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|LeaveBase|&lt;br /&gt;
* int: npc_ship_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;npc.LeaveBase(25334);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
NPC undocks from a base.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetTags|&lt;br /&gt;
* int: npc_ship_id|&lt;br /&gt;
object: tags - tags of NPC&#039;s ship|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var tags = npc.GetTags(25334);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetBehavior|&lt;br /&gt;
* int: npc_ship_id&lt;br /&gt;
* string: behavior&lt;br /&gt;
* objects: parameters|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;npc.SetBehavior(25353, &amp;quot;avoid_asteroids&amp;quot;, true);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets behavior of NPC. See more on behaviors in [[VoidExpanse/Behaviors|Behaviors]] section.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RemoveBehavior|&lt;br /&gt;
* int: npc_ship_id&lt;br /&gt;
* string: behavior|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;npc.RemoveBehavior(25353, &amp;quot;avoid_asteroids&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes behavior of NPC. See more on behaviors in [[VoidExpanse/Behaviors|Behaviors]] section.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|ClearBehaviors|&lt;br /&gt;
* int: npc_ship_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;npc.ClearBehaviors(25353);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes all behaviors from npc.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetAIScript|&lt;br /&gt;
* int: npc_ship_id&lt;br /&gt;
* string: AI_script|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;npc.SetAIScript(25353, &amp;quot;PirateInWaiting&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets npc&#039;s AI script.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|IsInBattleWith|&lt;br /&gt;
* int: npc_ship_id&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var bEngaged = npc.IsInBattleWith(25353, 52522);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns whether specified NPC is in battle with specified ship or not.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetDecisionsPerSecond|&lt;br /&gt;
* int: npc_ship_id&lt;br /&gt;
* int: num|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;npc.SetDecisionsPerSecond(25444, 15);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
It affects how often function Decision on AIBehavior will be called. &lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Damonwall</name></author>
	</entry>
	<entry>
		<id>https://wiki.atomictorch.com/index.php?title=VoidExpanse/scope-ship&amp;diff=211</id>
		<title>VoidExpanse/scope-ship</title>
		<link rel="alternate" type="text/html" href="https://wiki.atomictorch.com/index.php?title=VoidExpanse/scope-ship&amp;diff=211"/>
		<updated>2014-05-27T08:21:10Z</updated>

		<summary type="html">&lt;p&gt;Damonwall: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:VoidExpanse/api_scopes]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Scope ship =&lt;br /&gt;
Used to get info and manipulate objects if type &amp;quot;ship&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Visibility:&#039;&#039;&#039; Global.&lt;br /&gt;
&lt;br /&gt;
== List of functions ==&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddItem|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: xml_item_type&lt;br /&gt;
* int: quantity|&lt;br /&gt;
object:&lt;br /&gt;
* int: quantity - amount added&lt;br /&gt;
* string: type - &amp;quot;item&amp;quot; or &amp;quot;resource&amp;quot;|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var obj = ship.Add(24556, &amp;quot;SomeItem2&amp;quot;, 5);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds item to ship&#039;s inventory.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddItemToStorage|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: xml_item_type&lt;br /&gt;
* int: quantity|&lt;br /&gt;
object:&lt;br /&gt;
* int: quantity - amount added&lt;br /&gt;
* string: type - &amp;quot;item&amp;quot; or &amp;quot;resource&amp;quot;|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var obj = ship.AddItemToStorage(24556, &amp;quot;BFG&amp;quot;, 0);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds item to ship&#039;s storage, not inventory (only works on a base). Useful when you need to add new hull through scripts, but&lt;br /&gt;
it cannot be added to inventory, only to storage.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RemoveItem|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* int: item_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.RemoveItem(24556, 5562);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes item from ship&#039;s inventory.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RemoveItemByType|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: item_xml_type|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.RemoveItemByType(24556, &amp;quot;SomeItem2&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes item from PLAYER&#039;s inventory by type. If there&#039;s no item of specified type in ship&#039;s&lt;br /&gt;
inventory, nothing will happen.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RemoveCargoByType|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: cargo_type&lt;br /&gt;
* &#039;&#039;(optional) int: cargo_quantity&#039;&#039;|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.RemoveCargoByType(24556, &amp;quot;SomeCargo&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes cargo from PLAYER&#039;s inventory by type. If there&#039;s no cargo of specified type in ship&#039;s&lt;br /&gt;
inventory, nothing will happen.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddSkillPointsToPlayer|&lt;br /&gt;
* string: player_name&lt;br /&gt;
* int: skillpoints|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.AddSkillPointsToPlayer(&amp;quot;DLirry&amp;quot;, 20);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds skill points to specified player.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddSkillPointsToShip|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* int: skillpoints|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.AddSkillPointsToShip(12335, 20);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds skill points to specified ship (works only on player&#039;s ships, non-npc).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetCargoAmount|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: cargo_type|&lt;br /&gt;
int: amount|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var left = ship.GetCargoAmount(24556, &amp;quot;SomeCargo&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns amount of specified cargo in player&#039;s inventory.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetCoordinates|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
vector2: coordinates|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var coords = ship.GetCoordinates(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns current coordinates of specified ship. Alias of GetPosition.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetShipsInScope|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
array of int: ids|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var ships = ship.GetShipsInScope(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns IDs of all ships, that are currently in specified ship&#039;s scope.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetProjectilesInScope|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
array of int: ids|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var bullets = ship.GetProjectilesInScope(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns IDs of all projectiles, that are currently in specified ship&#039;s scope.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetDistanceToObj|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* int: object_id |&lt;br /&gt;
double: distance|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var dist = ship.GetDistanceToObj(24556, 25225);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns distance from specified ship to specified object.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetFreeInventorySlots|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
int: number of free slots|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var slotsNum= ship.GetFreeInventorySlots(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns number of empty inventory slots in ship&#039;s inventory.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|HasCargoAmount|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: cargo_type&lt;br /&gt;
* int: amount|&lt;br /&gt;
bool|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var hasCargo = ship.HasCargoAmount(24556, &amp;quot;SomeCargo&amp;quot;, 14);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Checks if player has specified amount of cargo.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|HasItemOfType|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: item_id|&lt;br /&gt;
bool: if player&#039;s ship has item of specified type|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var hasItem = ship.HasItemOfType(24556, &amp;quot;SomeItem1&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Useful in quests.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetBuffs|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
array of objects:&lt;br /&gt;
* int: caster - id of ship casted this active effect&lt;br /&gt;
* double: time_left - time left&lt;br /&gt;
* double: effect_base&lt;br /&gt;
* double: effect_cap&lt;br /&gt;
* double: effect_per_level&lt;br /&gt;
* string: effect_type|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var effects = ship.GetBuffs(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns all specified ship&#039;s active effects. Active effects are temporary effects, which are usually&lt;br /&gt;
effects of consumables or devices.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetBuffsCache|&lt;br /&gt;
* int: ship_id |&lt;br /&gt;
array: key - value |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var cache = ship.GetBuffsCache(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns current buffs cache. Used in FinalCacheCalculations.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetCurrentValue|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: name|&lt;br /&gt;
double: current value with specified key|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var val = ship.GetCurrentValue(24556, &amp;quot;structure&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns current value of ship.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetCurrentValuesList|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
array: key -&amp;gt; value|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var values = ship.GetCurrentValuesList(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns all current values of ship.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetEquipment|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
array: unique IDs (int) of equipped items|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var equipment = ship.GetEquipment(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns current equipment of player&#039;s ship. Npc ship has no equipment, so it cannot be retreieved this way.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetWeapons|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
array: unique IDs (int) of equipped weapons|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var weapons = ship.GetWeapons(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns currently equipped weapons of a ship. Npc ship has no equipment, so it cannot be retireved this way.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetWeaponsOfType|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* int: weapon_type (1 for energy, 2 for ballistic, 3 for missile)|&lt;br /&gt;
array: unique IDs (int) of equipped weapons|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var weapons = ship.GetWeapons(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns currently equipped weapons of a ship of a specified type. Npc ship has no equipment, so it cannot be retireved this way.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RefillAmmoForWeapon|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* int: weapon_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.RefillAmmoForWeapon(24556, 15252);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Refills ammo for weapon with specified unique in-game id (GID).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetHullXmlID|&lt;br /&gt;
* int: ship_id |&lt;br /&gt;
string: current ship&#039;s hull&#039;s xml type|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var hull = ship.GetHullXmlID(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns currently equipped hull&#039;s xml_id.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetEquipmentCache|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
array: key-value|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var cache = ship.GetEquipmentCache(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns current equipment cache of ship.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetFinalCache|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
array: key-value|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var cache = ship.GetFinalCache(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns current final cache of ship.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetFinalCacheValue|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: name|&lt;br /&gt;
double: specified cache value|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var val = ship.GetFinalCacheValue(24556, &amp;quot;structure&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns final cache value.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetSkills|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
array of objects:&lt;br /&gt;
* string: id&lt;br /&gt;
* int: level&lt;br /&gt;
* string: skill_id|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var skills = ship.GetSkills(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns all current skills of ship.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetSkillsCache|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
array: key-value|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var cache = ship.GetSkillsCache(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns current skills cache.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetLevel|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
int: current level of ship|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var level = ship.GetLevel(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetTags|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
object: tags of a ship|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var tags = ship.GetTags(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetSystemID|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
int: ID of ship&#039;s current system|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var sys_id = ship.GetSystemID(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|IsDocked|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
bool: returns whether ship is currently docked|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var docked = ship.IsDocked(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|EnteringJumpgate|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
int: returns ID of jumpgate ship is entering (or 0 if none)|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var current_jumpgate = ship.EnteringJumpgate(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetCurrentBase|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
int: returns ID of base to which ship is docked (or -1 if none)|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var current_base = ship.GetCurrentBase(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetTimeSinceLastHit|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
double: time since ship last time dealt damage to someone|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var time = ship.GetTimeSinceLastHit(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Used in AI&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetTimeSinceLastHitted|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
double: time since ship last time took damage from someone|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var time = ship.GetTimeSinceLastHitted(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Used in ship&#039;s shield reestablishment calculations.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|IsShieldUp|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
bool: returns whether ship&#039;s shield is up|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var shield_up = ship.IsShieldUp(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|IsNpc|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
bool: returns whether ship is npc-controlled|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var is_npc = ship.IsNpc(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|IsEngineOn|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
bool: returns whether ship&#039;s engine is working|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var is_engine_on = ship.IsEngineOn(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RegenerateWeapons|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* double: energy&lt;br /&gt;
* double: mult|&lt;br /&gt;
double: amount of energy spent on weapons regeneration|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var energy_spent = ship.RegenerateWeapons(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Hardcoded part - trying to regenerate weapons with energy. Only usable on PLAYER&#039;s ships. Returns amount of energy spent on weapons regeneration.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|ReleaseGrappler|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.ReleaseGrappler(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Release all current grappled objects.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetGrappledCount|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
int: number of grappled objects|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var grappled = ship.GetGrappledCount(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Get number of grappled objects. Useful in caluclation of grappler energy consumption.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetBuffsCacheValue|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: field_name&lt;br /&gt;
* double: value|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.SetBuffsCacheValue(24556, &amp;quot;structure&amp;quot;, 2);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets buff cache value.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|ClearBuffsCache|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.ClearBuffsCache(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Clears all current buffs cache values.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetCurrentValue|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: field_name&lt;br /&gt;
* double: val|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.SetCurrentValue(24556, &amp;quot;structure&amp;quot;, 59);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets current value of ship&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetCurrentValueDelta|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: field_name&lt;br /&gt;
* double: val|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.SetCurrentValueDelta(24556, &amp;quot;structure&amp;quot;, -10);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Alters current value to specified value. Value will be clamped automatically between 0 and it&#039;s max value (which is governed by ship params.)&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetCurrentArea|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: area_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.SetCurrentArea(24556, &amp;quot;command_deck&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets current area of a player to specified one. Area determines in which section on a station NPC or player is.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetCurrentArea|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
string: area_id|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var area = ship.GetCurrentArea(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Gets current area of the ship.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetDrift|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* double: time|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.SetDrift(24556, 5000);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Enables driftmode of ship - in this mode ship cannot be controlled and can gain torque (which is always 0 when driftmode is off). Useful in explosion effects.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetEquipmentCacheValue|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: field_name&lt;br /&gt;
* double: value|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.SetEquipmentCacheValue(24556, &amp;quot;structure&amp;quot;, 5000);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets equipment cache value.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|ClearEquipmentCache|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.ClearEquipmentCache(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Clears equipment cache.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetFinalCacheValue|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: field_name&lt;br /&gt;
* double: value|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.SetFinalCacheValue(24556, &amp;quot;structure&amp;quot;, 5000);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets final cache value. Final cache is the one used in all in-game caluclations.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetShieldUp|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* bool: status - true or false|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.SetShieldUp(24556, true);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets shield up/down status. Affects collision and damage models. Does not applies visual effects (see more in [[VoidExpanse/scope-visual|VisualScope]]). &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetSkillsCacheValue|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: field_name&lt;br /&gt;
* double: value|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.SetSkillsCacheValue(24556, &amp;quot;structure&amp;quot;, 5000);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets skill cache value.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|ClearSkillsCache|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.ClearSkillsCache(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Clear skills cache.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetShipAsArrivedFromJumpgate|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* int: jumpgate_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.SetShipAsArrivedFromJumpgate(24556, 15);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Set visual and physical effects, that looks like ship just arrived from specified jumpgate.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetDamageByShip|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* double: damage&lt;br /&gt;
* int: caster_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.SetDamageByShip(24556, 15, 44535);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets damage from ship. Useful in AI - you can count damage from player ship and decide, whether to attack or not.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetDamageByShip|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* int: caster_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var dmg = ship.SetDamageByShip(24556, 44535);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Gets damage by ship, which was set by ship.SetDamageByShip method.&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Damonwall</name></author>
	</entry>
	<entry>
		<id>https://wiki.atomictorch.com/index.php?title=VoidExpanse/scope-player&amp;diff=210</id>
		<title>VoidExpanse/scope-player</title>
		<link rel="alternate" type="text/html" href="https://wiki.atomictorch.com/index.php?title=VoidExpanse/scope-player&amp;diff=210"/>
		<updated>2014-05-27T08:19:04Z</updated>

		<summary type="html">&lt;p&gt;Damonwall: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:VoidExpanse/api_scopes]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Scope player =&lt;br /&gt;
Used to manage player-related stuff.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Visibility:&#039;&#039;&#039; Global.&lt;br /&gt;
&lt;br /&gt;
== List of functions ==&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddAccess|&lt;br /&gt;
* string: player_name&lt;br /&gt;
* string: access_key|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;player.AddAccess(&amp;quot;dlirry&amp;quot;, &amp;quot;order_3&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Grants player specified access.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RemoveAccess|&lt;br /&gt;
* string: player_name&lt;br /&gt;
* string: access_key|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;player.RemoveAccess(&amp;quot;dlirry&amp;quot;, &amp;quot;order_3&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes from player specified access.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddMoney|&lt;br /&gt;
* string: player_name&lt;br /&gt;
* int: money&lt;br /&gt;
* bool: is_quest_reward|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;player.AddMoney(&amp;quot;dlirry&amp;quot;, 100500);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds specified amount of money to a player.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddExperience|&lt;br /&gt;
* string: player_name&lt;br /&gt;
* double: experience|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;player.AddExperience(&amp;quot;dlirry&amp;quot;, 100500);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds specified amount of experience to player.&lt;br /&gt;
The same effect as ship.SetCurrentValueDelta(2535, &amp;quot;experience&amp;quot;, 100500);&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetMoney|&lt;br /&gt;
* string: player_name|&lt;br /&gt;
int: player&#039;s money|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var money = player.GetMoney(&amp;quot;dlirry&amp;quot;, 100500);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Gets current amount of player&#039;s money&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetShipOfPlayer|&lt;br /&gt;
* string: player_name|&lt;br /&gt;
int: player&#039;s ship ID|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var ship_id = player.GetShipOfPlayer(&amp;quot;dlirry&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns ID of player&#039;s ship.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RemoveMoney|&lt;br /&gt;
* string: player_name&lt;br /&gt;
* int: money|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;vplayer.RemoveMoney(&amp;quot;dlirry&amp;quot;, 1);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes specified amount of money from player.&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Damonwall</name></author>
	</entry>
	<entry>
		<id>https://wiki.atomictorch.com/index.php?title=VoidExpanse/scope-ship&amp;diff=209</id>
		<title>VoidExpanse/scope-ship</title>
		<link rel="alternate" type="text/html" href="https://wiki.atomictorch.com/index.php?title=VoidExpanse/scope-ship&amp;diff=209"/>
		<updated>2014-05-27T08:17:33Z</updated>

		<summary type="html">&lt;p&gt;Damonwall: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:VoidExpanse/api_scopes]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Scope ship =&lt;br /&gt;
Used to get info and manipulate objects if type &amp;quot;ship&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Visibility:&#039;&#039;&#039; Global.&lt;br /&gt;
&lt;br /&gt;
== List of functions ==&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddItem|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: xml_item_type&lt;br /&gt;
* int: quantity|&lt;br /&gt;
object:&lt;br /&gt;
* int: quantity - amount added&lt;br /&gt;
* string: type - &amp;quot;item&amp;quot; or &amp;quot;resource&amp;quot;|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var obj = ship.Add(24556, &amp;quot;SomeItem2&amp;quot;, 5);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds item to ship&#039;s inventory.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddItemToStorage|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: xml_item_type&lt;br /&gt;
* int: quantity|&lt;br /&gt;
object:&lt;br /&gt;
* int: quantity - amount added&lt;br /&gt;
* string: type - &amp;quot;item&amp;quot; or &amp;quot;resource&amp;quot;|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var obj = ship.AddItemToStorage(24556, &amp;quot;BFG&amp;quot;, 0);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds item to ship&#039;s storage, not inventory (only works on a base). Useful when you need to add new hull through scripts, but&lt;br /&gt;
it cannot be added to inventory, only to storage.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RemoveItem|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* int: item_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.RemoveItem(24556, 5562);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes item from ship&#039;s inventory.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RemoveItemByType|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: item_xml_type|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.RemoveItemByType(24556, &amp;quot;SomeItem2&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes item from PLAYER&#039;s inventory by type. If there&#039;s no item of specified type in ship&#039;s&lt;br /&gt;
inventory, nothing will happen.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RemoveCargoByType|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: cargo_type&lt;br /&gt;
* &#039;&#039;(optional) int: cargo_quantity&#039;&#039;|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.RemoveCargoByType(24556, &amp;quot;SomeCargo&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes cargo from PLAYER&#039;s inventory by type. If there&#039;s no cargo of specified type in ship&#039;s&lt;br /&gt;
inventory, nothing will happen.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddSkillPointsToPlayer|&lt;br /&gt;
* string: player_name&lt;br /&gt;
* int: skillpoints|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.AddSkillPointsToPlayer(&amp;quot;DLirry&amp;quot;, 20);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds skill points to specified player.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddSkillPointsToShip|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* int: skillpoints|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.AddSkillPointsToShip(12335, 20);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds skill points to specified ship (works only on player&#039;s ships, non-npc).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetCargoAmount|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: cargo_type|&lt;br /&gt;
int: amount|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var left = ship.GetCargoAmount(24556, &amp;quot;SomeCargo&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns amount of specified cargo in player&#039;s inventory.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetCoordinates|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
vector2: coordinates|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var coords = ship.GetCoordinates(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns current coordinates of specified ship. Alias of GetPosition.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetShipsInScope|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
array of int: ids|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var ships = ship.GetShipsInScope(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns IDs of all ships, that are currently in specified ship&#039;s scope.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetProjectilesInScope|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
array of int: ids|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var bullets = ship.GetProjectilesInScope(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns IDs of all projectiles, that are currently in specified ship&#039;s scope.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetDistanceToObj|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* int: object_id |&lt;br /&gt;
double: distance|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var dist = ship.GetDistanceToObj(24556, 25225);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns distance from specified ship to specified object.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetFreeInventorySlots|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
int: number of free slots|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var slotsNum= ship.GetFreeInventorySlots(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns number of empty inventory slots in ship&#039;s inventory.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|HasCargoAmount|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: cargo_type&lt;br /&gt;
* int: amount|&lt;br /&gt;
bool|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var hasCargo = ship.HasCargoAmount(24556, &amp;quot;SomeCargo&amp;quot;, 14);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Checks if player has specified amount of cargo.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|HasItemOfType|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: item_id|&lt;br /&gt;
bool: if player&#039;s ship has item of specified type|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var hasItem = ship.HasItemOfType(24556, &amp;quot;SomeItem1&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Useful in quests.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetBuffs|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
array of objects:&lt;br /&gt;
* int: caster - id of ship casted this active effect&lt;br /&gt;
* double: time_left - time left&lt;br /&gt;
* double: effect_base&lt;br /&gt;
* double: effect_cap&lt;br /&gt;
* double: effect_per_level&lt;br /&gt;
* string: effect_type|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var effects = ship.GetBuffs(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns all specified ship&#039;s active effects. Active effects are temporary effects, which are usually&lt;br /&gt;
effects of consumables or devices.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetBuffsCache|&lt;br /&gt;
* int: ship_id |&lt;br /&gt;
array: key - value |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var cache = ship.GetBuffsCache(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns current buffs cache. Used in FinalCacheCalculations.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetCurrentValue|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: name|&lt;br /&gt;
double: current value with specified key|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var val = ship.GetCurrentValue(24556, &amp;quot;structure&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns current value of ship.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetCurrentValuesList|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
array: key -&amp;gt; value|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var values = ship.GetCurrentValuesList(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns all current values of ship.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetEquipment|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
array: unique IDs (int) of equipped items|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var equipment = ship.GetEquipment(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns current equipment of player&#039;s ship. Npc ship has no equipment, so it cannot be retreieved this way.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetWeapons|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
array: unique IDs (int) of equipped weapons|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var weapons = ship.GetWeapons(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns currently equipped weapons of a ship. Npc ship has no equipment, so it cannot be retireved this way.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetWeaponsOfType|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* int: weapon_type (1 for energy, 2 for ballistic, 3 for missile)|&lt;br /&gt;
array: unique IDs (int) of equipped weapons|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var weapons = ship.GetWeapons(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns currently equipped weapons of a ship of a specified type. Npc ship has no equipment, so it cannot be retireved this way.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RefillAmmoForWeapon|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* int: weapon_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.RefillAmmoForWeapon(24556, 15252);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Refills ammo for weapon with specified unique in-game id (GID).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetHullXmlID|&lt;br /&gt;
* int: ship_id |&lt;br /&gt;
string: current ship&#039;s hull&#039;s xml type|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var hull = ship.GetHullXmlID(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns currently equipped hull&#039;s xml_id.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetEquipmentCache|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
array: key-value|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var cache = ship.GetEquipmentCache(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns current equipment cache of ship.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetFinalCache|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
array: key-value|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var cache = ship.GetFinalCache(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns current final cache of ship.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetFinalCacheValue|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: name|&lt;br /&gt;
double: specified cache value|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var val = ship.GetFinalCacheValue(24556, &amp;quot;structure&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns final cache value.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetSkills|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
array of objects:&lt;br /&gt;
* string: id&lt;br /&gt;
* int: level&lt;br /&gt;
* string: skill_id|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var skills = ship.GetSkills(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns all current skills of ship.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetSkillsCache|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
array: key-value|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var cache = ship.GetSkillsCache(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns current skills cache.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetLevel|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
int: current level of ship|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var level = ship.GetLevel(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetTags|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
object: tags of a ship|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var tags = ship.GetTags(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetSystemID|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
int: ID of ship&#039;s current system|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var sys_id = ship.GetSystemID(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|IsDocked|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
bool: returns whether ship is currently docked|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var docked = ship.IsDocked(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|EnteringJumpgate|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
int: returns ID of jumpgate ship is entering (or 0 if none)|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var current_jumpgate = ship.EnteringJumpgate(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetCurrentBase|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
int: returns ID of base to which ship is docked (or -1 if none)|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var current_base = ship.GetCurrentBase(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetTimeSinceLastHit|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
double: time since ship last time dealt damage to someone|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var time = ship.GetTimeSinceLastHit(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Used in AI&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetTimeSinceLastHitted|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
double: time since ship last time took damage from someone|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var time = ship.GetTimeSinceLastHitted(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Used in ship&#039;s shield reestablishment calculations.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|IsShieldUp|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
bool: returns whether ship&#039;s shield is up|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var shield_up = ship.IsShieldUp(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|IsNpc|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
bool: returns whether ship is npc-controlled|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var is_npc = ship.IsNpc(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|IsEngineOn|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
bool: returns whether ship&#039;s engine is working|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var is_engine_on = ship.IsEngineOn(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RegenerateWeapons|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* double: energy&lt;br /&gt;
* double: mult|&lt;br /&gt;
double: amount of energy spent on weapons regeneration|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var energy_spent = ship.RegenerateWeapons(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Hardcoded part - trying to regenerate weapons with energy. Only usable on PLAYER&#039;s ships. Returns amount of energy spent on weapons regeneration.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|ReleaseGrappler|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.ReleaseGrappler(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Release all current grappled objects.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetGrappledCount|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
int: number of grappled objects|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var grappled = ship.GetGrappledCount(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Get number of grappled objects. Useful in caluclation of grappler energy consumption.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetBuffsCacheValue|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: field_name&lt;br /&gt;
* double: value|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.SetBuffsCacheValue(24556, &amp;quot;structure&amp;quot;, 2);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets buff cache value.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|ClearBuffsCache|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.ClearBuffsCache(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Clears all current buffs cache values.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetCurrentValue|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: field_name&lt;br /&gt;
* double: val|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.SetCurrentValue(24556, &amp;quot;structure&amp;quot;, 59);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets current value of ship&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetCurrentValueDelta|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: field_name&lt;br /&gt;
* double: val|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.SetCurrentValueDelta(24556, &amp;quot;structure&amp;quot;, -10);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Alters current value to specified value. Value will be clamped automatically between 0 and it&#039;s max value (which is governed by ship params.)&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetDrift|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* double: time|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.SetDrift(24556, 5000);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Enables driftmode of ship - in this mode ship cannot be controlled and can gain torque (which is always 0 when driftmode is off). Useful in explosion effects.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetEquipmentCacheValue|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: field_name&lt;br /&gt;
* double: value|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.SetEquipmentCacheValue(24556, &amp;quot;structure&amp;quot;, 5000);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets equipment cache value.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|ClearEquipmentCache|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.ClearEquipmentCache(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Clears equipment cache.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetFinalCacheValue|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: field_name&lt;br /&gt;
* double: value|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.SetFinalCacheValue(24556, &amp;quot;structure&amp;quot;, 5000);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets final cache value. Final cache is the one used in all in-game caluclations.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetShieldUp|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* bool: status - true or false|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.SetShieldUp(24556, true);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets shield up/down status. Affects collision and damage models. Does not applies visual effects (see more in [[VoidExpanse/scope-visual|VisualScope]]). &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetSkillsCacheValue|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: field_name&lt;br /&gt;
* double: value|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.SetSkillsCacheValue(24556, &amp;quot;structure&amp;quot;, 5000);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets skill cache value.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|ClearSkillsCache|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.ClearSkillsCache(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Clear skills cache.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetShipAsArrivedFromJumpgate|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* int: jumpgate_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.SetShipAsArrivedFromJumpgate(24556, 15);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Set visual and physical effects, that looks like ship just arrived from specified jumpgate.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetDamageByShip|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* double: damage&lt;br /&gt;
* int: caster_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.SetDamageByShip(24556, 15, 44535);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets damage from ship. Useful in AI - you can count damage from player ship and decide, whether to attack or not.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetDamageByShip|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* int: caster_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var dmg = ship.SetDamageByShip(24556, 44535);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Gets damage by ship, which was set by ship.SetDamageByShip method.&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Damonwall</name></author>
	</entry>
	<entry>
		<id>https://wiki.atomictorch.com/index.php?title=VoidExpanse/scope-timer&amp;diff=208</id>
		<title>VoidExpanse/scope-timer</title>
		<link rel="alternate" type="text/html" href="https://wiki.atomictorch.com/index.php?title=VoidExpanse/scope-timer&amp;diff=208"/>
		<updated>2014-05-27T08:15:48Z</updated>

		<summary type="html">&lt;p&gt;Damonwall: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:VoidExpanse/api_scopes]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
= Timer scope =&lt;br /&gt;
Used to create and manage timers - delayed events. Timers only works inside it&#039;s script, but&lt;br /&gt;
they&#039;re persistent through savegames.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Visibility:&#039;&#039;&#039; Global.&lt;br /&gt;
&lt;br /&gt;
== List of functions ==&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetTimer|&lt;br /&gt;
* double: time_in_seconds&lt;br /&gt;
* string: function_name&lt;br /&gt;
* object: args&lt;br /&gt;
* int: loops (0 - infinite)|&lt;br /&gt;
int - ID of created timer|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px&amp;quot;&amp;gt;var timer = timer.SetTimer(5, &amp;quot;SomeFunction&amp;quot;, {what_to_say: &amp;quot;hello&amp;quot;}, 1);&lt;br /&gt;
function SomeFunction( args )&lt;br /&gt;
{&lt;br /&gt;
	console.Print(&amp;quot;I was told to say &amp;quot; + args.what_to_say);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Creates a timed event, which will be executed after &amp;quot;time_in_seconds&amp;quot; interval. Can be infinite loop.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|ClearTimer|&lt;br /&gt;
* int: timer_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px&amp;quot;&amp;gt;timer.ClearTimer(5);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes timer with specified ID.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetGameTime|&lt;br /&gt;
void|&lt;br /&gt;
double|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px&amp;quot;&amp;gt;timer.GetGameTime();&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns time passed since game was started in seconds.&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Damonwall</name></author>
	</entry>
	<entry>
		<id>https://wiki.atomictorch.com/index.php?title=VoidExpanse/scope-game&amp;diff=207</id>
		<title>VoidExpanse/scope-game</title>
		<link rel="alternate" type="text/html" href="https://wiki.atomictorch.com/index.php?title=VoidExpanse/scope-game&amp;diff=207"/>
		<updated>2014-05-27T08:14:01Z</updated>

		<summary type="html">&lt;p&gt;Damonwall: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:VoidExpanse/api_scopes]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Scope game =&lt;br /&gt;
Used for various in-game functions.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Visibility:&#039;&#039;&#039; Global.&lt;br /&gt;
&lt;br /&gt;
== List of functions ==&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|ApplyForceToObject|&lt;br /&gt;
* int: object_id&lt;br /&gt;
* double: force_x&lt;br /&gt;
* double: force_y |&lt;br /&gt;
void |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;game.ApplyForceToObject(153, 10, 0); // add x-axis force&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Applies force to physics object. Will work on any interactive object.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|ApplyTorqueToObject|&lt;br /&gt;
* int: object_id&lt;br /&gt;
* double: torque |&lt;br /&gt;
void |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;game.ApplyTorqueToObject(153, 10); // add torque&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Applies torque to physics object. Will work on any interactive object.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|DamageProjectile|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* int: projectile_id&lt;br /&gt;
* double: damage |&lt;br /&gt;
void |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;game.DamageProjectile(1, 12, 10);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Damages projectile. Projectile, that took enough damage, will explode.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|TryToRemoveContentFromAsteroid|&lt;br /&gt;
* int: asteroid_id&lt;br /&gt;
* string: name&lt;br /&gt;
* int: amount |&lt;br /&gt;
int: amount of content extracted from asteroid|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;game.TryToRemoveContentFromAsteroid(12, &amp;quot;ResourceOre&amp;quot;, 10);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Tries to remove specified resource from asteroid&#039;s contents. Returns extracted amount.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetItemEffects|&lt;br /&gt;
* string: xml_item_id|&lt;br /&gt;
array of objects:&lt;br /&gt;
* double: effect_base&lt;br /&gt;
* double: effect_cap&lt;br /&gt;
* double: effect_per_level&lt;br /&gt;
* double: effect_type|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var effects = game.GetItemEffects(&amp;quot;SomeItem&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns an array of all effects of specified item.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetStationDockedNpcs|&lt;br /&gt;
* int: station_id|&lt;br /&gt;
array of int|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var npcs = game.GetStationDockedNpcs(25353);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns an array of IDs of all ships, that are docked to a station.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetItemPrice|&lt;br /&gt;
* string: xml_item_id|&lt;br /&gt;
int: item_price|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var price = game.GetItemPrice(&amp;quot;SomeItem&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetItemSID|&lt;br /&gt;
* int: unique_item_id |&lt;br /&gt;
string: xml_item_id |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var xml_item_id = game.GetItemSID(12352);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns xml_id of item by it&#039;s instance ID.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetProjectileDescriptionByXmlID|&lt;br /&gt;
* string: projectile_xml_id |&lt;br /&gt;
object:&lt;br /&gt;
* double: damage&lt;br /&gt;
* string: damage_type|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var xml_item_id = game.GetProjectileDescriptionByXmlID(&amp;quot;wpn_0&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Gets projectile description. Projectile xml ID is constructed by the following rule: wpn_id + &amp;quot;_&amp;quot; + projectile_order (starting with 0).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetSecondsMultiplier|&lt;br /&gt;
void |&lt;br /&gt;
void |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var multiplier = game.GetSecondsMultiplier();&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns time passed since last frame. Useful when calculating time-depended stuff, like health-regeneration or damage.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetGameObjectTags|&lt;br /&gt;
* int: object_id |&lt;br /&gt;
void |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var tags = game.GetGameObjectTags(131);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Gets game object tags. Any physical object, such as asteroid, space object, ship or else, has it&#039;s own tags. This function can retrieve it. Alias of game.GetTags.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetTags|&lt;br /&gt;
* int: object_id |&lt;br /&gt;
void |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var tags = game.GetTags(131);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Gets game object tags. Any physical object, such as asteroid, space object, ship or else, has it&#039;s own tags. This function can retrieve it. The same as game.GetGameObjectTags.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetShipOwner|&lt;br /&gt;
* int: ship_id |&lt;br /&gt;
string: owner_name |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var name = game.GetShipOwner(123142);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns name of ship&#039;s owner. If ship is npc-controller, that would be npc name, else - player&#039;s name.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetAsteroidMiningListByID|&lt;br /&gt;
* int: asteroid_id |&lt;br /&gt;
array of objects:&lt;br /&gt;
* string: xml_id&lt;br /&gt;
* int: quantity&lt;br /&gt;
* int: extraction|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var list = game.GetAsteroidMiningListByID(1252);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns actual ateroid mining list.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetAsteroidDescriptionByID|&lt;br /&gt;
* int: asteroid_id |&lt;br /&gt;
object:&lt;br /&gt;
* int: type&lt;br /&gt;
* int: difficulty|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var desc = game.GetAsteroidDescriptionByID(1252);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns asteroid description.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetSkillEffects|&lt;br /&gt;
* string: skill_xml_id |&lt;br /&gt;
array of objects:&lt;br /&gt;
* int: cost&lt;br /&gt;
* int: page&lt;br /&gt;
* string: title|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var effects = game.GetSkillEffects(&amp;quot;SomeSkill&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns array of specified skills&#039; effects.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|IsResource|&lt;br /&gt;
* string: item_xml_id |&lt;br /&gt;
bool: is specified item resource|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var is_res = game.IsResource(&amp;quot;SomeItemOrResource&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|IsHull|&lt;br /&gt;
* string: item_xml_id |&lt;br /&gt;
bool: is specified item is hull|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var is_hull = game.IsHull(&amp;quot;SomeItemOrResource&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|IsDevice|&lt;br /&gt;
* string: item_xml_id |&lt;br /&gt;
bool: is specified item is device|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var is_dev = game.IsDevice(&amp;quot;SomeItemOrResource&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|IsWeapon|&lt;br /&gt;
* string: item_xml_id |&lt;br /&gt;
bool: is specified item is weapon|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var is_wpn = game.IsWeapon(&amp;quot;SomeItemOrResource&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|IsShipPlayerControlled|&lt;br /&gt;
* int: ship_id |&lt;br /&gt;
bool: is ship controlled by player|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var is_player = game.IsShipPlayerControlled(123252);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetSystemJumpgates|&lt;br /&gt;
* int: system_id |&lt;br /&gt;
array: IDs of system jumpgates |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var jumpgates = game.GetSystemJumpgates(1);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns all jumpgates of specified system.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetSystemBases|&lt;br /&gt;
* int: system_id |&lt;br /&gt;
array: IDs of system bases |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var bases = game.GetSystemBases(1);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns all bases of specified system.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetSystemShips|&lt;br /&gt;
* int: system_id |&lt;br /&gt;
array: IDs of system ships |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var ships = game.GetSystemShips(1);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns all ships of specified system.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetSystemShipsOfClass|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* string: tags_class |&lt;br /&gt;
array: IDs of system ships |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var miner_ships = game.GetSystemShipsOfClass(1, &amp;quot;miner&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns all ships of specified system, which tag &amp;quot;class&amp;quot; is equal to specified value.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetSystemPlayersShips|&lt;br /&gt;
* int: system_id |&lt;br /&gt;
array: IDs of system players&#039; ships |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var ships = game.GetSystemPlayersShips(1);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns all player-controlled ships of specified system.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetObjectCoordinates|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* int: object_id |&lt;br /&gt;
vector2: coordinates |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var coords = game.GetObjectCoordinates(1, 25442);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns coordinates of specified object.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|DeleteGameObject|&lt;br /&gt;
* int: object_id |&lt;br /&gt;
void |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;game.DeleteGameObject(25442);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Deletes game object from game world.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetBaseEntryPointsByID|&lt;br /&gt;
* int: base_id |&lt;br /&gt;
array of vector2 |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var points = game.GetBaseEntryPointsByID(353);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns bases&#039; actual entry points coordinates.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetSecondsBetweenStarSystemUpdates|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* int: seconds |&lt;br /&gt;
void |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;game.SetSecondsBetweenStarSystemUpdates(1, 60);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets interval between event &amp;quot;OnStarSystemUpdate&amp;quot; for this system calls.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SendNotification|&lt;br /&gt;
* string: player_name&lt;br /&gt;
* string: title&lt;br /&gt;
* string: message |&lt;br /&gt;
void |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;game.SendNotification(&amp;quot;dlirry&amp;quot;, &amp;quot;Server notification&amp;quot;, &amp;quot;You are great player!&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sends notification to connected player.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetAllItems|&lt;br /&gt;
void |&lt;br /&gt;
array: xml-ids (strings) of all items |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var res = game.GetAllItems();&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Gets all items.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetItems|&lt;br /&gt;
* int: level&lt;br /&gt;
* string[]: item_types |&lt;br /&gt;
array: xml-ids (strings) of items |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var res = game.GetItems(15, [&amp;quot;Hull&amp;quot;, &amp;quot;Consumable&amp;quot;]);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Gets all items of specified type.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetItemTypes|&lt;br /&gt;
void |&lt;br /&gt;
array: strings of types |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var res = game.GetItemTypes();&amp;lt;/pre&amp;gt; |&lt;br /&gt;
&#039;&#039;&#039;not implemented&#039;&#039;&#039;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetProjectileFromSystemByID|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* int: projectile_id |&lt;br /&gt;
object:&lt;br /&gt;
* string: id&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y&lt;br /&gt;
* int: caster_id |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var proj = game.GetProjectileFromSystemByID(15,2524);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns basic information about specified projectile. ID in returned object is full projectile ID, which is&lt;br /&gt;
xml_weapon_id + &amp;quot;_&amp;quot; + number_of_projectile_in_weapon.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|ProjectileFromSystemDestroy|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* int: projectile_id |&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;game.ProjectileFromSystemDestroy(15,2524);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Destroys specified projectile.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|ProjectileFromSystemSetSpeed|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* int: projectile_id&lt;br /&gt;
* double: speed_x&lt;br /&gt;
* double: speed_y|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;game.ProjectileFromSystemSetSpeed(15,2524, 0, 0); //stop projectile&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets projectile linear speed. Useful for manipulating projectile speed, doesn&#039;t affect it&#039;s direction.&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Damonwall</name></author>
	</entry>
	<entry>
		<id>https://wiki.atomictorch.com/index.php?title=VoidExpanse/scope-relations&amp;diff=206</id>
		<title>VoidExpanse/scope-relations</title>
		<link rel="alternate" type="text/html" href="https://wiki.atomictorch.com/index.php?title=VoidExpanse/scope-relations&amp;diff=206"/>
		<updated>2014-05-27T08:12:05Z</updated>

		<summary type="html">&lt;p&gt;Damonwall: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:VoidExpanse/api_scopes]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Scope relations =&lt;br /&gt;
Used to manage reputation, relations, factions and all other social stuff.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Visibility:&#039;&#039;&#039; Global.&lt;br /&gt;
&lt;br /&gt;
== List of functions ==&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|CreateFaction|&lt;br /&gt;
* string: faction_id&lt;br /&gt;
* string: faction_name|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;relations.CreateFaction(&amp;quot;order&amp;quot;, &amp;quot;Order of Paladins&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Creates a faction.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|IsCapital|&lt;br /&gt;
* int: system_id|&lt;br /&gt;
bool|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;relations.IsCapital(323);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns whether specified system is a capital of a faction.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetFactionDispositionToShip|&lt;br /&gt;
* string: faction_id&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
int: disposition|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var disp = relations.GetFactionDispositionToShip(&amp;quot;order&amp;quot;, 25333);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns faction disposition to specified ship.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetFactionsRelation|&lt;br /&gt;
* string: faction_1_id&lt;br /&gt;
* string: faction_2_id|&lt;br /&gt;
int: relation|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var relation = relations.GetFactionsRelation(&amp;quot;order&amp;quot;, &amp;quot;freedom&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns relation between factions.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetPersonalDisposition|&lt;br /&gt;
* int: ship_id_1&lt;br /&gt;
* int: ship_id_2|&lt;br /&gt;
int: disposition|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var disp = relations.GetPersonalDisposition(25332, 25333);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns disposition of ship to another ship.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetShipFaction|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
string: faction|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var fact = relations.GetShipFaction(25332);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns ship&#039;s current faction.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetTotalDisposition|&lt;br /&gt;
* int: ship_id_1&lt;br /&gt;
* int: ship_id_2|&lt;br /&gt;
int: desposition|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var disp = relations.GetTotalDisposition(25332, 25333);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns ship&#039;s total disposition. Calculated in internal scrips, so it can be altered.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetBaseFaction|&lt;br /&gt;
* int: base_id&lt;br /&gt;
* string: faction_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;relations.SetBaseFaction(25332, &amp;quot;order&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets faction of a space station.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetFactionDispositionToShip|&lt;br /&gt;
* string: faction&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* int: value|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;relations.SetFactionDispositionToShip(&amp;quot;order&amp;quot;, 25553, -1000);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets a faction disposition towards a ship.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetFactionDispositionToShipDelta|&lt;br /&gt;
* string: faction&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* int: value_delta|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;relations.SetFactionDispositionToShipDelta(&amp;quot;order&amp;quot;, 25553, 1000);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Changes a faction disposition towards a ship by specified delta.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetFactionsRelation|&lt;br /&gt;
* string: faction_id_1&lt;br /&gt;
* string: faction_id_2&lt;br /&gt;
* int: value|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;relations.SetFactionsRelation(&amp;quot;order&amp;quot;, &amp;quot;freedom&amp;quot;, -1000);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets a relation between factions.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetPersonalDisposition|&lt;br /&gt;
* int: ship_id_1&lt;br /&gt;
* int: ship_id_2&lt;br /&gt;
* int: disposition|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;relations.SetPersonalDisposition(25333, 25332, -1000);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets personal disposition between two ships.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetPersonalDispositionDelta|&lt;br /&gt;
* int: ship_id_1&lt;br /&gt;
* int: ship_id_2&lt;br /&gt;
* int: disposition_delta|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;relations.SetPersonalDispositionDelta(25333, 25332, -1000);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Changes personal disposition between two ships by specified value.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetShipFaction|&lt;br /&gt;
* int: ship_id_1&lt;br /&gt;
* string: faction|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;relations.SetShipFaction(25333, &amp;quot;order&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Set ship&#039;s faction.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetSystemFaction|&lt;br /&gt;
* int: ship_id_1&lt;br /&gt;
* string: faction|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;relations.SetSystemFaction(1, &amp;quot;order&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets system&#039;s faction.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetSystemFaction|&lt;br /&gt;
* int: ship_id_1|&lt;br /&gt;
string: faction of a system|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var faction = relations.GetSystemFaction(1);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetFactions|&lt;br /&gt;
void|&lt;br /&gt;
array: IDs of factions (strings)|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var factions = relations.GetFactions();&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns IDs of all factions created with relations.CreateFaction.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetFactionInfoByID|&lt;br /&gt;
* string: faction_id|&lt;br /&gt;
object:&lt;br /&gt;
* double capital_area_of_influence;&lt;br /&gt;
* int capital_danger_level&lt;br /&gt;
* int capital_tech_level&lt;br /&gt;
* double distance_from_origin_max&lt;br /&gt;
* double distance_from_origin_min&lt;br /&gt;
* int stars_count_percent&lt;br /&gt;
* int stars_count_value&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var info = relations.GetFactionInfoByID(&amp;quot;order&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns information about specified faction.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|ClearAllInfoOnSystems|&lt;br /&gt;
void|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;relations.ClearAllInfoOnSystems();&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Clears all faction relation info on systems. Useful after failed attempts to generate factions.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetFactionCapital|&lt;br /&gt;
* string: faction|&lt;br /&gt;
int: ID of system, which is considered as a capital of faction|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var sys_id = relations.GetFactionCapital(&amp;quot;order&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetFactionCapital|&lt;br /&gt;
* string: faction&lt;br /&gt;
* int: system_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;relations.SetFactionCapital(&amp;quot;order&amp;quot;, 15);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Damonwall</name></author>
	</entry>
	<entry>
		<id>https://wiki.atomictorch.com/index.php?title=Main_Page&amp;diff=188</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.atomictorch.com/index.php?title=Main_Page&amp;diff=188"/>
		<updated>2014-05-22T04:30:23Z</updated>

		<summary type="html">&lt;p&gt;Damonwall: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:AtomicTorchStudioLogoTransparent.png]]&amp;lt;br&amp;gt;Welcome to &#039;&#039;&#039;AtomicTorch Studio&#039;&#039;&#039; wiki!&lt;br /&gt;
&lt;br /&gt;
This wiki is work in progress and is in no way complete. We are only starting adding content here, for now mostly for our own reference. But if you would like to help - feel free to create an account.&lt;br /&gt;
&lt;br /&gt;
= VoidExpanse Wiki =&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width:100%&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:28%&amp;quot; | Get the game&lt;br /&gt;
! style=&amp;quot;width:24%&amp;quot; | The game&lt;br /&gt;
! style=&amp;quot;width:24%&amp;quot; | Modding&lt;br /&gt;
! style=&amp;quot;width:24%&amp;quot; | Tutorials&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;!-- get the game --&amp;gt;&lt;br /&gt;
VoidExpanse is currently in development. You can find all information about the game on the website.&lt;br /&gt;
* [http://atomictorch.com AtomicTorch Studio portal]&lt;br /&gt;
* [http://forums.atomictorch.com Forums]&lt;br /&gt;
| &amp;lt;!-- the game --&amp;gt;&lt;br /&gt;
* [[VoidExpanse/Version History|Version history]]&lt;br /&gt;
* [[VoidExpanse/Ships|Ships]]&lt;br /&gt;
* [[VoidExpanse/Weapons|Weapons]]&lt;br /&gt;
* [[VoidExpanse/Equipment|Equipment]]&lt;br /&gt;
| &amp;lt;!-- modding --&amp;gt;&lt;br /&gt;
* [[VoidExpanse/installing_mods|How to install mods?]]&lt;br /&gt;
* [[VoidExpanse/modding|Modding]]&lt;br /&gt;
* [[VoidExpanse/scripting_api|Scripting]]&lt;br /&gt;
| &amp;lt;!-- tutorials --&amp;gt;&lt;br /&gt;
* [[VoidExpanse/updating_the_game|How to update the game?]]&lt;br /&gt;
* [[VoidExpanse/Server_setup|Server setup]]&lt;br /&gt;
* [[VoidExpanse/Server_commands|Server commands]]&lt;br /&gt;
* [[VoidExpanse/Single_cannot_start|Cannot start singleplayer]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Editing wiki ==&lt;br /&gt;
* [[:Category:Templates|List of templates]]&lt;/div&gt;</summary>
		<author><name>Damonwall</name></author>
	</entry>
	<entry>
		<id>https://wiki.atomictorch.com/index.php?title=VoidExpanse/Server_setup&amp;diff=171</id>
		<title>VoidExpanse/Server setup</title>
		<link rel="alternate" type="text/html" href="https://wiki.atomictorch.com/index.php?title=VoidExpanse/Server_setup&amp;diff=171"/>
		<updated>2014-05-03T02:41:07Z</updated>

		<summary type="html">&lt;p&gt;Damonwall: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Multiplayer server setup =&lt;br /&gt;
&lt;br /&gt;
== GUI for multiplayer server ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The GUI is currently in development.&#039;&#039;&#039; We are planning to create a gui for Windows, Mac and Linux to provide easy, user-friendly server setup and management. However, on console-based systems, like FreeBSD, there are also standard console commands for server setup and management.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Multiplayer server setup ==&lt;br /&gt;
&lt;br /&gt;
To launch a multiplayer server on any system, your system needs to meet following requirements:&lt;br /&gt;
* .NET or Mono, compatible with .NET Framework 4.0&lt;br /&gt;
&lt;br /&gt;
=== Installation ===&lt;br /&gt;
1. Copy the following files from game distributive to your server machine:&lt;br /&gt;
* folder &amp;quot;Server&amp;quot;&lt;br /&gt;
* folder &amp;quot;Mods&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Installation complete!&lt;br /&gt;
&lt;br /&gt;
Or you can actually run the server from the same folder as it is distributed with the game.&lt;br /&gt;
&lt;br /&gt;
=== Launch ===&lt;br /&gt;
&lt;br /&gt;
====Windows====&lt;br /&gt;
Launch &#039;&#039;AtomicTorch.SpaceRPG.Server.RuntimeWin.exe&#039;&#039; from &#039;&#039;./Server/&#039;&#039; folder.&lt;br /&gt;
&lt;br /&gt;
====Other system with Mono====&lt;br /&gt;
Launch &#039;&#039;AtomicTorch.SpaceRPG.Server.RuntimeWin.exe&#039;&#039; from &#039;&#039;./Server/Mono&#039;&#039; folder with mono,&lt;br /&gt;
like this:&lt;br /&gt;
&amp;lt;pre&amp;gt;mono AtomicTorch.SpaceRPG.Server.RuntimeWin.exe&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Launch complete!&lt;br /&gt;
&lt;br /&gt;
=== Settings ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;SettingsServer.xml&#039;&#039;&#039;&lt;br /&gt;
Most of settings are stored in &#039;&#039;SettingsServer.xml&#039;&#039;, which is located in the same folder as server .exe file.&lt;br /&gt;
If it&#039;s not there, launch server once with &amp;quot;-new&amp;quot; argument, and it&#039;ll be created automatically and placed in the main folder.&lt;br /&gt;
&lt;br /&gt;
In &#039;&#039;SettingsServer.xml&#039;&#039;, &#039;&#039;&#039;do not modfify misc and network parts&#039;&#039;&#039;! It may cause malifunction if you modify something in a way it is not intended to be.&lt;br /&gt;
&lt;br /&gt;
You may, however, modify &amp;lt;server&amp;gt; part on your own risk. There you can setup some server configurations that would affect gameplay.&lt;br /&gt;
&lt;br /&gt;
====Whitelist, blacklist====&lt;br /&gt;
To enable whitelist, you need to follow the following procedure:&lt;br /&gt;
* Be sure, that white_list_enabled in SettingsServer.xml is set to 1.&lt;br /&gt;
* Create a file &amp;quot;whitelist.txt&amp;quot; next to the server executable file, and add there names of player you want to play on your server, one name on one line:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Portoss&lt;br /&gt;
Zegrr&lt;br /&gt;
Terrinaa&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
After this steps are done, only players listed in whitelist.txt will be able to connect to your server.&lt;br /&gt;
&lt;br /&gt;
To enable blacklist, just create a file &amp;quot;blacklist.txt&amp;quot; next to game executable, and add there names of player, which you don&#039;t want to play with.&lt;br /&gt;
Rules are the same - one name per one line.&lt;br /&gt;
Blacklists are always enabled, so there&#039;s no need to change SettingsServer.xml&lt;br /&gt;
&lt;br /&gt;
===Create a new game===&lt;br /&gt;
When server starts, you can create a new game, or load an existing one.&lt;br /&gt;
To create a new game, type to create a new server:&lt;br /&gt;
&amp;lt;pre&amp;gt;-new [seed_key]&amp;lt;/pre&amp;gt;&lt;br /&gt;
Seed_key is a word, which is used like seed value for random-based generation, like &amp;quot;voidexpance&amp;quot; or &amp;quot;hellyeah&amp;quot;, which will affect world generation on server.&lt;br /&gt;
For example, if you type&lt;br /&gt;
&amp;lt;pre&amp;gt;-new myworld&amp;lt;/pre&amp;gt;&lt;br /&gt;
random world will be created, always the same for &amp;quot;myworld&amp;quot; seed key. And if you type&lt;br /&gt;
&amp;lt;pre&amp;gt;-new hellyeah&amp;lt;/pre&amp;gt;&lt;br /&gt;
random world will be created too, but different from the one you&#039;ll get with &amp;quot;myworld&amp;quot;.&lt;br /&gt;
In other words, seed_key word defines generated world.&lt;br /&gt;
Feel free to experiment, type in you nickname to create your personal world =)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Saving game===&lt;br /&gt;
In multiplayer mode, server automatically saves game every time interval, specified in SettingsServer.xml (autosave_delay parameter).&lt;br /&gt;
You can save server game with console command &#039;&#039;savegame&#039;&#039;.&lt;br /&gt;
&amp;lt;pre&amp;gt;savegame&amp;lt;/pre&amp;gt; - will save you game to slot 0 under the name &amp;quot;CurrentWorld&amp;quot;.&lt;br /&gt;
&amp;lt;pre&amp;gt;savegame 5 ServerNameWord&amp;lt;/pre&amp;gt; - will save you game to slot 5 under the name &amp;quot;ServerNameWord&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Loading game===&lt;br /&gt;
When server starts, you can create a new game, or load an existing one.&lt;br /&gt;
To load an existing game, use command:&lt;br /&gt;
&amp;lt;pre&amp;gt;-load [slot_number]&amp;lt;/pre&amp;gt;&lt;br /&gt;
You can use the same command not only when server starts, but even during the game, just type in console:&lt;br /&gt;
&amp;lt;pre&amp;gt;load 0&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Damonwall</name></author>
	</entry>
	<entry>
		<id>https://wiki.atomictorch.com/index.php?title=VoidExpanse/scope-topic&amp;diff=169</id>
		<title>VoidExpanse/scope-topic</title>
		<link rel="alternate" type="text/html" href="https://wiki.atomictorch.com/index.php?title=VoidExpanse/scope-topic&amp;diff=169"/>
		<updated>2014-04-10T09:08:47Z</updated>

		<summary type="html">&lt;p&gt;Damonwall: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:VoidExpanse/api_scopes]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Scope topic =&lt;br /&gt;
Topic scope is used only inside topic scripts. Controls dialogs and quests.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Visibility:&#039;&#039;&#039; In topics only.&lt;br /&gt;
&lt;br /&gt;
== List of functions ==&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddChoice|&lt;br /&gt;
* int: choice_id&lt;br /&gt;
* string: choice_localisation_id&lt;br /&gt;
* string: choice_text&lt;br /&gt;
* &#039;&#039;(optional) object: parameters&#039;&#039;|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;topic.AddChoice(1, &amp;quot;c001&amp;quot;, &amp;quot;I&#039;d like to pass this one, please.&amp;quot;);&lt;br /&gt;
topic.AddChoice(1, &amp;quot;c001&amp;quot;, &amp;quot;I&#039;d like to pass this %one%, please.&amp;quot;, {one: &amp;quot;hamburger&amp;quot;});&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds a choice to dialog.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddPhrase|&lt;br /&gt;
* string: phrase_localisation_id&lt;br /&gt;
* string: phrase_text&lt;br /&gt;
* object: arguments|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;topic.AddPhrase(&amp;quot;p001&amp;quot;, &amp;quot;Hello, i&#039;m npc!&amp;quot;);&lt;br /&gt;
topic.AddPhrase(&amp;quot;p001&amp;quot;, &amp;quot;Hello, i&#039;m %npc_name%!&amp;quot;,&lt;br /&gt;
		{npc_name: &amp;quot;Scott&amp;quot;});&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds an npc phrase to dialog.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddTopic|&lt;br /&gt;
* string: topic_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;topic.AddTopic(&amp;quot;topic_id_01&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds specified topic to player&#039;s available topics.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RefreshTopics|&lt;br /&gt;
void|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;topic.RefreshTopics();&amp;lt;/pre&amp;gt; |&lt;br /&gt;
List of topics on client is loaded once per conversation. If new topic was added, or the old one removed, this list will be reloaded. But what if state of topic was changed, and current npc shouldn&#039;t have it now, but there&#039;s such topic in player&#039;s list because it was already loaded?&lt;br /&gt;
RefreshTopics reloads current list of topics, testing all of them with CheckRequiments and actualize topic list.&lt;br /&gt;
Can come in handly when single topic manages dialogs with multiple characters in sequence.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|HasTopic|&lt;br /&gt;
* string: topic_id|&lt;br /&gt;
bool: returns whether player already has this topic or not|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var bHasTopic = topic.HasTopic(&amp;quot;topic_id_01&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|HasQuest|&lt;br /&gt;
* string: quest_id|&lt;br /&gt;
bool: returns whether player already has this quest or not|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var bHasQuest = topic.HasQuest(&amp;quot;quest_id_01&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|Bind|&lt;br /&gt;
* string: trigger_name&lt;br /&gt;
* string: function_name&lt;br /&gt;
* object: parametes |&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;topic.Bind(&amp;quot;someTrigger&amp;quot;, &amp;quot;OnSomeTrigger&amp;quot;, { npc_id: &amp;quot;errors&amp;quot; });&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Binds function to a trigger.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|DialogueBreak|&lt;br /&gt;
void|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;topic.DialogueBreak();&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Immediately breaks current dialogue.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetCurrentNpcId|&lt;br /&gt;
void|&lt;br /&gt;
string: current npc id (name)|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var npc_id = topic.GetCurrentNpcId();&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetCurrentNpcShipId|&lt;br /&gt;
void|&lt;br /&gt;
int: current npc&#039;s ship id|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var npc_ship_id = topic.GetCurrentNpcShipId();&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetCurrentShipId|&lt;br /&gt;
void|&lt;br /&gt;
int: current player ship&#039;s ID|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var player_ship_id = topic.GetCurrentShipId();&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Has a global alias - PLAYER_SHIP. It&#039;s better to use alias - faster.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetInput|&lt;br /&gt;
void|&lt;br /&gt;
int: player&#039;s choice id|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var input = topic.GetInput();&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetState|&lt;br /&gt;
void|&lt;br /&gt;
int: topic state|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var state = topic.GetState();&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns current topic state - integer value. Usually state means current progress in questline, but it can be used any way possible.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|InputExists|&lt;br /&gt;
void|&lt;br /&gt;
bool: returns whether player choose something or not|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var bInputExists = topic.InputExists();&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|QuestAddLog|&lt;br /&gt;
* string: quest_id&lt;br /&gt;
* string: entry_id&lt;br /&gt;
* string: quest_text&lt;br /&gt;
* &#039;&#039;(optional) object: args&#039;&#039;|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;topic.QuestAddLog(&amp;quot;some_quest&amp;quot;, &amp;quot;e001&amp;quot;, &amp;quot;I just got this quest into quest log.&amp;quot;);&lt;br /&gt;
topic.QuestAddLog(&amp;quot;some_quest&amp;quot;, &amp;quot;e001&amp;quot;, &amp;quot;I just got this %whaat% into quest log.&amp;quot;,&lt;br /&gt;
	{whaat: &amp;quot;hamburger&amp;quot;});&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|QuestAddMark|&lt;br /&gt;
* string: quest_id&lt;br /&gt;
* int: system_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;topic.QuestAddMark(&amp;quot;some_quest&amp;quot;, 1);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds questmark, that&#039;ll be visible on a galaxy map.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|QuestClearLog|&lt;br /&gt;
* string: quest_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;topic.QuestClearLog(&amp;quot;some_quest&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Clears log of specified quest.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|QuestSetState|&lt;br /&gt;
* string: quest_id&lt;br /&gt;
* int: state|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;topic.QuestSetState(&amp;quot;some_quest&amp;quot;, QuestStatus.Finished);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets state of quest. State can be QuestStatus.Active (0), QuestStatus.Finished (1), QuestStatus.Failed (2). All this constants are defined in any topic. You can use either them, or just numbers - 0,1,2. Status affects in which tab quest displays.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|QuestRemove|&lt;br /&gt;
* string: quest_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;topic.QuestRemove(&amp;quot;some_quest&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes quest completely - after that it won&#039;t appear in any tab.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|QuestRemoveMarkers|&lt;br /&gt;
* string: quest_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;topic.QuestRemoveMarkers(&amp;quot;some_quest&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes all markers of quest.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|QuestRemoveLocalMarkers|&lt;br /&gt;
* string: quest_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;topic.QuestRemoveLocalMarkers(&amp;quot;some_quest&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes all local markers of a quest (object, coordinate). All Galaxy markers persist.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|QuestStart|&lt;br /&gt;
* string: quest_id&lt;br /&gt;
* string: quest_title |&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;topic.QuestStart(&amp;quot;some_quest&amp;quot;, &amp;quot;Rats in the cellar&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Stars quest. After that it will appear in journal, and log messages and markers can be added to it.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RemoveTopic|&lt;br /&gt;
* string: topic_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;topic.RemoveTopic(&amp;quot;topic_id&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes topic completely.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetState|&lt;br /&gt;
* int: state_value|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;topic.SetState(200);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Changes state of current topic.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|Unbind|&lt;br /&gt;
* string: trigger_name&lt;br /&gt;
* string: function_name|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;topic.Unbind(&amp;quot;someTrigger&amp;quot;, &amp;quot;OnSomeTrigger&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Unbinds function from a trigger.&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Damonwall</name></author>
	</entry>
	<entry>
		<id>https://wiki.atomictorch.com/index.php?title=VoidExpanse/scope-generator&amp;diff=168</id>
		<title>VoidExpanse/scope-generator</title>
		<link rel="alternate" type="text/html" href="https://wiki.atomictorch.com/index.php?title=VoidExpanse/scope-generator&amp;diff=168"/>
		<updated>2014-04-10T09:06:10Z</updated>

		<summary type="html">&lt;p&gt;Damonwall: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:VoidExpanse/api_scopes]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Scope generator =&lt;br /&gt;
Used for generation items, objects, systems in game, and also for getting some specific info about them.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Visibility:&#039;&#039;&#039; Global.&lt;br /&gt;
&lt;br /&gt;
== List of functions ==&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddAsteroid|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y&lt;br /&gt;
* string: type - xml id of asteroid&lt;br /&gt;
* double: scale&lt;br /&gt;
* double: resQ - resouces modifier&lt;br /&gt;
* object: rotation&lt;br /&gt;
* object: rotationSpeed |&lt;br /&gt;
int: identifier of created object|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var id = generator.AddAsteroid(1,100,100,&amp;quot;Asteroid01&amp;quot;,1, 0, {x:0,y:0,z:0}, {x:0,y:0,z:0});&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds asteroid with specified parameters into game world. Asteroid contents (extractable resources), asteroid&#039;s look and other parameters&lt;br /&gt;
can be modified only in .xml file, which is specified in this function by parameter &amp;quot;type&amp;quot;. &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddBase|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y&lt;br /&gt;
* string: type - xml id of base&lt;br /&gt;
* string: name&lt;br /&gt;
* &#039;&#039;(optional) object: tags&#039;&#039; |&lt;br /&gt;
int: identifier of created object|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var id = generator.AddBase(1, 100, 100, &amp;quot;Base01&amp;quot;, &amp;quot;Station Horizon&amp;quot;, {class: &amp;quot;order&amp;quot;});&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds space station to game world.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddItem|&lt;br /&gt;
* int: object_id&lt;br /&gt;
* string: item_xml_id&lt;br /&gt;
* int: quantity |&lt;br /&gt;
object:&lt;br /&gt;
* quantity - quantity was actually added&lt;br /&gt;
* type - can be &amp;quot;item&amp;quot; or &amp;quot;resource&amp;quot;|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var obj = generator.AddItem(1, &amp;quot;SomeItem&amp;quot;, 5);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds item to some object&#039;s inventory. In VoidExpanse not all objects do have inventory, so this function must be applied&lt;br /&gt;
only to those, which have it, such as ships, space stations, containers.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddItemToSpecifiedContainer|&lt;br /&gt;
* int: container_id&lt;br /&gt;
* string: item_xml_id&lt;br /&gt;
* int: quantity |&lt;br /&gt;
object:&lt;br /&gt;
* quantity - quantity was actually added&lt;br /&gt;
* type - can be &amp;quot;item&amp;quot; or &amp;quot;resource&amp;quot;|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var obj = generator.AddItemToSpecifiedContainer(1525, &amp;quot;SomeItem&amp;quot;, 5);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Important notice: container_id - is a special, unique in-game identifier for containers, which cannot be obtained by any way through API. Container id can only be obtained as a function parameter in events.&lt;br /&gt;
Currently used in OnInstancedContainerGeneration event. &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GenerateItemsWithItemlist|&lt;br /&gt;
* int: item_list_xml_id|&lt;br /&gt;
array of objects:&lt;br /&gt;
* quantity - quantity was actually added&lt;br /&gt;
* id - xml-id of item|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var items = generator.GenerateItemsWithItemlist(1, &amp;quot;SomeItem&amp;quot;, 5);&lt;br /&gt;
for(var i = 0; i &amp;lt; items.length; i++)&lt;br /&gt;
{&lt;br /&gt;
	generator.AddItemToSpecifiedContainer(&lt;br /&gt;
		args.container_id,&lt;br /&gt;
		items[i].id,&lt;br /&gt;
		items[i].quantity );&lt;br /&gt;
}&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Generates set of items with itemlist. After generation, items can be added to any container.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddContainer|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y&lt;br /&gt;
* string: xml_type&lt;br /&gt;
* string: droplist&lt;br /&gt;
* &#039;&#039;(optional) object: tags&#039;&#039; |&lt;br /&gt;
int: identifier of object created|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var id = generator.AddContainer(1, 0, 0, &amp;quot;Container01&amp;quot;, &amp;quot;DropList01&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds a floating container to game world. By default container is empty. Also containers, which has no contents, are unstable (self-destroyed as soon as&lt;br /&gt;
someone will look at it&#039;s contents), so it&#039;s better not to create empty containers. Content can be added with generator.AddItem function.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddDecoration|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* string: item_xml_id&lt;br /&gt;
* vector2: position&lt;br /&gt;
* double: depth&lt;br /&gt;
* vector2: rotation&lt;br /&gt;
* vector2: rotation_speed,&lt;br /&gt;
* double: scale |&lt;br /&gt;
int: ID of created object|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var id = generator.AddDecoration(1, &amp;quot;Decoration01&amp;quot;, {x:0,y:0}, 100, {x:5, y:5}, {x:5, y:5}, 2);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds a decoration to game world. Decoration is a non-interactive object, which is used as a... decoration.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddJumpgate|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* int: system_to&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y&lt;br /&gt;
* double: angle&lt;br /&gt;
* string: xml_type&lt;br /&gt;
* &#039;&#039;(optional) object: tags&#039;&#039;|&lt;br /&gt;
int: ID of created object|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var id = generator.AddJumpgate(1, 2, 100, 100, 20, &amp;quot;Jumpgate01&amp;quot;, {sometag: &amp;quot;sometag&amp;quot;});&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds a jumpgate - an object, which allows ships to travel between systems. Every jumpgate must be paired with another one,&lt;br /&gt;
for example, if in system A theres a jumpgate, that leads to system B, then in system B must be a jumpgate, that leads to system A.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddNPCShipToSystem|&lt;br /&gt;
* string: npc_name&lt;br /&gt;
* string: behavior - AI-script (&amp;quot;brains&amp;quot;)&lt;br /&gt;
* int: level&lt;br /&gt;
* string: xml_type - npc xml type&lt;br /&gt;
* int: system_id&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y&lt;br /&gt;
* &#039;&#039;(optional) object: tags&#039;&#039;|&lt;br /&gt;
int: ID of created object|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var id = generator.AddNPCShipToSystem(&amp;quot;Pirate&amp;quot;,&lt;br /&gt;
	&amp;quot;PirateAI&amp;quot;, 100, &amp;quot;PirateNpc01&amp;quot;,&lt;br /&gt;
	1, 105, 223, &lt;br /&gt;
	{class: &amp;quot;pirate&amp;quot;, uniq_id: &amp;quot;boss&amp;quot;});&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds an npc ship into game. NPC&#039;s avatar and faction are set through another functions - generator.SetNPCAvatar and relations.SetShipFaction&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|OverrideDropList|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* array: droplists - strings array of droplists|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.OverrideDropList(23303, [&amp;quot;DropList01&amp;quot;, &amp;quot;DropList02&amp;quot;]);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds specified droplists to npc&#039;s droplists list.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddPlanet|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y&lt;br /&gt;
* string: name&lt;br /&gt;
* int: seed |&lt;br /&gt;
int: ID of created object|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var id = generator.AddPlanet(1, 0, 0, &amp;quot;Earth&amp;quot;, 123);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds planet to game world. Planet&#039;s look is driven by seed, based on which planet&#039;s look will be defined&lt;br /&gt;
by random generator. If you want a particular planet, you should either use seed with defined results (by our tool - SeedGenerator), or use another function - AddPlanetWithType.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddPlanetWithType|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y&lt;br /&gt;
* string: name&lt;br /&gt;
* int: seed&lt;br /&gt;
* string: planet_config_type |&lt;br /&gt;
int: ID of created object|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var id = generator.AddPlanetWithType(1, 0, 0, &amp;quot;Earth&amp;quot;, 123, &amp;quot;EarthTypePlanet&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds planet to game world. Planet&#039;s look is driven partially be seed, but mostly by the specified type.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddSpaceObject|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y&lt;br /&gt;
* string: xml_type_id&lt;br /&gt;
* object: tags |&lt;br /&gt;
int: ID of created object|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var id = generator.AddSpaceObject(1, 0, 0, &amp;quot;Debris01&amp;quot;, {class: &amp;quot;mine&amp;quot;})&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds a space object to game world. Space objects are interactive object. They cannot be destroyed, but they are interactive and collision-enabled. For example, spacemines are created with space objects. &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddLever|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y&lt;br /&gt;
* string: xml_type_id&lt;br /&gt;
* int: visible_to&lt;br /&gt;
* object: tags |&lt;br /&gt;
int: ID of created object|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var id = generator.AddLever(1, 0, 0, &amp;quot;Debris01&amp;quot;, 0, {class: &amp;quot;mine&amp;quot;})&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds a lever object to world. Lever - is a special object, which can be activated. Parameter &amp;quot;visible_to&amp;quot; specifies, to whom lever is visible. If 0, it&#039;s visible to all, else - only to specified ship. Useful when you need to create a special object only to a man, who took the quest.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddStar|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y&lt;br /&gt;
* int: seed&lt;br /&gt;
* int: heat - how much damage star deals, when ship approaches&lt;br /&gt;
* &#039;&#039;(optional) string: typeID&#039;&#039;&lt;br /&gt;
|&lt;br /&gt;
int: ID of created object|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var id = generator.AddStar(1, 0, 0, 234, 0)&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds a star. Conventionally, you shouldn&#039;t add more then 1 star to a system.&lt;br /&gt;
If typeID is not specified, type will be picked by random, based on seed parameter.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddSystem|&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y&lt;br /&gt;
* string: name&lt;br /&gt;
* int: seed|&lt;br /&gt;
int: ID of created system|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var id = generator.AddSystem(0, 0, &amp;quot;Hawkins Eta&amp;quot;, 123)&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds a star system. Star system can be added anywhere, and by default it won&#039;t be connected to any other systems. See tutorial to see, how systems generation works.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetSystemTags|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* object: tags|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.SetSystemTags(1, {&amp;quot;show_clouds&amp;quot;: &amp;quot;yes&amp;quot;})&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets tags of specified star system. Can be expanded with generator.AddSystemTag and retrieved by&lt;br /&gt;
generator.GetSystemTags.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddSystemTag|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* string: name&lt;br /&gt;
* object: value|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.AddSystemTag(1, &amp;quot;show_clouds&amp;quot;, &amp;quot;yes&amp;quot;)&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds tag to star system tags (or overwrites existing one with the same name).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetSystemTags|&lt;br /&gt;
* int: system_id|&lt;br /&gt;
object: tags set by methods above|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var tags = generator.GetSystemTags(1);&lt;br /&gt;
if(tags != null &amp;amp;&amp;amp; tags[&amp;quot;show_clouds&amp;quot;] == &amp;quot;yes&amp;quot;)&lt;br /&gt;
{&lt;br /&gt;
	console.Print(&amp;quot;System 1 was told to show clouds&amp;quot;);&lt;br /&gt;
}&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Retrieves tags of star system, which were set by SetSystemTags and AddSystemTag.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddAnomaly|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* string: anomaly_id&lt;br /&gt;
* object: args |&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.AddAnomaly(args.sys_id, &amp;quot;radar_disable&amp;quot;, {});&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds anomaly to star system. There are few predefined anomalies (see more in the article [[VoidExpanse/anomalies|Anomalies]]), but you can specify and implement your own anomalies.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SystemClose|&lt;br /&gt;
* int: system_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.SystemClose(20);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets system status to closed. Can be used anywhere, has no hardcoded implementation. For example, now&lt;br /&gt;
it&#039;s being used to prevent player to travel to alien systems. System can be opened with generator.SystemOpen.&lt;br /&gt;
All systems are opened by default.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SystemOpen|&lt;br /&gt;
* int: system_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.SystemOpen(20);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets system status to opened. Can be used anywhere, has no hardcoded implementation. For example, now&lt;br /&gt;
it&#039;s being used to prevent player to travel to alien systems. System can be closed with generator.SystemClose.&lt;br /&gt;
All systems are opened by default.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|IsSystemClosed|&lt;br /&gt;
* int: system_id|&lt;br /&gt;
bool|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var closed = generator.IsSystemClosed(20);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Check whether system is closed or not.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|CountNpcInSystemByTags|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* object: tags|&lt;br /&gt;
int|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var numOfPirates= generator.CountNpcInSystemByTags(20, {class: &amp;quot;pirate&amp;quot;});&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Counts npcs with specified tags in specified system.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|ClearDropList|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.ClearDropList(20025);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Clears droplist of a specified NPC.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetSystemPlaylists|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* object: key-&amp;gt;value object|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.SetSystemPlaylists(args.sys_id,&lt;br /&gt;
				{&lt;br /&gt;
					&amp;quot;explore&amp;quot;: &amp;quot;playlist_generic_explore&amp;quot;,&lt;br /&gt;
					&amp;quot;combat&amp;quot;: &amp;quot;playlist_generic_combat&amp;quot;&lt;br /&gt;
				}&lt;br /&gt;
			);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets system music playlists. There are few possible keys, see more in [[VoidExpanse/MusicPlaylists|MusicPlaylists]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddSystemsLink|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* int: system_2_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.AddSystemsLink(1,2);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
This function creates a link between two systems. This links are simply logical, but there are&lt;br /&gt;
few hardcoded rules about them. There are some specific rules, that are applied to every link:&lt;br /&gt;
* Duplication - cannot create a link between already linked systems&lt;br /&gt;
* Future Linking - cannot create a link between systems, that aren&#039;t exist yet&lt;br /&gt;
* Proximity - link cannot pass closer then 2 units to a star&lt;br /&gt;
* Intersections - link cannot intersect any other link&lt;br /&gt;
Links created this way are displayed on galaxy map. By this links jumpgates are created (though, there is no hard rule about that - you can create jumpgate without link between two star systems, but this connection won&#039;t be displayed on galaxy map).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|FixConnectivity|&lt;br /&gt;
void|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.FixConnectivity();&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Should be called after all stars and links were created. It checks, if all stars are reachable from one another, and, if not, it creates missing star systems links.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|DockShipToBase|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* int: base_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.DockShipToBase(12253,2);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Immediately, without any animations, checkups and routines, docks ship to a space station. It&#039;s better not to use it on players, because it&#039;ll have unpredictable behavior.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|ExpandArea|&lt;br /&gt;
* array: array of stars IDs |&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var stars = [3];&lt;br /&gt;
while(true)&lt;br /&gt;
{&lt;br /&gt;
	stars = generator.ExpandArea(stars);&lt;br /&gt;
	if(newstars.length &amp;gt;= 10) break;&lt;br /&gt;
}&lt;br /&gt;
console.Print(&amp;quot;Now we have an area of 10 or more stars around star with id 3&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Function, which returns the same array, as input + all stars, which are linked to input ones by 1 link. In other words, it returns an area, expanded by 1 link. Very useful during generation of zones in galaxy, such as faction territories.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetAllSystems|&lt;br /&gt;
void|&lt;br /&gt;
array: IDs of all systems|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var arr = generator.GetAllSystems();&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetAsteroidTypes|&lt;br /&gt;
void|&lt;br /&gt;
array: xml_ids (strings) of all asteroids|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var arr = generator.GetAsteroidTypes();&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetClosestSystemToPoint|&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y|&lt;br /&gt;
int: ID of picked system of 0, if none|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var sys_id = generator.GetClosestSystemToPoint(0,0);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Useful during generation process.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetDebrisTypes|&lt;br /&gt;
void|&lt;br /&gt;
array: xml_ids (strings) of all space objects|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var arr = generator.GetDebrisTypes();&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Useful during generation process. Alias of generator.GetSpaceObjectsTypes.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetSpaceObjectsTypes|&lt;br /&gt;
void|&lt;br /&gt;
array: xml_ids (strings) of all space objects|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var arr = generator.GetSpaceObjectsTypes();&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Useful during generation process. The same as generator.GetDebrisTypes.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetIntersection|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y |&lt;br /&gt;
string: intersection in format &amp;quot;coord_x;coord_y&amp;quot; or empty string|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var intersection = generator.GetIntersection(0, 15, 15);&lt;br /&gt;
if(intersection.length &amp;gt; 0)&lt;br /&gt;
{&lt;br /&gt;
	var arr = intersection.split(&#039;;&#039;);&lt;br /&gt;
	console.Print(&amp;quot;Intersection was found: point X:&amp;quot; + arr[0] +&amp;quot;, Y:&amp;quot; + arr[1]);&lt;br /&gt;
}&amp;lt;/pre&amp;gt; |&lt;br /&gt;
The function answers the question: if a put a link between system with specified id and point with&lt;br /&gt;
coordinates coord_x;coord_y, will it intersect any other links? Useful during galaxy generation process.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetJumpsBetweenSystems|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* int: system_2_id|&lt;br /&gt;
int: number of jumps|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var jumps = generator.GetJumpsBetweenSystems(1,1000);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns length (number of links) of the minimal way between two systems.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetLinkedSystems|&lt;br /&gt;
* int: sys_id|&lt;br /&gt;
array: IDs of systems|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var arr = generator.GetLinkedSystems(1);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns an array with IDs of all systems linked to the specified one.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetMinDistanceToSystem|&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y|&lt;br /&gt;
double: distance to the closest system (or maximum double value if none)|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var dist = generator.GetLinkedSystems(1);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Return distance to the closest system to a specified point.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetNumberOfLinks|&lt;br /&gt;
* int: system_id|&lt;br /&gt;
int: number of links to specified system|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var links = generator.GetNumberOfLinks(1);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetPlanetCoordinates|&lt;br /&gt;
* int: planet_id|&lt;br /&gt;
vector2: coordinates of a planet|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var coords = generator.GetPlanetCoordinates(242);&lt;br /&gt;
console.Print(&amp;quot;Planet coordinates: X:&amp;quot; + coords.x + &amp;quot;, Y:&amp;quot; + coords.y);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns coordinates of specified planet.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetRandomPlanetInSystem|&lt;br /&gt;
* int: system_id|&lt;br /&gt;
int: ID of a planet|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var id = generator.GetRandomPlanetInSystem(1);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns ID of random planet in system (or 0 if there are no planets).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetSystemPlanets|&lt;br /&gt;
* int: system_id|&lt;br /&gt;
array: IDs of planets|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var arr = generator.GetSystemPlanets(1);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns an array with IDs of all planets in system.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetSystemByID|&lt;br /&gt;
* int: system_id|&lt;br /&gt;
object:&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y&lt;br /&gt;
* int: seed&lt;br /&gt;
* string: faction&lt;br /&gt;
* int: danger_level&lt;br /&gt;
* int: tech_level&lt;br /&gt;
* string: name|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var obj = generator.GetSystemByID(1);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns basic info about specified system. Tags of star system can be gained with generator.GetSystemTags.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetBaseByID|&lt;br /&gt;
* int: base_id|&lt;br /&gt;
object:&lt;br /&gt;
* string: faction&lt;br /&gt;
* int: tech_level&lt;br /&gt;
* string: name&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var obj = generator.GetBaseByID(1);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns space station basic description. Tags cannot be retrieved with this function - use game.GetTags instead.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetSystemsByDistanceTo|&lt;br /&gt;
* int: system_id|&lt;br /&gt;
array: IDs of systems|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var arr = generator.GetSystemsByDistanceTo(1);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns an array with IDs of systems, which are sorted by distance to specified system. Specified system is included into resulting array.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetAllResources|&lt;br /&gt;
void|&lt;br /&gt;
array: xml_ids (strings) of resources|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var arr = generator.GetAllResources();&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns an array of all resources of VoidExpanse.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetResourcesWithFlags|&lt;br /&gt;
* array of strings: flags|&lt;br /&gt;
array: xml_ids (strings) of resources|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var arr = generator.GetResourcesWithFlags([&amp;quot;mineable&amp;quot;, &amp;quot;highlevel&amp;quot;]);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns an array of resources of VoidExpanse, contains all specified flags in it&#039;s XML description.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetResourceByID|&lt;br /&gt;
* string: xml_id|&lt;br /&gt;
object:&lt;br /&gt;
* double: price - standard price of this item&lt;br /&gt;
* int: shops_level - level of shops in which this resource should be sold&lt;br /&gt;
* string: name - name of resource&lt;br /&gt;
* string: id - xml id of resource|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var obj = generator.GetResourceByID(&amp;quot;Resource01&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns a description of a resource by it&#039;s xml_id.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetItemByXmlID|&lt;br /&gt;
* string: xml_id|&lt;br /&gt;
object:&lt;br /&gt;
* double: price - standard price of this item&lt;br /&gt;
* int: shops_level - level of shops in which this resource should be sold&lt;br /&gt;
* string: name - name of resource&lt;br /&gt;
* string: id - xml id of resource|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var obj = generator.GetItemByXmlID(&amp;quot;Item01&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns a description of an item by it&#039;s xml_id.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RemoveAsteroid|&lt;br /&gt;
* int: asteroid_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.RemoveAsteroid(123);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes asteroid from a game world.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RemoveBase|&lt;br /&gt;
* int: base_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.RemoveBase(123);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes base (space station) from a game world.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RemoveDecoration|&lt;br /&gt;
* int: decoration_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.RemoveDecoration(123);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes decoration from a game world.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RemoveJumpgate|&lt;br /&gt;
* int: jumpgate_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.RemoveJumpgate(123);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes a jumpgate from a game world.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RemovePlanet|&lt;br /&gt;
* int: planet_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.RemovePlanet(123);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes a planet from a game world.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RemoveSpaceObject|&lt;br /&gt;
* int: space_object_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.RemoveSpaceObject(123);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes a space object from a game world.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RemoveLever|&lt;br /&gt;
* int: lever_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.RemoveLever(123);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes specified lever from a game world.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RemoveStar|&lt;br /&gt;
* int: star_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.RemoveStar(123);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes a star from a game world.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RemoveSystemsLink|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* int: system_2_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.RemoveSystemsLink(1,2);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes a link between two systems.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|ReportLoadingPhase|&lt;br /&gt;
* string: phase|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.ReportLoadingPhase(&amp;quot;Loading galaxy&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds message to singleplayer client with loader (then to alter loader use generator.ReportLoadingProgress).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|ReportLoadingPhaseNoLoader|&lt;br /&gt;
* string: phase|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.ReportLoadingPhaseNoLoader(&amp;quot;Loading galaxy&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds message to singleplayer client.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|ReportLoadingProgress|&lt;br /&gt;
* double: percent - a value from 0 to 1|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.ReportLoadingProgress(0.5);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds message to singleplayer client.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetNPCAvatar|&lt;br /&gt;
* int: npc_ship_id&lt;br /&gt;
* object: avatar parameters|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.SetNPCAvatar(12553, [1,2,3,4,5,6]);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets npc avatar.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetSystemDangerLevel|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* int: danger_level - from 0 to 100|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.SetSystemDangerLevel(1, 99);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Set star system danger level. Danger level usually affects a level of system&#039;s npc and many other parameters.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetSystemTechLevel|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* int: tech_level - from 0 to 100|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.SetSystemTechLevel(1, 99);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Set star system tech level. Tech level usually affects shops store items.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|ShipExists|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
bool: whether ship exists or not|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.ShipExists(12552);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Damonwall</name></author>
	</entry>
	<entry>
		<id>https://wiki.atomictorch.com/index.php?title=VoidExpanse/scope-generator&amp;diff=167</id>
		<title>VoidExpanse/scope-generator</title>
		<link rel="alternate" type="text/html" href="https://wiki.atomictorch.com/index.php?title=VoidExpanse/scope-generator&amp;diff=167"/>
		<updated>2014-04-10T09:04:14Z</updated>

		<summary type="html">&lt;p&gt;Damonwall: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:VoidExpanse/api_scopes]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Scope generator =&lt;br /&gt;
Used for generation items, objects, systems in game, and also for getting some specific info about them.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Visibility:&#039;&#039;&#039; Global.&lt;br /&gt;
&lt;br /&gt;
== List of functions ==&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddAsteroid|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y&lt;br /&gt;
* string: type - xml id of asteroid&lt;br /&gt;
* double: scale&lt;br /&gt;
* double: resQ - resouces modifier&lt;br /&gt;
* object: rotation&lt;br /&gt;
* object: rotationSpeed |&lt;br /&gt;
int: identifier of created object|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var id = generator.AddAsteroid(1,100,100,&amp;quot;Asteroid01&amp;quot;,1, 0, {x:0,y:0,z:0}, {x:0,y:0,z:0});&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds asteroid with specified parameters into game world. Asteroid contents (extractable resources), asteroid&#039;s look and other parameters&lt;br /&gt;
can be modified only in .xml file, which is specified in this function by parameter &amp;quot;type&amp;quot;. &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddBase|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y&lt;br /&gt;
* string: type - xml id of base&lt;br /&gt;
* string: name&lt;br /&gt;
* &#039;&#039;(optional) object: tags&#039;&#039; |&lt;br /&gt;
int: identifier of created object|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var id = generator.AddBase(1, 100, 100, &amp;quot;Base01&amp;quot;, &amp;quot;Station Horizon&amp;quot;, {class: &amp;quot;order&amp;quot;});&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds space station to game world.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddItem|&lt;br /&gt;
* int: object_id&lt;br /&gt;
* string: item_xml_id&lt;br /&gt;
* int: quantity |&lt;br /&gt;
object:&lt;br /&gt;
* quantity - quantity was actually added&lt;br /&gt;
* type - can be &amp;quot;item&amp;quot; or &amp;quot;resource&amp;quot;|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var obj = generator.AddItem(1, &amp;quot;SomeItem&amp;quot;, 5);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds item to some object&#039;s inventory. In VoidExpanse not all objects do have inventory, so this function must be applied&lt;br /&gt;
only to those, which have it, such as ships, space stations, containers.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddItemToSpecifiedContainer|&lt;br /&gt;
* int: container_id&lt;br /&gt;
* string: item_xml_id&lt;br /&gt;
* int: quantity |&lt;br /&gt;
object:&lt;br /&gt;
* quantity - quantity was actually added&lt;br /&gt;
* type - can be &amp;quot;item&amp;quot; or &amp;quot;resource&amp;quot;|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var obj = generator.AddItemToSpecifiedContainer(1525, &amp;quot;SomeItem&amp;quot;, 5);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Important notice: container_id - is a special, unique in-game identifier for containers, which cannot be obtained by any way through API. Container id can only be obtained as a function parameter in events.&lt;br /&gt;
Currently used in OnInstancedContainerGeneration event. &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GenerateItemsWithItemlist|&lt;br /&gt;
* int: item_list_xml_id|&lt;br /&gt;
array of objects:&lt;br /&gt;
* quantity - quantity was actually added&lt;br /&gt;
* id - xml-id of item|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var items = generator.GenerateItemsWithItemlist(1, &amp;quot;SomeItem&amp;quot;, 5);&lt;br /&gt;
for(var i = 0; i &amp;lt; items.length; i++)&lt;br /&gt;
{&lt;br /&gt;
	generator.AddItemToSpecifiedContainer(&lt;br /&gt;
		args.container_id,&lt;br /&gt;
		items[i].id,&lt;br /&gt;
		items[i].quantity );&lt;br /&gt;
}&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Generates set of items with itemlist. After generation, items can be added to any container.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddContainer|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y&lt;br /&gt;
* string: xml_type&lt;br /&gt;
* string: droplist&lt;br /&gt;
* &#039;&#039;(optional) object: tags&#039;&#039; |&lt;br /&gt;
int: identifier of object created|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var id = generator.AddContainer(1, 0, 0, &amp;quot;Container01&amp;quot;, &amp;quot;DropList01&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds a floating container to game world. By default container is empty. Also containers, which has no contents, are unstable (self-destroyed as soon as&lt;br /&gt;
someone will look at it&#039;s contents), so it&#039;s better not to create empty containers. Content can be added with generator.AddItem function.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddDecoration|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* string: item_xml_id&lt;br /&gt;
* vector2: position&lt;br /&gt;
* double: depth&lt;br /&gt;
* vector2: rotation&lt;br /&gt;
* vector2: rotation_speed,&lt;br /&gt;
* double: scale |&lt;br /&gt;
int: ID of created object|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var id = generator.AddDecoration(1, &amp;quot;Decoration01&amp;quot;, {x:0,y:0}, 100, {x:5, y:5}, {x:5, y:5}, 2);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds a decoration to game world. Decoration is a non-interactive object, which is used as a... decoration.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddJumpgate|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* int: system_to&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y&lt;br /&gt;
* double: angle&lt;br /&gt;
* string: xml_type&lt;br /&gt;
* &#039;&#039;(optional) object: tags&#039;&#039;|&lt;br /&gt;
int: ID of created object|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var id = generator.AddJumpgate(1, 2, 100, 100, 20, &amp;quot;Jumpgate01&amp;quot;, {sometag: &amp;quot;sometag&amp;quot;});&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds a jumpgate - an object, which allows ships to travel between systems. Every jumpgate must be paired with another one,&lt;br /&gt;
for example, if in system A theres a jumpgate, that leads to system B, then in system B must be a jumpgate, that leads to system A.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddNPCShipToSystem|&lt;br /&gt;
* string: npc_name&lt;br /&gt;
* string: behavior - AI-script (&amp;quot;brains&amp;quot;)&lt;br /&gt;
* int: level&lt;br /&gt;
* string: xml_type - npc xml type&lt;br /&gt;
* int: system_id&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y&lt;br /&gt;
* &#039;&#039;(optional) object: tags&#039;&#039;|&lt;br /&gt;
int: ID of created object|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var id = generator.AddNPCShipToSystem(&amp;quot;Pirate&amp;quot;,&lt;br /&gt;
	&amp;quot;PirateAI&amp;quot;, 100, &amp;quot;PirateNpc01&amp;quot;,&lt;br /&gt;
	1, 105, 223, &lt;br /&gt;
	{class: &amp;quot;pirate&amp;quot;, uniq_id: &amp;quot;boss&amp;quot;});&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds an npc ship into game. NPC&#039;s avatar and faction are set through another functions - generator.SetNPCAvatar and relations.SetShipFaction&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|OverrideDropList|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* array: droplists - strings array of droplists|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.OverrideDropList(23303, [&amp;quot;DropList01&amp;quot;, &amp;quot;DropList02&amp;quot;]);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds specified droplists to npc&#039;s droplists list.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddPlanet|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y&lt;br /&gt;
* string: name&lt;br /&gt;
* int: seed |&lt;br /&gt;
int: ID of created object|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var id = generator.AddPlanet(1, 0, 0, &amp;quot;Earth&amp;quot;, 123);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds planet to game world. Planet&#039;s look is driven by seed, based on which planet&#039;s look will be defined&lt;br /&gt;
by random generator. If you want a particular planet, you should either use seed with defined results (by our tool - SeedGenerator), or use another function - AddPlanetWithType.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddPlanetWithType|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y&lt;br /&gt;
* string: name&lt;br /&gt;
* int: seed&lt;br /&gt;
* string: planet_config_type |&lt;br /&gt;
int: ID of created object|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var id = generator.AddPlanetWithType(1, 0, 0, &amp;quot;Earth&amp;quot;, 123, &amp;quot;EarthTypePlanet&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds planet to game world. Planet&#039;s look is driven partially be seed, but mostly by the specified type.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddSpaceObject|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y&lt;br /&gt;
* string: xml_type_id&lt;br /&gt;
* object: tags |&lt;br /&gt;
int: ID of created object|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var id = generator.AddSpaceObject(1, 0, 0, &amp;quot;Debris01&amp;quot;, {class: &amp;quot;mine&amp;quot;})&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds a space object to game world. Space objects are interactive object. They cannot be destroyed, but they are interactive and collision-enabled. For example, spacemines are created with space objects. &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddLever|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y&lt;br /&gt;
* string: xml_type_id&lt;br /&gt;
* int: visible_to&lt;br /&gt;
* object: tags |&lt;br /&gt;
int: ID of created object|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var id = generator.AddLever(1, 0, 0, &amp;quot;Debris01&amp;quot;, 0, {class: &amp;quot;mine&amp;quot;})&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds a lever object to world. Lever - is a special object, which can be activated. Parameter &amp;quot;visible_to&amp;quot; specifies, to whom lever is visible. If 0, it&#039;s visible to all, else - only to specified ship. Useful when you need to create a special object only to a man, who took the quest.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddStar|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y&lt;br /&gt;
* int: seed&lt;br /&gt;
* int: heat - how much damage star deals, when ship approaches&lt;br /&gt;
* &#039;&#039;(optional) string: typeID&#039;&#039;&lt;br /&gt;
|&lt;br /&gt;
int: ID of created object|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var id = generator.AddStar(1, 0, 0, 234, 0)&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds a star. Conventionally, you shouldn&#039;t add more then 1 star to a system.&lt;br /&gt;
If typeID is not specified, type will be picked by random, based on seed parameter.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddSystem|&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y&lt;br /&gt;
* string: name&lt;br /&gt;
* int: seed|&lt;br /&gt;
int: ID of created system|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var id = generator.AddSystem(0, 0, &amp;quot;Hawkins Eta&amp;quot;, 123)&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds a star system. Star system can be added anywhere, and by default it won&#039;t be connected to any other systems. See tutorial to see, how systems generation works.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetSystemTags|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* object: tags|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.SetSystemTags(1, {&amp;quot;show_clouds&amp;quot;: &amp;quot;yes&amp;quot;})&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets tags of specified star system. Can be expanded with generator.AddSystemTag and retrieved by&lt;br /&gt;
generator.GetSystemTags.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddSystemTag|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* string: name&lt;br /&gt;
* object: value|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.AddSystemTag(1, &amp;quot;show_clouds&amp;quot;, &amp;quot;yes&amp;quot;)&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds tag to star system tags (or overwrites existing one with the same name).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetSystemTags|&lt;br /&gt;
* int: system_id|&lt;br /&gt;
object: tags set by methods above|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var tags = generator.GetSystemTags(1);&lt;br /&gt;
if(tags != null &amp;amp;&amp;amp; tags[&amp;quot;show_clouds&amp;quot;] == &amp;quot;yes&amp;quot;)&lt;br /&gt;
{&lt;br /&gt;
	console.Print(&amp;quot;System 1 was told to show clouds&amp;quot;);&lt;br /&gt;
}&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Retrieves tags of star system, which were set by SetSystemTags and AddSystemTag.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddAnomaly|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* string: anomaly_id&lt;br /&gt;
* object: args |&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.AddAnomaly(args.sys_id, &amp;quot;radar_disable&amp;quot;, {});&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds anomaly to star system. There are few predefined anomalies (see more in the article [[VoidExpanse/anomalies|Anomalies]]), but you can specify and implement your own anomalies.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SystemClose|&lt;br /&gt;
* int: system_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.SystemClose(20);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets system status to closed. Can be used anywhere, has no hardcoded implementation. For example, now&lt;br /&gt;
it&#039;s being used to prevent player to travel to alien systems. System can be opened with generator.SystemOpen.&lt;br /&gt;
All systems are opened by default.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SystemOpen|&lt;br /&gt;
* int: system_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.SystemOpen(20);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets system status to opened. Can be used anywhere, has no hardcoded implementation. For example, now&lt;br /&gt;
it&#039;s being used to prevent player to travel to alien systems. System can be closed with generator.SystemClose.&lt;br /&gt;
All systems are opened by default.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|IsSystemClosed|&lt;br /&gt;
* int: system_id|&lt;br /&gt;
bool|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var closed = generator.IsSystemClosed(20);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Check whether system is closed or not.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|CountNpcInSystemByTags|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* object: tags|&lt;br /&gt;
int|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var numOfPirates= generator.CountNpcInSystemByTags(20, {class: &amp;quot;pirate&amp;quot;});&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Counts npcs with specified tags in specified system.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|ClearDropList|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.ClearDropList(20025);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Clears droplist of a specified NPC.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetSystemPlaylists|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* object: key-&amp;gt;value object|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.SetSystemPlaylists(args.sys_id,&lt;br /&gt;
				{&lt;br /&gt;
					&amp;quot;explore&amp;quot;: &amp;quot;playlist_generic_explore&amp;quot;,&lt;br /&gt;
					&amp;quot;combat&amp;quot;: &amp;quot;playlist_generic_combat&amp;quot;&lt;br /&gt;
				}&lt;br /&gt;
			);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets system music playlists. There are few possible keys, see more in [[VoidExpanse/MusicPlaylists|MusicPlaylists]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddSystemsLink|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* int: system_2_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.AddSystemsLink(1,2);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
This function creates a link between two systems. This links are simply logical, but there are&lt;br /&gt;
few hardcoded rules about them. There are some specific rules, that are applied to every link:&lt;br /&gt;
* Duplication - cannot create a link between already linked systems&lt;br /&gt;
* Future Linking - cannot create a link between systems, that aren&#039;t exist yet&lt;br /&gt;
* Proximity - link cannot pass closer then 2 units to a star&lt;br /&gt;
* Intersections - link cannot intersect any other link&lt;br /&gt;
Links created this way are displayed on galaxy map. By this links jumpgates are created (though, there is no hard rule about that - you can create jumpgate without link between two star systems, but this connection won&#039;t be displayed on galaxy map).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|FixConnectivity|&lt;br /&gt;
void|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.FixConnectivity();&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Should be called after all stars and links were created. It checks, if all stars are reachable from one another, and, if not, it creates missing star systems links.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|DockShipToBase|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* int: base_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.DockShipToBase(12253,2);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Immediately, without any animations, checkups and routines, docks ship to a space station. It&#039;s better not to use it on players, because it&#039;ll have unpredictable behavior.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|ExpandArea|&lt;br /&gt;
* array: array of stars IDs |&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var stars = [3];&lt;br /&gt;
while(true)&lt;br /&gt;
{&lt;br /&gt;
	stars = generator.ExpandArea(stars);&lt;br /&gt;
	if(newstars.length &amp;gt;= 10) break;&lt;br /&gt;
}&lt;br /&gt;
console.Print(&amp;quot;Now we have an area of 10 or more stars around star with id 3&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Function, which returns the same array, as input + all stars, which are linked to input ones by 1 link. In other words, it returns an area, expanded by 1 link. Very useful during generation of zones in galaxy, such as faction territories.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetAllSystems|&lt;br /&gt;
void|&lt;br /&gt;
array: IDs of all systems|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var arr = generator.GetAllSystems();&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetAsteroidTypes|&lt;br /&gt;
void|&lt;br /&gt;
array: xml_ids (strings) of all asteroids|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var arr = generator.GetAsteroidTypes();&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetClosestSystemToPoint|&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y|&lt;br /&gt;
int: ID of picked system of 0, if none|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var sys_id = generator.GetClosestSystemToPoint(0,0);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Useful during generation process.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetDebrisTypes|&lt;br /&gt;
void|&lt;br /&gt;
array: xml_ids (strings) of all space objects|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var arr = generator.GetDebrisTypes();&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Useful during generation process. Alias of generator.GetSpaceObjectsTypes.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetSpaceObjectsTypes|&lt;br /&gt;
void|&lt;br /&gt;
array: xml_ids (strings) of all space objects|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var arr = generator.GetSpaceObjectsTypes();&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Useful during generation process. The same as generator.GetDebrisTypes.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetIntersection|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y |&lt;br /&gt;
string: intersection in format &amp;quot;coord_x;coord_y&amp;quot; or empty string|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var intersection = generator.GetIntersection(0, 15, 15);&lt;br /&gt;
if(intersection.length &amp;gt; 0)&lt;br /&gt;
{&lt;br /&gt;
	var arr = intersection.split(&#039;;&#039;);&lt;br /&gt;
	console.Print(&amp;quot;Intersection was found: point X:&amp;quot; + arr[0] +&amp;quot;, Y:&amp;quot; + arr[1]);&lt;br /&gt;
}&amp;lt;/pre&amp;gt; |&lt;br /&gt;
The function answers the question: if a put a link between system with specified id and point with&lt;br /&gt;
coordinates coord_x;coord_y, will it intersect any other links? Useful during galaxy generation process.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetJumpsBetweenSystems|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* int: system_2_id|&lt;br /&gt;
int: number of jumps|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var jumps = generator.GetJumpsBetweenSystems(1,1000);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns length (number of links) of the minimal way between two systems.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetLinkedSystems|&lt;br /&gt;
* int: sys_id|&lt;br /&gt;
array: IDs of systems|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var arr = generator.GetLinkedSystems(1);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns an array with IDs of all systems linked to the specified one.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetMinDistanceToSystem|&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y|&lt;br /&gt;
double: distance to the closest system (or maximum double value if none)|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var dist = generator.GetLinkedSystems(1);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Return distance to the closest system to a specified point.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetNumberOfLinks|&lt;br /&gt;
* int: system_id|&lt;br /&gt;
int: number of links to specified system|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var links = generator.GetNumberOfLinks(1);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetPlanetCoordinates|&lt;br /&gt;
* int: planet_id|&lt;br /&gt;
vector2: coordinates of a planet|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var coords = generator.GetPlanetCoordinates(242);&lt;br /&gt;
console.Print(&amp;quot;Planet coordinates: X:&amp;quot; + coords.x + &amp;quot;, Y:&amp;quot; + coords.y);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns coordinates of specified planet.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetRandomPlanetInSystem|&lt;br /&gt;
* int: system_id|&lt;br /&gt;
int: ID of a planet|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var id = generator.GetRandomPlanetInSystem(1);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns ID of random planet in system (or 0 if there are no planets).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetSystemPlanets|&lt;br /&gt;
* int: system_id|&lt;br /&gt;
array: IDs of planets|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var arr = generator.GetSystemPlanets(1);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns an array with IDs of all planets in system.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetSystemByID|&lt;br /&gt;
* int: system_id|&lt;br /&gt;
object:&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y&lt;br /&gt;
* int: seed&lt;br /&gt;
* string: faction&lt;br /&gt;
* int: danger_level&lt;br /&gt;
* int: tech_level&lt;br /&gt;
* string: name|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var obj = generator.GetSystemByID(1);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns basic info about specified system. Tags of star system can be gained with generator.GetSystemTags.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetBaseByID|&lt;br /&gt;
* int: base_id|&lt;br /&gt;
object:&lt;br /&gt;
* string: faction&lt;br /&gt;
* int: tech_level&lt;br /&gt;
* string: name&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var obj = generator.GetBaseByID(1);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns space station basic description. Tags cannot be retrieved with this function - use game.GetTags instead.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetSystemsByDistanceTo|&lt;br /&gt;
* int: system_id|&lt;br /&gt;
array: IDs of systems|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var arr = generator.GetSystemsByDistanceTo(1);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns an array with IDs of systems, which are sorted by distance to specified system. Specified system is included into resulting array.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetAllResources|&lt;br /&gt;
void|&lt;br /&gt;
array: xml_ids (strings) of resources|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var arr = generator.GetAllResources();&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns an array of all resources of VoidExpanse.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetResourceByID|&lt;br /&gt;
* string: xml_id|&lt;br /&gt;
object:&lt;br /&gt;
* double: price - standard price of this item&lt;br /&gt;
* int: shops_level - level of shops in which this resource should be sold&lt;br /&gt;
* string: name - name of resource&lt;br /&gt;
* string: id - xml id of resource|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var obj = generator.GetResourceByID(&amp;quot;Resource01&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns a description of a resource by it&#039;s xml_id.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetItemByXmlID|&lt;br /&gt;
* string: xml_id|&lt;br /&gt;
object:&lt;br /&gt;
* double: price - standard price of this item&lt;br /&gt;
* int: shops_level - level of shops in which this resource should be sold&lt;br /&gt;
* string: name - name of resource&lt;br /&gt;
* string: id - xml id of resource|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var obj = generator.GetItemByXmlID(&amp;quot;Item01&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns a description of an item by it&#039;s xml_id.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RemoveAsteroid|&lt;br /&gt;
* int: asteroid_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.RemoveAsteroid(123);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes asteroid from a game world.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RemoveBase|&lt;br /&gt;
* int: base_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.RemoveBase(123);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes base (space station) from a game world.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RemoveDecoration|&lt;br /&gt;
* int: decoration_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.RemoveDecoration(123);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes decoration from a game world.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RemoveJumpgate|&lt;br /&gt;
* int: jumpgate_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.RemoveJumpgate(123);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes a jumpgate from a game world.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RemovePlanet|&lt;br /&gt;
* int: planet_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.RemovePlanet(123);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes a planet from a game world.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RemoveSpaceObject|&lt;br /&gt;
* int: space_object_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.RemoveSpaceObject(123);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes a space object from a game world.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RemoveLever|&lt;br /&gt;
* int: lever_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.RemoveLever(123);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes specified lever from a game world.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RemoveStar|&lt;br /&gt;
* int: star_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.RemoveStar(123);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes a star from a game world.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RemoveSystemsLink|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* int: system_2_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.RemoveSystemsLink(1,2);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes a link between two systems.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|ReportLoadingPhase|&lt;br /&gt;
* string: phase|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.ReportLoadingPhase(&amp;quot;Loading galaxy&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds message to singleplayer client with loader (then to alter loader use generator.ReportLoadingProgress).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|ReportLoadingPhaseNoLoader|&lt;br /&gt;
* string: phase|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.ReportLoadingPhaseNoLoader(&amp;quot;Loading galaxy&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds message to singleplayer client.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|ReportLoadingProgress|&lt;br /&gt;
* double: percent - a value from 0 to 1|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.ReportLoadingProgress(0.5);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds message to singleplayer client.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetNPCAvatar|&lt;br /&gt;
* int: npc_ship_id&lt;br /&gt;
* object: avatar parameters|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.SetNPCAvatar(12553, [1,2,3,4,5,6]);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets npc avatar.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetSystemDangerLevel|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* int: danger_level - from 0 to 100|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.SetSystemDangerLevel(1, 99);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Set star system danger level. Danger level usually affects a level of system&#039;s npc and many other parameters.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetSystemTechLevel|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* int: tech_level - from 0 to 100|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.SetSystemTechLevel(1, 99);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Set star system tech level. Tech level usually affects shops store items.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|ShipExists|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
bool: whether ship exists or not|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.ShipExists(12552);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Damonwall</name></author>
	</entry>
	<entry>
		<id>https://wiki.atomictorch.com/index.php?title=VoidExpanse/scope-generator&amp;diff=166</id>
		<title>VoidExpanse/scope-generator</title>
		<link rel="alternate" type="text/html" href="https://wiki.atomictorch.com/index.php?title=VoidExpanse/scope-generator&amp;diff=166"/>
		<updated>2014-04-10T09:02:04Z</updated>

		<summary type="html">&lt;p&gt;Damonwall: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:VoidExpanse/api_scopes]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Scope generator =&lt;br /&gt;
Used for generation items, objects, systems in game, and also for getting some specific info about them.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Visibility:&#039;&#039;&#039; Global.&lt;br /&gt;
&lt;br /&gt;
== List of functions ==&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddAsteroid|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y&lt;br /&gt;
* string: type - xml id of asteroid&lt;br /&gt;
* double: scale&lt;br /&gt;
* double: resQ - resouces modifier&lt;br /&gt;
* object: rotation&lt;br /&gt;
* object: rotationSpeed |&lt;br /&gt;
int: identifier of created object|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var id = generator.AddAsteroid(1,100,100,&amp;quot;Asteroid01&amp;quot;,1, 0, {x:0,y:0,z:0}, {x:0,y:0,z:0});&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds asteroid with specified parameters into game world. Asteroid contents (extractable resources), asteroid&#039;s look and other parameters&lt;br /&gt;
can be modified only in .xml file, which is specified in this function by parameter &amp;quot;type&amp;quot;. &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddBase|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y&lt;br /&gt;
* string: type - xml id of base&lt;br /&gt;
* string: name&lt;br /&gt;
* &#039;&#039;(optional) object: tags&#039;&#039; |&lt;br /&gt;
int: identifier of created object|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var id = generator.AddBase(1, 100, 100, &amp;quot;Base01&amp;quot;, &amp;quot;Station Horizon&amp;quot;, {class: &amp;quot;order&amp;quot;});&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds space station to game world.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddItem|&lt;br /&gt;
* int: object_id&lt;br /&gt;
* string: item_xml_id&lt;br /&gt;
* int: quantity |&lt;br /&gt;
object:&lt;br /&gt;
* quantity - quantity was actually added&lt;br /&gt;
* type - can be &amp;quot;item&amp;quot; or &amp;quot;resource&amp;quot;|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var obj = generator.AddItem(1, &amp;quot;SomeItem&amp;quot;, 5);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds item to some object&#039;s inventory. In VoidExpanse not all objects do have inventory, so this function must be applied&lt;br /&gt;
only to those, which have it, such as ships, space stations, containers.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddItemToSpecifiedContainer|&lt;br /&gt;
* int: container_id&lt;br /&gt;
* string: item_xml_id&lt;br /&gt;
* int: quantity |&lt;br /&gt;
object:&lt;br /&gt;
* quantity - quantity was actually added&lt;br /&gt;
* type - can be &amp;quot;item&amp;quot; or &amp;quot;resource&amp;quot;|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var obj = generator.AddItemToSpecifiedContainer(1525, &amp;quot;SomeItem&amp;quot;, 5);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Important notice: container_id - is a special, unique in-game identifier for containers, which cannot be obtained by any way through API. Container id can only be obtained as a function parameter in events.&lt;br /&gt;
Currently used in OnInstancedContainerGeneration event. &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GenerateItemsWithItemlist|&lt;br /&gt;
* int: item_list_xml_id|&lt;br /&gt;
array of objects:&lt;br /&gt;
* quantity - quantity was actually added&lt;br /&gt;
* id - xml-id of item|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var items = generator.GenerateItemsWithItemlist(1, &amp;quot;SomeItem&amp;quot;, 5);&lt;br /&gt;
for(var i = 0; i &amp;lt; items.length; i++)&lt;br /&gt;
{&lt;br /&gt;
	generator.AddItemToSpecifiedContainer(&lt;br /&gt;
		args.container_id,&lt;br /&gt;
		items[i].id,&lt;br /&gt;
		items[i].quantity );&lt;br /&gt;
}&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Generates set of items with itemlist. After generation, items can be added to any container.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddContainer|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y&lt;br /&gt;
* string: xml_type&lt;br /&gt;
* string: droplist&lt;br /&gt;
* &#039;&#039;(optional) object: tags&#039;&#039; |&lt;br /&gt;
int: identifier of object created|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var id = generator.AddContainer(1, 0, 0, &amp;quot;Container01&amp;quot;, &amp;quot;DropList01&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds a floating container to game world. By default container is empty. Also containers, which has no contents, are unstable (self-destroyed as soon as&lt;br /&gt;
someone will look at it&#039;s contents), so it&#039;s better not to create empty containers. Content can be added with generator.AddItem function.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddDecoration|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* string: item_xml_id&lt;br /&gt;
* vector2: position&lt;br /&gt;
* double: depth&lt;br /&gt;
* vector2: rotation&lt;br /&gt;
* vector2: rotation_speed,&lt;br /&gt;
* double: scale |&lt;br /&gt;
int: ID of created object|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var id = generator.AddDecoration(1, &amp;quot;Decoration01&amp;quot;, {x:0,y:0}, 100, {x:5, y:5}, {x:5, y:5}, 2);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds a decoration to game world. Decoration is a non-interactive object, which is used as a... decoration.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddJumpgate|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* int: system_to&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y&lt;br /&gt;
* double: angle&lt;br /&gt;
* string: xml_type&lt;br /&gt;
* &#039;&#039;(optional) object: tags&#039;&#039;|&lt;br /&gt;
int: ID of created object|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var id = generator.AddJumpgate(1, 2, 100, 100, 20, &amp;quot;Jumpgate01&amp;quot;, {sometag: &amp;quot;sometag&amp;quot;});&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds a jumpgate - an object, which allows ships to travel between systems. Every jumpgate must be paired with another one,&lt;br /&gt;
for example, if in system A theres a jumpgate, that leads to system B, then in system B must be a jumpgate, that leads to system A.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddNPCShipToSystem|&lt;br /&gt;
* string: npc_name&lt;br /&gt;
* string: behavior - AI-script (&amp;quot;brains&amp;quot;)&lt;br /&gt;
* int: level&lt;br /&gt;
* string: xml_type - npc xml type&lt;br /&gt;
* int: system_id&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y&lt;br /&gt;
* &#039;&#039;(optional) object: tags&#039;&#039;|&lt;br /&gt;
int: ID of created object|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var id = generator.AddNPCShipToSystem(&amp;quot;Pirate&amp;quot;,&lt;br /&gt;
	&amp;quot;PirateAI&amp;quot;, 100, &amp;quot;PirateNpc01&amp;quot;,&lt;br /&gt;
	1, 105, 223, &lt;br /&gt;
	{class: &amp;quot;pirate&amp;quot;, uniq_id: &amp;quot;boss&amp;quot;});&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds an npc ship into game. NPC&#039;s avatar and faction are set through another functions - generator.SetNPCAvatar and relations.SetShipFaction&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|OverrideDropList|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* array: droplists - strings array of droplists|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.OverrideDropList(23303, [&amp;quot;DropList01&amp;quot;, &amp;quot;DropList02&amp;quot;]);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds specified droplists to npc&#039;s droplists list.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddPlanet|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y&lt;br /&gt;
* string: name&lt;br /&gt;
* int: seed |&lt;br /&gt;
int: ID of created object|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var id = generator.AddPlanet(1, 0, 0, &amp;quot;Earth&amp;quot;, 123);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds planet to game world. Planet&#039;s look is driven by seed, based on which planet&#039;s look will be defined&lt;br /&gt;
by random generator. If you want a particular planet, you should either use seed with defined results (by our tool - SeedGenerator), or use another function - AddPlanetWithType.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddPlanetWithType|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y&lt;br /&gt;
* string: name&lt;br /&gt;
* int: seed&lt;br /&gt;
* string: planet_config_type |&lt;br /&gt;
int: ID of created object|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var id = generator.AddPlanetWithType(1, 0, 0, &amp;quot;Earth&amp;quot;, 123, &amp;quot;EarthTypePlanet&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds planet to game world. Planet&#039;s look is driven partially be seed, but mostly by the specified type.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddSpaceObject|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y&lt;br /&gt;
* string: xml_type_id&lt;br /&gt;
* object: tags |&lt;br /&gt;
int: ID of created object|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var id = generator.AddSpaceObject(1, 0, 0, &amp;quot;Debris01&amp;quot;, {class: &amp;quot;mine&amp;quot;})&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds a space object to game world. Space objects are interactive object. They cannot be destroyed, but they are interactive and collision-enabled. For example, spacemines are created with space objects. &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddLever|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y&lt;br /&gt;
* string: xml_type_id&lt;br /&gt;
* int: visible_to&lt;br /&gt;
* object: tags |&lt;br /&gt;
int: ID of created object|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var id = generator.AddLever(1, 0, 0, &amp;quot;Debris01&amp;quot;, 0, {class: &amp;quot;mine&amp;quot;})&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds a lever object to world. Lever - is a special object, which can be activated. Parameter &amp;quot;visible_to&amp;quot; specifies, to whom lever is visible. If 0, it&#039;s visible to all, else - only to specified ship. Useful when you need to create a special object only to a man, who took the quest.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddStar|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y&lt;br /&gt;
* int: seed&lt;br /&gt;
* int: heat - how much damage star deals, when ship approaches&lt;br /&gt;
* &#039;&#039;(optional) string: typeID&#039;&#039;&lt;br /&gt;
|&lt;br /&gt;
int: ID of created object|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var id = generator.AddStar(1, 0, 0, 234, 0)&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds a star. Conventionally, you shouldn&#039;t add more then 1 star to a system.&lt;br /&gt;
If typeID is not specified, type will be picked by random, based on seed parameter.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddSystem|&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y&lt;br /&gt;
* string: name&lt;br /&gt;
* int: seed|&lt;br /&gt;
int: ID of created system|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var id = generator.AddSystem(0, 0, &amp;quot;Hawkins Eta&amp;quot;, 123)&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds a star system. Star system can be added anywhere, and by default it won&#039;t be connected to any other systems. See tutorial to see, how systems generation works.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetSystemTags|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* object: tags|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.SetSystemTags(1, {&amp;quot;show_clouds&amp;quot;: &amp;quot;yes&amp;quot;})&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets tags of specified star system. Can be expanded with generator.AddSystemTag and retrieved by&lt;br /&gt;
generator.GetSystemTags.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddSystemTag|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* string: name&lt;br /&gt;
* object: value|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.AddSystemTag(1, &amp;quot;show_clouds&amp;quot;, &amp;quot;yes&amp;quot;)&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds tag to star system tags (or overwrites existing one with the same name).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetSystemTags|&lt;br /&gt;
* int: system_id|&lt;br /&gt;
object: tags set by methods above|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var tags = generator.GetSystemTags(1);&lt;br /&gt;
if(tags != null &amp;amp;&amp;amp; tags[&amp;quot;show_clouds&amp;quot;] == &amp;quot;yes&amp;quot;)&lt;br /&gt;
{&lt;br /&gt;
	console.Print(&amp;quot;System 1 was told to show clouds&amp;quot;);&lt;br /&gt;
}&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Retrieves tags of star system, which were set by SetSystemTags and AddSystemTag.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddAnomaly|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* string: anomaly_id&lt;br /&gt;
* object: args |&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.AddAnomaly(args.sys_id, &amp;quot;radar_disable&amp;quot;, {});&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds anomaly to star system. There are few predefined anomalies (see more in the article [[VoidExpanse/anomalies|Anomalies]]), but you can specify and implement your own anomalies.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SystemClose|&lt;br /&gt;
* int: system_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.SystemClose(20);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets system status to closed. Can be used anywhere, has no hardcoded implementation. For example, now&lt;br /&gt;
it&#039;s being used to prevent player to travel to alien systems. System can be opened with generator.SystemOpen.&lt;br /&gt;
All systems are opened by default.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SystemOpen|&lt;br /&gt;
* int: system_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.SystemOpen(20);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets system status to opened. Can be used anywhere, has no hardcoded implementation. For example, now&lt;br /&gt;
it&#039;s being used to prevent player to travel to alien systems. System can be closed with generator.SystemClose.&lt;br /&gt;
All systems are opened by default.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|IsSystemClosed|&lt;br /&gt;
* int: system_id|&lt;br /&gt;
bool|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var closed = generator.IsSystemClosed(20);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Check whether system is closed or not.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|CountNpcInSystemByTags|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* object: tags|&lt;br /&gt;
int|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var numOfPirates= generator.CountNpcInSystemByTags(20, {class: &amp;quot;pirate&amp;quot;});&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Counts npcs with specified tags in specified system.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetSystemPlaylists|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* object: key-&amp;gt;value object|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.SetSystemPlaylists(args.sys_id,&lt;br /&gt;
				{&lt;br /&gt;
					&amp;quot;explore&amp;quot;: &amp;quot;playlist_generic_explore&amp;quot;,&lt;br /&gt;
					&amp;quot;combat&amp;quot;: &amp;quot;playlist_generic_combat&amp;quot;&lt;br /&gt;
				}&lt;br /&gt;
			);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets system music playlists. There are few possible keys, see more in [[VoidExpanse/MusicPlaylists|MusicPlaylists]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddSystemsLink|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* int: system_2_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.AddSystemsLink(1,2);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
This function creates a link between two systems. This links are simply logical, but there are&lt;br /&gt;
few hardcoded rules about them. There are some specific rules, that are applied to every link:&lt;br /&gt;
* Duplication - cannot create a link between already linked systems&lt;br /&gt;
* Future Linking - cannot create a link between systems, that aren&#039;t exist yet&lt;br /&gt;
* Proximity - link cannot pass closer then 2 units to a star&lt;br /&gt;
* Intersections - link cannot intersect any other link&lt;br /&gt;
Links created this way are displayed on galaxy map. By this links jumpgates are created (though, there is no hard rule about that - you can create jumpgate without link between two star systems, but this connection won&#039;t be displayed on galaxy map).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|FixConnectivity|&lt;br /&gt;
void|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.FixConnectivity();&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Should be called after all stars and links were created. It checks, if all stars are reachable from one another, and, if not, it creates missing star systems links.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|DockShipToBase|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* int: base_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.DockShipToBase(12253,2);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Immediately, without any animations, checkups and routines, docks ship to a space station. It&#039;s better not to use it on players, because it&#039;ll have unpredictable behavior.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|ExpandArea|&lt;br /&gt;
* array: array of stars IDs |&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var stars = [3];&lt;br /&gt;
while(true)&lt;br /&gt;
{&lt;br /&gt;
	stars = generator.ExpandArea(stars);&lt;br /&gt;
	if(newstars.length &amp;gt;= 10) break;&lt;br /&gt;
}&lt;br /&gt;
console.Print(&amp;quot;Now we have an area of 10 or more stars around star with id 3&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Function, which returns the same array, as input + all stars, which are linked to input ones by 1 link. In other words, it returns an area, expanded by 1 link. Very useful during generation of zones in galaxy, such as faction territories.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetAllSystems|&lt;br /&gt;
void|&lt;br /&gt;
array: IDs of all systems|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var arr = generator.GetAllSystems();&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetAsteroidTypes|&lt;br /&gt;
void|&lt;br /&gt;
array: xml_ids (strings) of all asteroids|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var arr = generator.GetAsteroidTypes();&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetClosestSystemToPoint|&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y|&lt;br /&gt;
int: ID of picked system of 0, if none|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var sys_id = generator.GetClosestSystemToPoint(0,0);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Useful during generation process.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetDebrisTypes|&lt;br /&gt;
void|&lt;br /&gt;
array: xml_ids (strings) of all space objects|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var arr = generator.GetDebrisTypes();&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Useful during generation process. Alias of generator.GetSpaceObjectsTypes.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetSpaceObjectsTypes|&lt;br /&gt;
void|&lt;br /&gt;
array: xml_ids (strings) of all space objects|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var arr = generator.GetSpaceObjectsTypes();&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Useful during generation process. The same as generator.GetDebrisTypes.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetIntersection|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y |&lt;br /&gt;
string: intersection in format &amp;quot;coord_x;coord_y&amp;quot; or empty string|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var intersection = generator.GetIntersection(0, 15, 15);&lt;br /&gt;
if(intersection.length &amp;gt; 0)&lt;br /&gt;
{&lt;br /&gt;
	var arr = intersection.split(&#039;;&#039;);&lt;br /&gt;
	console.Print(&amp;quot;Intersection was found: point X:&amp;quot; + arr[0] +&amp;quot;, Y:&amp;quot; + arr[1]);&lt;br /&gt;
}&amp;lt;/pre&amp;gt; |&lt;br /&gt;
The function answers the question: if a put a link between system with specified id and point with&lt;br /&gt;
coordinates coord_x;coord_y, will it intersect any other links? Useful during galaxy generation process.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetJumpsBetweenSystems|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* int: system_2_id|&lt;br /&gt;
int: number of jumps|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var jumps = generator.GetJumpsBetweenSystems(1,1000);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns length (number of links) of the minimal way between two systems.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetLinkedSystems|&lt;br /&gt;
* int: sys_id|&lt;br /&gt;
array: IDs of systems|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var arr = generator.GetLinkedSystems(1);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns an array with IDs of all systems linked to the specified one.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetMinDistanceToSystem|&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y|&lt;br /&gt;
double: distance to the closest system (or maximum double value if none)|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var dist = generator.GetLinkedSystems(1);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Return distance to the closest system to a specified point.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetNumberOfLinks|&lt;br /&gt;
* int: system_id|&lt;br /&gt;
int: number of links to specified system|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var links = generator.GetNumberOfLinks(1);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetPlanetCoordinates|&lt;br /&gt;
* int: planet_id|&lt;br /&gt;
vector2: coordinates of a planet|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var coords = generator.GetPlanetCoordinates(242);&lt;br /&gt;
console.Print(&amp;quot;Planet coordinates: X:&amp;quot; + coords.x + &amp;quot;, Y:&amp;quot; + coords.y);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns coordinates of specified planet.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetRandomPlanetInSystem|&lt;br /&gt;
* int: system_id|&lt;br /&gt;
int: ID of a planet|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var id = generator.GetRandomPlanetInSystem(1);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns ID of random planet in system (or 0 if there are no planets).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetSystemPlanets|&lt;br /&gt;
* int: system_id|&lt;br /&gt;
array: IDs of planets|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var arr = generator.GetSystemPlanets(1);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns an array with IDs of all planets in system.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetSystemByID|&lt;br /&gt;
* int: system_id|&lt;br /&gt;
object:&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y&lt;br /&gt;
* int: seed&lt;br /&gt;
* string: faction&lt;br /&gt;
* int: danger_level&lt;br /&gt;
* int: tech_level&lt;br /&gt;
* string: name|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var obj = generator.GetSystemByID(1);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns basic info about specified system. Tags of star system can be gained with generator.GetSystemTags.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetBaseByID|&lt;br /&gt;
* int: base_id|&lt;br /&gt;
object:&lt;br /&gt;
* string: faction&lt;br /&gt;
* int: tech_level&lt;br /&gt;
* string: name&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var obj = generator.GetBaseByID(1);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns space station basic description. Tags cannot be retrieved with this function - use game.GetTags instead.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetSystemsByDistanceTo|&lt;br /&gt;
* int: system_id|&lt;br /&gt;
array: IDs of systems|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var arr = generator.GetSystemsByDistanceTo(1);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns an array with IDs of systems, which are sorted by distance to specified system. Specified system is included into resulting array.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetAllResources|&lt;br /&gt;
void|&lt;br /&gt;
array: xml_ids (strings) of resources|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var arr = generator.GetAllResources();&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns an array of all resources of VoidExpanse.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetResourceByID|&lt;br /&gt;
* string: xml_id|&lt;br /&gt;
object:&lt;br /&gt;
* double: price - standard price of this item&lt;br /&gt;
* int: shops_level - level of shops in which this resource should be sold&lt;br /&gt;
* string: name - name of resource&lt;br /&gt;
* string: id - xml id of resource|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var obj = generator.GetResourceByID(&amp;quot;Resource01&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns a description of a resource by it&#039;s xml_id.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetItemByXmlID|&lt;br /&gt;
* string: xml_id|&lt;br /&gt;
object:&lt;br /&gt;
* double: price - standard price of this item&lt;br /&gt;
* int: shops_level - level of shops in which this resource should be sold&lt;br /&gt;
* string: name - name of resource&lt;br /&gt;
* string: id - xml id of resource|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var obj = generator.GetItemByXmlID(&amp;quot;Item01&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns a description of an item by it&#039;s xml_id.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RemoveAsteroid|&lt;br /&gt;
* int: asteroid_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.RemoveAsteroid(123);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes asteroid from a game world.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RemoveBase|&lt;br /&gt;
* int: base_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.RemoveBase(123);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes base (space station) from a game world.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RemoveDecoration|&lt;br /&gt;
* int: decoration_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.RemoveDecoration(123);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes decoration from a game world.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RemoveJumpgate|&lt;br /&gt;
* int: jumpgate_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.RemoveJumpgate(123);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes a jumpgate from a game world.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RemovePlanet|&lt;br /&gt;
* int: planet_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.RemovePlanet(123);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes a planet from a game world.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RemoveSpaceObject|&lt;br /&gt;
* int: space_object_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.RemoveSpaceObject(123);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes a space object from a game world.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RemoveLever|&lt;br /&gt;
* int: lever_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.RemoveLever(123);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes specified lever from a game world.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RemoveStar|&lt;br /&gt;
* int: star_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.RemoveStar(123);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes a star from a game world.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RemoveSystemsLink|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* int: system_2_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.RemoveSystemsLink(1,2);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes a link between two systems.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|ReportLoadingPhase|&lt;br /&gt;
* string: phase|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.ReportLoadingPhase(&amp;quot;Loading galaxy&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds message to singleplayer client with loader (then to alter loader use generator.ReportLoadingProgress).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|ReportLoadingPhaseNoLoader|&lt;br /&gt;
* string: phase|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.ReportLoadingPhaseNoLoader(&amp;quot;Loading galaxy&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds message to singleplayer client.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|ReportLoadingProgress|&lt;br /&gt;
* double: percent - a value from 0 to 1|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.ReportLoadingProgress(0.5);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds message to singleplayer client.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetNPCAvatar|&lt;br /&gt;
* int: npc_ship_id&lt;br /&gt;
* object: avatar parameters|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.SetNPCAvatar(12553, [1,2,3,4,5,6]);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets npc avatar.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetSystemDangerLevel|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* int: danger_level - from 0 to 100|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.SetSystemDangerLevel(1, 99);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Set star system danger level. Danger level usually affects a level of system&#039;s npc and many other parameters.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetSystemTechLevel|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* int: tech_level - from 0 to 100|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.SetSystemTechLevel(1, 99);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Set star system tech level. Tech level usually affects shops store items.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|ShipExists|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
bool: whether ship exists or not|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.ShipExists(12552);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Damonwall</name></author>
	</entry>
	<entry>
		<id>https://wiki.atomictorch.com/index.php?title=VoidExpanse/modding&amp;diff=160</id>
		<title>VoidExpanse/modding</title>
		<link rel="alternate" type="text/html" href="https://wiki.atomictorch.com/index.php?title=VoidExpanse/modding&amp;diff=160"/>
		<updated>2014-04-05T04:37:20Z</updated>

		<summary type="html">&lt;p&gt;Damonwall: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;VoidExpanse was created to have an almost unlimited modding potential. Almost every aspect of game can be modified and extended.&lt;br /&gt;
There are no hardcoded scripts and in-game logics, everything you see in VoidExpanse now was created as root mod. This concept is similar to&lt;br /&gt;
early GameBryo versions.&lt;br /&gt;
&lt;br /&gt;
Modding consists of two essential parts:&lt;br /&gt;
* Assets modding&lt;br /&gt;
* Scripting&lt;br /&gt;
&lt;br /&gt;
== Assets modding ==&lt;br /&gt;
&lt;br /&gt;
All objects in game are assets. They are, basically, XML files, which are located in &amp;quot;[MOD]/data&amp;quot; folder.&lt;br /&gt;
For example, if you want to add a new item or a ship - it&#039;ll be Asset modding.&lt;br /&gt;
&lt;br /&gt;
For example, let&#039;s take a look at ship &amp;quot;shuttle&amp;quot;.&lt;br /&gt;
Hull of this ship is presented in &amp;quot;data/items/hull_shuttle.xml&amp;quot;. In this file, all basic info about hull contined:&lt;br /&gt;
weapons slots, model, textures, blinks, engine trails, physics etc.&lt;br /&gt;
&lt;br /&gt;
Basically, to add a new ship all that you need is to add one more hull item to &amp;quot;data/items&amp;quot; folder of your mod. And model with textures, of course.&lt;br /&gt;
To make ship adding easy, we&#039;ve created a special tool - VE Physics Adjuster, which is quite easy to use.&lt;br /&gt;
&lt;br /&gt;
== Scripting ==&lt;br /&gt;
&lt;br /&gt;
Scripting is the most important and essential part of the game. Everything - from galaxy creation to damage and prices calculations - are scripted and&lt;br /&gt;
moddable.&lt;br /&gt;
&lt;br /&gt;
More information on scripting is in [[VoidExpanse/scripting_api|Scripting section]] of this wiki.&lt;/div&gt;</summary>
		<author><name>Damonwall</name></author>
	</entry>
	<entry>
		<id>https://wiki.atomictorch.com/index.php?title=VoidExpanse/installing_mods&amp;diff=159</id>
		<title>VoidExpanse/installing mods</title>
		<link rel="alternate" type="text/html" href="https://wiki.atomictorch.com/index.php?title=VoidExpanse/installing_mods&amp;diff=159"/>
		<updated>2014-04-05T04:21:50Z</updated>

		<summary type="html">&lt;p&gt;Damonwall: Created page with &amp;quot;== Mod files ==  There are two kinds of mod files: *.CPK and *.MPK.  &amp;#039;&amp;#039;&amp;#039;CPK&amp;#039;&amp;#039;&amp;#039; - stands for Core Package. It contains essential game functionality, and without it game won&amp;#039;t w...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Mod files ==&lt;br /&gt;
&lt;br /&gt;
There are two kinds of mod files: *.CPK and *.MPK.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;CPK&#039;&#039;&#039; - stands for Core Package. It contains essential game functionality, and without it&lt;br /&gt;
game won&#039;t work. There shouldn&#039;t be multiple CPK files loaded into one game, it can cause galaxy-scale&lt;br /&gt;
disasters.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;MPK&#039;&#039;&#039; - stands for Mod Package. It contains additional files, that&#039;ll be added to game&#039;s virtual file system and overwrite&lt;br /&gt;
files with the same name and path, contained in CPK and previous MPK files.&lt;br /&gt;
&lt;br /&gt;
For example, if we have CPK with file /content/readme.txt and MPK with file /content/readme.txt, then&lt;br /&gt;
the second one will be loaded, and first one ignored. This mechanism is created to make overriding core&lt;br /&gt;
functionality easy, without recompiling whole CPK.&lt;br /&gt;
&lt;br /&gt;
== MPK structure ==&lt;br /&gt;
&lt;br /&gt;
Each mod must have header.xml, or it won&#039;t be loaded.&lt;br /&gt;
Structure of header.xml is in standart XML format:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;root&amp;gt;&lt;br /&gt;
	&amp;lt;id&amp;gt;devmod&amp;lt;/id&amp;gt;&lt;br /&gt;
	&amp;lt;title&amp;gt;Dev Mod&amp;lt;/title&amp;gt;&lt;br /&gt;
	&amp;lt;author&amp;gt;AtomicTorch Studio&amp;lt;/author&amp;gt;&lt;br /&gt;
	&amp;lt;description&amp;gt;Dev. mod for easier debugging for VoidExpanse.&amp;lt;/description&amp;gt;&lt;br /&gt;
	&amp;lt;version&amp;gt;0.1.0&amp;lt;/version&amp;gt;&lt;br /&gt;
	&amp;lt;updated&amp;gt;17.01.2014&amp;lt;/updated&amp;gt;&lt;br /&gt;
	&amp;lt;modtype&amp;gt;2&amp;lt;/modtype&amp;gt; &amp;lt;!-- 1 - server, 2 - client-server, 3 - client --&amp;gt;&lt;br /&gt;
&amp;lt;/root&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
For every mod, there&#039;s a unique ID formed: [id]_[version]. For instance, unique ID of this mod is &#039;&#039;&#039;devmod_0.1.0&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
To add/remove mods from game, there&#039;s a file &#039;&#039;&#039;ModsConfig.xml&#039;&#039;&#039;. All mods, that should be loaded, should be listed in this file.&lt;br /&gt;
To add &amp;quot;devmod&amp;quot; mod, just add this line into &amp;quot;mods&amp;quot; tag:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;mod&amp;gt;devmod_0.1.1&amp;lt;/mod&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Modtype is a special parameter, defines whether mod should be loaded on server, on client, or both.&lt;br /&gt;
For example, if we want to create a mod, which just replaces some icons, this is a typical &#039;&#039;&#039;client&#039;&#039;&#039; mod.&lt;br /&gt;
Client-side mods will be ignored by server, if listed in ModsConfig.xml.&lt;br /&gt;
Mods, that contains only server-side alterations, like new topics or scriptis, are typical &#039;&#039;&#039;server&#039;&#039;&#039; mod.&lt;br /&gt;
If they are listed in ModsConfig.xml, server will load them, but it won&#039;t demand one of players. It means, that&lt;br /&gt;
if server has server-side mod, and client is not - it&#039;s okay.&lt;br /&gt;
Third type is client-server mod, complex type of mod, which is needed on both client and server. If server was created&lt;br /&gt;
with specific server-side mod, and client doesn&#039;t have the same one, server won&#039;t let client connect and will give a&lt;br /&gt;
warning.&lt;br /&gt;
&lt;br /&gt;
== Virtual file system concepts ==&lt;br /&gt;
&lt;br /&gt;
* All mods are loaded into one virtual file system, with overwrite rule (see in &amp;quot;mod files&amp;quot; section above).&lt;br /&gt;
* Mods can use each other files, so don&#039;t hesitate to use original game resources in your mods.&lt;br /&gt;
* If two MPK files have the same file (path+name), the last one (by order in ModsConfig.xml) will be taken.&lt;br /&gt;
* All file names are not case-sensitive. QwEr.xml and qwer.xml are considered the same.&lt;/div&gt;</summary>
		<author><name>Damonwall</name></author>
	</entry>
	<entry>
		<id>https://wiki.atomictorch.com/index.php?title=VoidExpanse/scope-player&amp;diff=140</id>
		<title>VoidExpanse/scope-player</title>
		<link rel="alternate" type="text/html" href="https://wiki.atomictorch.com/index.php?title=VoidExpanse/scope-player&amp;diff=140"/>
		<updated>2014-03-26T04:35:07Z</updated>

		<summary type="html">&lt;p&gt;Damonwall: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:VoidExpanse/api_scopes]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Scope player =&lt;br /&gt;
Used to manage player-related stuff.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Visibility:&#039;&#039;&#039; Global.&lt;br /&gt;
&lt;br /&gt;
== List of functions ==&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddMoney|&lt;br /&gt;
* string: player_name&lt;br /&gt;
* int: money|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;player.AddMoney(&amp;quot;dlirry&amp;quot;, 100500);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds specified amount of money to a player.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddExperience|&lt;br /&gt;
* string: player_name&lt;br /&gt;
* double: experience|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;player.AddExperience(&amp;quot;dlirry&amp;quot;, 100500);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds specified amount of experience to player.&lt;br /&gt;
The same effect as ship.SetCurrentValueDelta(2535, &amp;quot;experience&amp;quot;, 100500);&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetMoney|&lt;br /&gt;
* string: player_name|&lt;br /&gt;
int: player&#039;s money|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var money = player.GetMoney(&amp;quot;dlirry&amp;quot;, 100500);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Gets current amount of player&#039;s money&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetShipOfPlayer|&lt;br /&gt;
* string: player_name|&lt;br /&gt;
int: player&#039;s ship ID|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var ship_id = player.GetShipOfPlayer(&amp;quot;dlirry&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns ID of player&#039;s ship.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RemoveMoney|&lt;br /&gt;
* string: player_name&lt;br /&gt;
* int: money|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;vplayer.RemoveMoney(&amp;quot;dlirry&amp;quot;, 1);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes specified amount of money from player.&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Damonwall</name></author>
	</entry>
	<entry>
		<id>https://wiki.atomictorch.com/index.php?title=VoidExpanse/scripting_api&amp;diff=139</id>
		<title>VoidExpanse/scripting api</title>
		<link rel="alternate" type="text/html" href="https://wiki.atomictorch.com/index.php?title=VoidExpanse/scripting_api&amp;diff=139"/>
		<updated>2014-03-25T03:39:34Z</updated>

		<summary type="html">&lt;p&gt;Damonwall: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Scripting overview =&lt;br /&gt;
&lt;br /&gt;
== Basic concepts ==&lt;br /&gt;
Scripting is done via actions that custom scripts can subscribe to. There are number of actions that are called by server automatically, plus users can create their own actions and call them when needed. This also makes possible for users to create scripting frameworks for others to use.&lt;br /&gt;
Each action has one argument (ΓÇ£argsΓÇ¥) that is a JavaScript object containing several variables inside depending on a particular action. In some actions this ΓÇ£argsΓÇ¥ object can be empty. But either way it allows for unified format for all actions within the scripting system.&lt;br /&gt;
&lt;br /&gt;
=== Scripting naming convention ===&lt;br /&gt;
* String IDΓÇÖs in mods can only contain alphanumeric characters and underscores. Any other characters are illegal.&lt;br /&gt;
* Using underscore for variables and properties.&lt;br /&gt;
* Using CamelCase for functions and methods.&lt;br /&gt;
* zxc_q - ΓÇ£qΓÇ¥ in the variable always represents ΓÇ£quantityΓÇ¥ or ΓÇ£number of ...ΓÇ¥.&lt;br /&gt;
* zxc_id - ΓÇ£idΓÇ¥ always means either string id from XML file if it is of the type of string, or if it is uint then it is entity (instance) id of some object.&lt;br /&gt;
* zxc_req - ΓÇ£reqΓÇ¥ always means ΓÇ£requirementsΓÇ¥.&lt;br /&gt;
* All mods should prefix their variables, functions, classes, storage keys and all the rest with a key for isolation from other mods, example of such prefix would be ΓÇ£prf_ΓÇ¥ -&amp;gt; ΓÇ£prf_some_variableΓÇ¥, ΓÇ£prf_SomeFunctionΓÇ¥.&lt;br /&gt;
&lt;br /&gt;
=== Internal scripts (Overridable) ===&lt;br /&gt;
{{Main|VoidExpanse/Internal_scripts|Internal scripts}}&lt;br /&gt;
These scripts are called usually once and only in a particular situation. Each of these script files must exist in only one instance. If a new script is added the previous one will be overridden. Each of the script files must implement only one script action. Usually players should not modify these scripts unless they want to completely re-implement some game feature.&lt;br /&gt;
&lt;br /&gt;
=== Global scripts (called in the world dynamically) ===&lt;br /&gt;
{{Main|VoidExpanse/Global_scripts|Global scripts}}&lt;br /&gt;
Global scripts are executed continuously during gameplay. For each event there could be many bound scripts. Also it is possible to create custom actions and subscribe to them.&lt;br /&gt;
&lt;br /&gt;
=== Object scripts ===&lt;br /&gt;
{{Main|VoidExpanse/Object_scripts|Object scripts}}&lt;br /&gt;
Object scripts are scripts attached to a particular game object. When that object starts an action, if script has an appropriate handler for this action it will be executed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== VoidExpanse Scripting API ==&lt;br /&gt;
&lt;br /&gt;
=== Library inclusion and scopes usage ===&lt;br /&gt;
Preprocessor directive &amp;lt;code&amp;gt;include(libname.js);&amp;lt;/code&amp;gt; includes a library scripts into a current JS instance. Library scripts also can include each other (no echo effect will appear).&lt;br /&gt;
&lt;br /&gt;
Allows to use functions and objects of these libraries in this particular script instance.&lt;br /&gt;
* Inclusions of libraries directive must be the first lines in the script file (not necessarily, but preferably - to maintain order in scripts).&lt;br /&gt;
* All include directives must be before first function declaration.&lt;br /&gt;
&lt;br /&gt;
Preprocessor directive &amp;lt;code&amp;gt;using(scopename);&amp;lt;/code&amp;gt; allows to use specific scope in a specific script. Scope name must be an existing scope name (see scopes below). Except for some specific scopes (like topic or npc), which are available only in specific places, like topic scripts or AI behaviors.&lt;br /&gt;
&lt;br /&gt;
=== Scopes ===&lt;br /&gt;
Each scope contains a number of functions available from it.&lt;br /&gt;
&lt;br /&gt;
* [[VoidExpanse/scope-config]] (available: global)&lt;br /&gt;
* [[VoidExpanse/scope-script]] (available: global)&lt;br /&gt;
* [[VoidExpanse/scope-actions]] (available: global)&lt;br /&gt;
* [[VoidExpanse/scope-server]] (available: global)&lt;br /&gt;
* [[VoidExpanse/scope-generator]] (available: global)&lt;br /&gt;
* [[VoidExpanse/scope-spawn]] (available: global)&lt;br /&gt;
* [[VoidExpanse/scope-station]] (available: global)&lt;br /&gt;
* [[VoidExpanse/scope-chat]] (available: global)&lt;br /&gt;
* [[VoidExpanse/scope-console]] (available: global)&lt;br /&gt;
* [[VoidExpanse/scope-storage]] (available: global)&lt;br /&gt;
* [[VoidExpanse/scope-game]] (available: global)&lt;br /&gt;
* [[VoidExpanse/scope-ship]] (available: global)&lt;br /&gt;
* [[VoidExpanse/scope-visual]] (available: global)&lt;br /&gt;
* [[VoidExpanse/scope-player]] (available: global)&lt;br /&gt;
* [[VoidExpanse/scope-topic]] (available: only in topics)&lt;br /&gt;
* [[VoidExpanse/scope-topics]] (available: global)&lt;br /&gt;
* [[VoidExpanse/scope-relations]] (available: global)&lt;br /&gt;
* [[VoidExpanse/scope-npc]] (available: global)&lt;br /&gt;
* [[VoidExpanse/scope-timer]] (available: global)&lt;br /&gt;
* [[VoidExpanse/scope-debug]] (available: global)&lt;br /&gt;
&lt;br /&gt;
== Device scripts ==&lt;br /&gt;
{{Main|VoidExpanse/Device_scripts|Device scripts}}&lt;br /&gt;
Devices uses effect scripts, which is similar to any object scripts, but uses itΓÇÖs own special system of arguments. These scripts are shared between instances of the same device type, therefore global variables in this scripts are denied.&lt;br /&gt;
&lt;br /&gt;
There are four possible functions for device script.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Consumables scripting ==&lt;br /&gt;
{{Main|VoidExpanse/Consumable_scripting|Consumables scripting}}&lt;br /&gt;
Consumables can be programmed with standart xml-values, but, in order to implement something&lt;br /&gt;
special, one can use special techniques, described in this article.&lt;/div&gt;</summary>
		<author><name>Damonwall</name></author>
	</entry>
	<entry>
		<id>https://wiki.atomictorch.com/index.php?title=VoidExpanse/scripting_api&amp;diff=138</id>
		<title>VoidExpanse/scripting api</title>
		<link rel="alternate" type="text/html" href="https://wiki.atomictorch.com/index.php?title=VoidExpanse/scripting_api&amp;diff=138"/>
		<updated>2014-03-25T03:37:15Z</updated>

		<summary type="html">&lt;p&gt;Damonwall: Undo revision 136 by Damonwall (talk)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Multiplayer server setup =&lt;br /&gt;
&lt;br /&gt;
== GUI for multiplayer server ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Currently in development&#039;&#039;&#039;&lt;br /&gt;
We are planning to create a gui for Windows, Mac and Linux to provide easy, user-friendly server setup and management.&lt;br /&gt;
However, on console-based systems, like FreeBSD, there&#039;s always available server setup and management with console commands.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Multiplayer server setup ==&lt;br /&gt;
&lt;br /&gt;
To launch a multiplayer server on any system, your system needs to meet following requirements:&lt;br /&gt;
* .Net/Mono, compatible with .net framework 4.0&lt;br /&gt;
&lt;br /&gt;
=== Installation ===&lt;br /&gt;
1. Copy the following files from game distributive to your server machine:&lt;br /&gt;
* folder Server&lt;br /&gt;
* folder Mods&lt;br /&gt;
&lt;br /&gt;
Installation complete!&lt;br /&gt;
&lt;br /&gt;
=== Launch ===&lt;br /&gt;
&lt;br /&gt;
====Windows====&lt;br /&gt;
Launch AtomicTorch.SpaceRPG.Server.RuntimeWin.exe from ./Server/ folder.&lt;br /&gt;
&lt;br /&gt;
====Other system with Mono====&lt;br /&gt;
Launch AtomicTorch.SpaceRPG.Server.RuntimeWin.exe from ./Server/Mono folder with mono,&lt;br /&gt;
like this:&lt;br /&gt;
&amp;lt;pre&amp;gt;mono AtomicTorch.SpaceRPG.Server.RuntimeWin.exe&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Launch complete!&lt;br /&gt;
&lt;br /&gt;
=== Settings ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;SettingsServer.xml&#039;&#039;&#039;&lt;br /&gt;
Most of settings are stored in SettingsServer.xml, which is located in the same folder as server .exe file.&lt;br /&gt;
If it&#039;s not there, launch server once with &amp;quot;-new&amp;quot; argument, and it&#039;ll be created automatically.&lt;br /&gt;
&lt;br /&gt;
In SettingsServer, &#039;&#039;&#039;do not modfify misc and network parts&#039;&#039;&#039;! It may cause malifunction.&lt;br /&gt;
&lt;br /&gt;
You may, however, modify &amp;lt;server&amp;gt; part on your own risk.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Create a new game&#039;&#039;&#039;&lt;br /&gt;
When server starts, you can create a new game, or load an existing one.&lt;br /&gt;
To create a new game, type to create a new server^&lt;br /&gt;
&amp;lt;pre&amp;gt;-new [seed_key]&amp;lt;/pre&amp;gt;&lt;br /&gt;
Seed_key is a word, which is used like seed value for random-based generation, like &amp;quot;voidexpance&amp;quot; or &amp;quot;hellyeah&amp;quot;, which will affect world generation on server.&lt;br /&gt;
For example, if you type&lt;br /&gt;
&amp;lt;pre&amp;gt;-new myworld&amp;lt;/pre&amp;gt;&lt;br /&gt;
random world will be created, always the same for &amp;quot;myworld&amp;quot; seed key. And if you type&lt;br /&gt;
&amp;lt;pre&amp;gt;-new hellyeah&amp;lt;/pre&amp;gt;&lt;br /&gt;
random world will be created too, but different from the one you&#039;ll get with &amp;quot;myworld&amp;quot;.&lt;br /&gt;
In other words, seed_key word defines generated world.&lt;br /&gt;
Feel free to experiment, type in you nickname to create your personal world =)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Saving game====&lt;br /&gt;
In multiplayer mode, server automatically saves game every time interval, specified in SettingsServer.xml (autosave_delay parameter).&lt;br /&gt;
You can save server game with console command &#039;&#039;savegame&#039;&#039;.&lt;br /&gt;
&amp;lt;pre&amp;gt;savegame&amp;lt;/pre&amp;gt; - will save you game to slot 0 under the name &amp;quot;CurrentWorld&amp;quot;.&lt;br /&gt;
&amp;lt;pre&amp;gt;savegame 5 ServerNameWord&amp;lt;/pre&amp;gt; - will save you game to slot 5 under the name &amp;quot;ServerNameWord&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
====Loading game====&lt;br /&gt;
When server starts, you can create a new game, or load an existing one.&lt;br /&gt;
To load an existing game, use command&lt;br /&gt;
&amp;lt;pre&amp;gt;-load [slot_number]&amp;lt;/pre&amp;gt;, for example, &amp;lt;pre&amp;gt;-load 0&amp;lt;/pre&amp;gt;.&lt;br /&gt;
You can use the same command not only when server starts, but even during the game, just type in console:&lt;br /&gt;
&amp;lt;pre&amp;gt;load 0&amp;lt;/pre&amp;gt;, and game from specified slot will be loaded.&lt;/div&gt;</summary>
		<author><name>Damonwall</name></author>
	</entry>
	<entry>
		<id>https://wiki.atomictorch.com/index.php?title=VoidExpanse/Server_setup&amp;diff=137</id>
		<title>VoidExpanse/Server setup</title>
		<link rel="alternate" type="text/html" href="https://wiki.atomictorch.com/index.php?title=VoidExpanse/Server_setup&amp;diff=137"/>
		<updated>2014-03-25T03:36:23Z</updated>

		<summary type="html">&lt;p&gt;Damonwall: Created page with &amp;quot;= Multiplayer server setup =  == GUI for multiplayer server ==  &amp;#039;&amp;#039;&amp;#039;Currently in development&amp;#039;&amp;#039;&amp;#039; We are planning to create a gui for Windows, Mac and Linux to provide easy, user...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Multiplayer server setup =&lt;br /&gt;
&lt;br /&gt;
== GUI for multiplayer server ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Currently in development&#039;&#039;&#039;&lt;br /&gt;
We are planning to create a gui for Windows, Mac and Linux to provide easy, user-friendly server setup and management.&lt;br /&gt;
However, on console-based systems, like FreeBSD, there&#039;s always available server setup and management with console commands.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Multiplayer server setup ==&lt;br /&gt;
&lt;br /&gt;
To launch a multiplayer server on any system, your system needs to meet following requirements:&lt;br /&gt;
* .Net/Mono, compatible with .net framework 4.0&lt;br /&gt;
&lt;br /&gt;
=== Installation ===&lt;br /&gt;
1. Copy the following files from game distributive to your server machine:&lt;br /&gt;
* folder Server&lt;br /&gt;
* folder Mods&lt;br /&gt;
&lt;br /&gt;
Installation complete!&lt;br /&gt;
&lt;br /&gt;
=== Launch ===&lt;br /&gt;
&lt;br /&gt;
====Windows====&lt;br /&gt;
Launch AtomicTorch.SpaceRPG.Server.RuntimeWin.exe from ./Server/ folder.&lt;br /&gt;
&lt;br /&gt;
====Other system with Mono====&lt;br /&gt;
Launch AtomicTorch.SpaceRPG.Server.RuntimeWin.exe from ./Server/Mono folder with mono,&lt;br /&gt;
like this:&lt;br /&gt;
&amp;lt;pre&amp;gt;mono AtomicTorch.SpaceRPG.Server.RuntimeWin.exe&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Launch complete!&lt;br /&gt;
&lt;br /&gt;
=== Settings ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;SettingsServer.xml&#039;&#039;&#039;&lt;br /&gt;
Most of settings are stored in SettingsServer.xml, which is located in the same folder as server .exe file.&lt;br /&gt;
If it&#039;s not there, launch server once with &amp;quot;-new&amp;quot; argument, and it&#039;ll be created automatically.&lt;br /&gt;
&lt;br /&gt;
In SettingsServer, &#039;&#039;&#039;do not modfify misc and network parts&#039;&#039;&#039;! It may cause malifunction.&lt;br /&gt;
&lt;br /&gt;
You may, however, modify &amp;lt;server&amp;gt; part on your own risk.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Create a new game&#039;&#039;&#039;&lt;br /&gt;
When server starts, you can create a new game, or load an existing one.&lt;br /&gt;
To create a new game, type to create a new server^&lt;br /&gt;
&amp;lt;pre&amp;gt;-new [seed_key]&amp;lt;/pre&amp;gt;&lt;br /&gt;
Seed_key is a word, which is used like seed value for random-based generation, like &amp;quot;voidexpance&amp;quot; or &amp;quot;hellyeah&amp;quot;, which will affect world generation on server.&lt;br /&gt;
For example, if you type&lt;br /&gt;
&amp;lt;pre&amp;gt;-new myworld&amp;lt;/pre&amp;gt;&lt;br /&gt;
random world will be created, always the same for &amp;quot;myworld&amp;quot; seed key. And if you type&lt;br /&gt;
&amp;lt;pre&amp;gt;-new hellyeah&amp;lt;/pre&amp;gt;&lt;br /&gt;
random world will be created too, but different from the one you&#039;ll get with &amp;quot;myworld&amp;quot;.&lt;br /&gt;
In other words, seed_key word defines generated world.&lt;br /&gt;
Feel free to experiment, type in you nickname to create your personal world =)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Saving game====&lt;br /&gt;
In multiplayer mode, server automatically saves game every time interval, specified in SettingsServer.xml (autosave_delay parameter).&lt;br /&gt;
You can save server game with console command &#039;&#039;savegame&#039;&#039;.&lt;br /&gt;
&amp;lt;pre&amp;gt;savegame&amp;lt;/pre&amp;gt; - will save you game to slot 0 under the name &amp;quot;CurrentWorld&amp;quot;.&lt;br /&gt;
&amp;lt;pre&amp;gt;savegame 5 ServerNameWord&amp;lt;/pre&amp;gt; - will save you game to slot 5 under the name &amp;quot;ServerNameWord&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
====Loading game====&lt;br /&gt;
When server starts, you can create a new game, or load an existing one.&lt;br /&gt;
To load an existing game, use command:&lt;br /&gt;
&amp;lt;pre&amp;gt;-load [slot_number]&amp;lt;/pre&amp;gt;&lt;br /&gt;
You can use the same command not only when server starts, but even during the game, just type in console:&lt;br /&gt;
&amp;lt;pre&amp;gt;load 0&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Damonwall</name></author>
	</entry>
	<entry>
		<id>https://wiki.atomictorch.com/index.php?title=VoidExpanse/scripting_api&amp;diff=136</id>
		<title>VoidExpanse/scripting api</title>
		<link rel="alternate" type="text/html" href="https://wiki.atomictorch.com/index.php?title=VoidExpanse/scripting_api&amp;diff=136"/>
		<updated>2014-03-25T03:29:32Z</updated>

		<summary type="html">&lt;p&gt;Damonwall: /* Loading game */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Multiplayer server setup =&lt;br /&gt;
&lt;br /&gt;
== GUI for multiplayer server ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Currently in development&#039;&#039;&#039;&lt;br /&gt;
We are planning to create a gui for Windows, Mac and Linux to provide easy, user-friendly server setup and management.&lt;br /&gt;
However, on console-based systems, like FreeBSD, there&#039;s always available server setup and management with console commands.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Multiplayer server setup ==&lt;br /&gt;
&lt;br /&gt;
To launch a multiplayer server on any system, your system needs to meet following requirements:&lt;br /&gt;
* .Net/Mono, compatible with .net framework 4.0&lt;br /&gt;
&lt;br /&gt;
=== Installation ===&lt;br /&gt;
1. Copy the following files from game distributive to your server machine:&lt;br /&gt;
* folder Server&lt;br /&gt;
* folder Mods&lt;br /&gt;
&lt;br /&gt;
Installation complete!&lt;br /&gt;
&lt;br /&gt;
=== Launch ===&lt;br /&gt;
&lt;br /&gt;
====Windows====&lt;br /&gt;
Launch AtomicTorch.SpaceRPG.Server.RuntimeWin.exe from ./Server/ folder.&lt;br /&gt;
&lt;br /&gt;
====Other system with Mono====&lt;br /&gt;
Launch AtomicTorch.SpaceRPG.Server.RuntimeWin.exe from ./Server/Mono folder with mono,&lt;br /&gt;
like this:&lt;br /&gt;
&amp;lt;pre&amp;gt;mono AtomicTorch.SpaceRPG.Server.RuntimeWin.exe&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Launch complete!&lt;br /&gt;
&lt;br /&gt;
=== Settings ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;SettingsServer.xml&#039;&#039;&#039;&lt;br /&gt;
Most of settings are stored in SettingsServer.xml, which is located in the same folder as server .exe file.&lt;br /&gt;
If it&#039;s not there, launch server once with &amp;quot;-new&amp;quot; argument, and it&#039;ll be created automatically.&lt;br /&gt;
&lt;br /&gt;
In SettingsServer, &#039;&#039;&#039;do not modfify misc and network parts&#039;&#039;&#039;! It may cause malifunction.&lt;br /&gt;
&lt;br /&gt;
You may, however, modify &amp;lt;server&amp;gt; part on your own risk.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Create a new game&#039;&#039;&#039;&lt;br /&gt;
When server starts, you can create a new game, or load an existing one.&lt;br /&gt;
To create a new game, type to create a new server^&lt;br /&gt;
&amp;lt;pre&amp;gt;-new [seed_key]&amp;lt;/pre&amp;gt;&lt;br /&gt;
Seed_key is a word, which is used like seed value for random-based generation, like &amp;quot;voidexpance&amp;quot; or &amp;quot;hellyeah&amp;quot;, which will affect world generation on server.&lt;br /&gt;
For example, if you type&lt;br /&gt;
&amp;lt;pre&amp;gt;-new myworld&amp;lt;/pre&amp;gt;&lt;br /&gt;
random world will be created, always the same for &amp;quot;myworld&amp;quot; seed key. And if you type&lt;br /&gt;
&amp;lt;pre&amp;gt;-new hellyeah&amp;lt;/pre&amp;gt;&lt;br /&gt;
random world will be created too, but different from the one you&#039;ll get with &amp;quot;myworld&amp;quot;.&lt;br /&gt;
In other words, seed_key word defines generated world.&lt;br /&gt;
Feel free to experiment, type in you nickname to create your personal world =)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Saving game====&lt;br /&gt;
In multiplayer mode, server automatically saves game every time interval, specified in SettingsServer.xml (autosave_delay parameter).&lt;br /&gt;
You can save server game with console command &#039;&#039;savegame&#039;&#039;.&lt;br /&gt;
&amp;lt;pre&amp;gt;savegame&amp;lt;/pre&amp;gt; - will save you game to slot 0 under the name &amp;quot;CurrentWorld&amp;quot;.&lt;br /&gt;
&amp;lt;pre&amp;gt;savegame 5 ServerNameWord&amp;lt;/pre&amp;gt; - will save you game to slot 5 under the name &amp;quot;ServerNameWord&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
====Loading game====&lt;br /&gt;
When server starts, you can create a new game, or load an existing one.&lt;br /&gt;
To load an existing game, use command:&lt;br /&gt;
&amp;lt;pre&amp;gt;-load [slot_number]&amp;lt;/pre&amp;gt;&lt;br /&gt;
You can use the same command not only when server starts, but even during the game, just type in console:&lt;br /&gt;
&amp;lt;pre&amp;gt;load 0&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Damonwall</name></author>
	</entry>
	<entry>
		<id>https://wiki.atomictorch.com/index.php?title=VoidExpanse/scripting_api&amp;diff=135</id>
		<title>VoidExpanse/scripting api</title>
		<link rel="alternate" type="text/html" href="https://wiki.atomictorch.com/index.php?title=VoidExpanse/scripting_api&amp;diff=135"/>
		<updated>2014-03-25T03:28:43Z</updated>

		<summary type="html">&lt;p&gt;Damonwall: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Multiplayer server setup =&lt;br /&gt;
&lt;br /&gt;
== GUI for multiplayer server ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Currently in development&#039;&#039;&#039;&lt;br /&gt;
We are planning to create a gui for Windows, Mac and Linux to provide easy, user-friendly server setup and management.&lt;br /&gt;
However, on console-based systems, like FreeBSD, there&#039;s always available server setup and management with console commands.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Multiplayer server setup ==&lt;br /&gt;
&lt;br /&gt;
To launch a multiplayer server on any system, your system needs to meet following requirements:&lt;br /&gt;
* .Net/Mono, compatible with .net framework 4.0&lt;br /&gt;
&lt;br /&gt;
=== Installation ===&lt;br /&gt;
1. Copy the following files from game distributive to your server machine:&lt;br /&gt;
* folder Server&lt;br /&gt;
* folder Mods&lt;br /&gt;
&lt;br /&gt;
Installation complete!&lt;br /&gt;
&lt;br /&gt;
=== Launch ===&lt;br /&gt;
&lt;br /&gt;
====Windows====&lt;br /&gt;
Launch AtomicTorch.SpaceRPG.Server.RuntimeWin.exe from ./Server/ folder.&lt;br /&gt;
&lt;br /&gt;
====Other system with Mono====&lt;br /&gt;
Launch AtomicTorch.SpaceRPG.Server.RuntimeWin.exe from ./Server/Mono folder with mono,&lt;br /&gt;
like this:&lt;br /&gt;
&amp;lt;pre&amp;gt;mono AtomicTorch.SpaceRPG.Server.RuntimeWin.exe&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Launch complete!&lt;br /&gt;
&lt;br /&gt;
=== Settings ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;SettingsServer.xml&#039;&#039;&#039;&lt;br /&gt;
Most of settings are stored in SettingsServer.xml, which is located in the same folder as server .exe file.&lt;br /&gt;
If it&#039;s not there, launch server once with &amp;quot;-new&amp;quot; argument, and it&#039;ll be created automatically.&lt;br /&gt;
&lt;br /&gt;
In SettingsServer, &#039;&#039;&#039;do not modfify misc and network parts&#039;&#039;&#039;! It may cause malifunction.&lt;br /&gt;
&lt;br /&gt;
You may, however, modify &amp;lt;server&amp;gt; part on your own risk.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Create a new game&#039;&#039;&#039;&lt;br /&gt;
When server starts, you can create a new game, or load an existing one.&lt;br /&gt;
To create a new game, type to create a new server^&lt;br /&gt;
&amp;lt;pre&amp;gt;-new [seed_key]&amp;lt;/pre&amp;gt;&lt;br /&gt;
Seed_key is a word, which is used like seed value for random-based generation, like &amp;quot;voidexpance&amp;quot; or &amp;quot;hellyeah&amp;quot;, which will affect world generation on server.&lt;br /&gt;
For example, if you type&lt;br /&gt;
&amp;lt;pre&amp;gt;-new myworld&amp;lt;/pre&amp;gt;&lt;br /&gt;
random world will be created, always the same for &amp;quot;myworld&amp;quot; seed key. And if you type&lt;br /&gt;
&amp;lt;pre&amp;gt;-new hellyeah&amp;lt;/pre&amp;gt;&lt;br /&gt;
random world will be created too, but different from the one you&#039;ll get with &amp;quot;myworld&amp;quot;.&lt;br /&gt;
In other words, seed_key word defines generated world.&lt;br /&gt;
Feel free to experiment, type in you nickname to create your personal world =)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Saving game====&lt;br /&gt;
In multiplayer mode, server automatically saves game every time interval, specified in SettingsServer.xml (autosave_delay parameter).&lt;br /&gt;
You can save server game with console command &#039;&#039;savegame&#039;&#039;.&lt;br /&gt;
&amp;lt;pre&amp;gt;savegame&amp;lt;/pre&amp;gt; - will save you game to slot 0 under the name &amp;quot;CurrentWorld&amp;quot;.&lt;br /&gt;
&amp;lt;pre&amp;gt;savegame 5 ServerNameWord&amp;lt;/pre&amp;gt; - will save you game to slot 5 under the name &amp;quot;ServerNameWord&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
====Loading game====&lt;br /&gt;
When server starts, you can create a new game, or load an existing one.&lt;br /&gt;
To load an existing game, use command&lt;br /&gt;
&amp;lt;pre&amp;gt;-load [slot_number]&amp;lt;/pre&amp;gt;, for example, &amp;lt;pre&amp;gt;-load 0&amp;lt;/pre&amp;gt;.&lt;br /&gt;
You can use the same command not only when server starts, but even during the game, just type in console:&lt;br /&gt;
&amp;lt;pre&amp;gt;load 0&amp;lt;/pre&amp;gt;, and game from specified slot will be loaded.&lt;/div&gt;</summary>
		<author><name>Damonwall</name></author>
	</entry>
	<entry>
		<id>https://wiki.atomictorch.com/index.php?title=VoidExpanse/scripting_api&amp;diff=134</id>
		<title>VoidExpanse/scripting api</title>
		<link rel="alternate" type="text/html" href="https://wiki.atomictorch.com/index.php?title=VoidExpanse/scripting_api&amp;diff=134"/>
		<updated>2014-03-25T03:25:40Z</updated>

		<summary type="html">&lt;p&gt;Damonwall: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Multiplayer server setup =&lt;br /&gt;
&lt;br /&gt;
== GUI for multiplayer server ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Currently in development&#039;&#039;&#039;&lt;br /&gt;
We are planning to create a gui for Windows, Mac and Linux to provide easy, user-friendly server setup and management.&lt;br /&gt;
However, on console-based systems, like FreeBSD, there&#039;s always available server setup and management with console commands.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Multiplayer server setup ==&lt;br /&gt;
&lt;br /&gt;
To launch a multiplayer server on any system, your system needs to meet following requirements:&lt;br /&gt;
* .Net/Mono, compatible with .net framework 4.0&lt;br /&gt;
&lt;br /&gt;
=== Installation ===&lt;br /&gt;
1. Copy the following files from game distributive to your server machine:&lt;br /&gt;
* folder Server&lt;br /&gt;
* folder Mods&lt;br /&gt;
&lt;br /&gt;
Installation complete!&lt;br /&gt;
&lt;br /&gt;
=== Launch ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Windows&#039;&#039;&#039;&lt;br /&gt;
Launch AtomicTorch.SpaceRPG.Server.RuntimeWin.exe from ./Server/ folder.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Other system with Mono&#039;&#039;&#039;&lt;br /&gt;
Launch AtomicTorch.SpaceRPG.Server.RuntimeWin.exe from ./Server/Mono folder with mono,&lt;br /&gt;
like this:&lt;br /&gt;
&amp;lt;pre&amp;gt;mono AtomicTorch.SpaceRPG.Server.RuntimeWin.exe&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Launch complete!&lt;br /&gt;
&lt;br /&gt;
=== Settings ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;SettingsServer.xml&#039;&#039;&#039;&lt;br /&gt;
Most of settings are stored in SettingsServer.xml, which is located in the same folder as server .exe file.&lt;br /&gt;
If it&#039;s not there, launch server once with &amp;quot;-new&amp;quot; argument, and it&#039;ll be created automatically.&lt;br /&gt;
&lt;br /&gt;
In SettingsServer, &#039;&#039;&#039;do not modfify misc and network parts&#039;&#039;&#039;! It may cause malifunction.&lt;br /&gt;
&lt;br /&gt;
You may, however, modify &amp;lt;server&amp;gt; part on your own risk.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Create a new game&#039;&#039;&#039;&lt;br /&gt;
When server starts, you can create a new game, or load an existing one.&lt;br /&gt;
To create a new game, type&lt;br /&gt;
&amp;lt;pre&amp;gt;-new [seed_key]&amp;lt;/pre&amp;gt;&lt;br /&gt;
to create a new server.&lt;br /&gt;
Seed_key is a word, like &amp;quot;voidexpance&amp;quot; or &amp;quot;hellyeah&amp;quot;, which will affect world generation on server.&lt;br /&gt;
For example, if you type&lt;br /&gt;
&amp;lt;pre&amp;gt;-new myworld&amp;lt;/pre&amp;gt;&lt;br /&gt;
random world will be created, always the same for &amp;quot;myworld&amp;quot; seed key. And if you type&lt;br /&gt;
&amp;lt;pre&amp;gt;-new hellyeah&amp;lt;/pre&amp;gt;&lt;br /&gt;
random world will be created too, but different from the one you&#039;ll get with &amp;quot;myworld&amp;quot;.&lt;br /&gt;
In other words, seed_key word defines generated world.&lt;br /&gt;
Feel free to experiment, type in you nickname to create your personal world =)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Saving game&#039;&#039;&#039;&lt;br /&gt;
In multiplayer mode, server automatically saves game every time interval, specified in SettingsServer.xml (autosave_delay parameter).&lt;br /&gt;
You can save server game with console command &#039;&#039;savegame&#039;&#039;.&lt;br /&gt;
&amp;lt;pre&amp;gt;savegame&amp;lt;/pre&amp;gt; - will save you game to slot 0 under the name &amp;quot;CurrentWorld&amp;quot;.&lt;br /&gt;
&amp;lt;pre&amp;gt;savegame 5 ServerNameWord&amp;lt;/pre&amp;gt; - will save you game to slot 5 under the name &amp;quot;ServerNameWord&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Loading game&#039;&#039;&#039;&lt;br /&gt;
When server starts, you can create a new game, or load an existing one.&lt;br /&gt;
To load an existing game, use command&lt;br /&gt;
&amp;lt;pre&amp;gt;-load [slot_number]&amp;lt;/pre&amp;gt;, for example, &amp;lt;pre&amp;gt;-load 0&amp;lt;/pre&amp;gt;.&lt;br /&gt;
You can use the same command not only when server starts, but even during the game, just type in console:&lt;br /&gt;
&amp;lt;pre&amp;gt;load 0&amp;lt;/pre&amp;gt;, and game from specified slot will be loaded.&lt;/div&gt;</summary>
		<author><name>Damonwall</name></author>
	</entry>
	<entry>
		<id>https://wiki.atomictorch.com/index.php?title=VoidExpanse/scope-game&amp;diff=132</id>
		<title>VoidExpanse/scope-game</title>
		<link rel="alternate" type="text/html" href="https://wiki.atomictorch.com/index.php?title=VoidExpanse/scope-game&amp;diff=132"/>
		<updated>2014-03-13T10:28:13Z</updated>

		<summary type="html">&lt;p&gt;Damonwall: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:VoidExpanse/api_scopes]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Scope game =&lt;br /&gt;
Used for various in-game functions.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Visibility:&#039;&#039;&#039; Global.&lt;br /&gt;
&lt;br /&gt;
== List of functions ==&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|ApplyForceToObject|&lt;br /&gt;
* int: object_id&lt;br /&gt;
* double: force_x&lt;br /&gt;
* double: force_y |&lt;br /&gt;
void |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;game.ApplyForceToObject(153, 10, 0); // add x-axis force&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Applies force to physics object. Will work on any interactive object.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|ApplyTorqueToObject|&lt;br /&gt;
* int: object_id&lt;br /&gt;
* double: torque |&lt;br /&gt;
void |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;game.ApplyTorqueToObject(153, 10); // add torque&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Applies torque to physics object. Will work on any interactive object.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|DamageProjectile|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* int: projectile_id&lt;br /&gt;
* double: damage |&lt;br /&gt;
void |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;game.DamageProjectile(1, 12, 10);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Damages projectile. Projectile, that took enough damage, will explode.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|TryToRemoveContentFromAsteroid|&lt;br /&gt;
* int: asteroid_id&lt;br /&gt;
* string: name&lt;br /&gt;
* int: amount |&lt;br /&gt;
int: amount of content extracted from asteroid|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;game.TryToRemoveContentFromAsteroid(12, &amp;quot;ResourceOre&amp;quot;, 10);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Tries to remove specified resource from asteroid&#039;s contents. Returns extracted amount.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetItemEffects|&lt;br /&gt;
* string: xml_item_id|&lt;br /&gt;
array of objects:&lt;br /&gt;
* double: effect_base&lt;br /&gt;
* double: effect_cap&lt;br /&gt;
* double: effect_per_level&lt;br /&gt;
* double: effect_type|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var effects = game.GetItemEffects(&amp;quot;SomeItem&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns an array of all effects of specified item.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetItemPrice|&lt;br /&gt;
* string: xml_item_id|&lt;br /&gt;
int: item_price|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var price = game.GetItemPrice(&amp;quot;SomeItem&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetItemSID|&lt;br /&gt;
* int: unique_item_id |&lt;br /&gt;
string: xml_item_id |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var xml_item_id = game.GetItemSID(12352);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns xml_id of item by it&#039;s instance ID.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetProjectileDescriptionByXmlID|&lt;br /&gt;
* string: projectile_xml_id |&lt;br /&gt;
object:&lt;br /&gt;
* double: damage&lt;br /&gt;
* string: damage_type|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var xml_item_id = game.GetProjectileDescriptionByXmlID(&amp;quot;wpn_0&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Gets projectile description. Projectile xml ID is constructed by the following rule: wpn_id + &amp;quot;_&amp;quot; + projectile_order (starting with 0).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetSecondsMultiplier|&lt;br /&gt;
void |&lt;br /&gt;
void |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var multiplier = game.GetSecondsMultiplier();&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns time passed since last frame. Useful when calculating time-depended stuff, like health-regeneration or damage.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetGameObjectTags|&lt;br /&gt;
* int: object_id |&lt;br /&gt;
void |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var tags = game.GetGameObjectTags(131);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Gets game object tags. Any physical object, such as asteroid, space object, ship or else, has it&#039;s own tags. This function can retrieve it. Alias of game.GetTags.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetTags|&lt;br /&gt;
* int: object_id |&lt;br /&gt;
void |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var tags = game.GetTags(131);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Gets game object tags. Any physical object, such as asteroid, space object, ship or else, has it&#039;s own tags. This function can retrieve it. The same as game.GetGameObjectTags.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetShipOwner|&lt;br /&gt;
* int: ship_id |&lt;br /&gt;
string: owner_name |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var name = game.GetShipOwner(123142);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns name of ship&#039;s owner. If ship is npc-controller, that would be npc name, else - player&#039;s name.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetAsteroidMiningListByID|&lt;br /&gt;
* int: asteroid_id |&lt;br /&gt;
array of objects:&lt;br /&gt;
* string: xml_id&lt;br /&gt;
* int: quantity&lt;br /&gt;
* int: extraction|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var list = game.GetAsteroidMiningListByID(1252);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns actual ateroid mining list.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetAsteroidDescriptionByID|&lt;br /&gt;
* int: asteroid_id |&lt;br /&gt;
object:&lt;br /&gt;
* int: type&lt;br /&gt;
* int: difficulty|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var desc = game.GetAsteroidDescriptionByID(1252);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns asteroid description.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetSkillEffects|&lt;br /&gt;
* string: skill_xml_id |&lt;br /&gt;
array of objects:&lt;br /&gt;
* int: cost&lt;br /&gt;
* int: page&lt;br /&gt;
* string: title|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var effects = game.GetSkillEffects(&amp;quot;SomeSkill&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns array of specified skills&#039; effects.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|IsResource|&lt;br /&gt;
* string: item_xml_id |&lt;br /&gt;
bool: is specified item resource|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var is_res = game.IsResource(&amp;quot;SomeItemOrResource&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|IsHull|&lt;br /&gt;
* string: item_xml_id |&lt;br /&gt;
bool: is specified item is hull|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var is_hull = game.IsHull(&amp;quot;SomeItemOrResource&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|IsDevice|&lt;br /&gt;
* string: item_xml_id |&lt;br /&gt;
bool: is specified item is device|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var is_dev = game.IsDevice(&amp;quot;SomeItemOrResource&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|IsWeapon|&lt;br /&gt;
* string: item_xml_id |&lt;br /&gt;
bool: is specified item is weapon|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var is_wpn = game.IsWeapon(&amp;quot;SomeItemOrResource&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|IsShipPlayerControlled|&lt;br /&gt;
* int: ship_id |&lt;br /&gt;
bool: is ship controlled by player|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var is_player = game.IsShipPlayerControlled(123252);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetSystemJumpgates|&lt;br /&gt;
* int: system_id |&lt;br /&gt;
array: IDs of system jumpgates |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var jumpgates = game.GetSystemJumpgates(1);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns all jumpgates of specified system.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetSystemBases|&lt;br /&gt;
* int: system_id |&lt;br /&gt;
array: IDs of system bases |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var bases = game.GetSystemBases(1);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns all bases of specified system.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetSystemShips|&lt;br /&gt;
* int: system_id |&lt;br /&gt;
array: IDs of system ships |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var ships = game.GetSystemShips(1);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns all ships of specified system.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetSystemShipsOfClass|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* string: tags_class |&lt;br /&gt;
array: IDs of system ships |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var miner_ships = game.GetSystemShipsOfClass(1, &amp;quot;miner&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns all ships of specified system, which tag &amp;quot;class&amp;quot; is equal to specified value.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetSystemPlayersShips|&lt;br /&gt;
* int: system_id |&lt;br /&gt;
array: IDs of system players&#039; ships |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var ships = game.GetSystemPlayersShips(1);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns all player-controlled ships of specified system.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetObjectCoordinates|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* int: object_id |&lt;br /&gt;
vector2: coordinates |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var coords = game.GetObjectCoordinates(1, 25442);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns coordinates of specified object.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|DeleteGameObject|&lt;br /&gt;
* int: object_id |&lt;br /&gt;
void |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;game.DeleteGameObject(25442);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Deletes game object from game world.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetBaseEntryPointsByID|&lt;br /&gt;
* int: base_id |&lt;br /&gt;
array of vector2 |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var points = game.GetBaseEntryPointsByID(353);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns bases&#039; actual entry points coordinates.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetSecondsBetweenStarSystemUpdates|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* int: seconds |&lt;br /&gt;
void |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;game.SetSecondsBetweenStarSystemUpdates(1, 60);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets interval between event &amp;quot;OnStarSystemUpdate&amp;quot; for this system calls.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SendNotification|&lt;br /&gt;
* string: player_name&lt;br /&gt;
* string: title&lt;br /&gt;
* string: message |&lt;br /&gt;
void |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;game.SendNotification(&amp;quot;dlirry&amp;quot;, &amp;quot;Server notification&amp;quot;, &amp;quot;You are great player!&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sends notification to connected player.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetAllItems|&lt;br /&gt;
void |&lt;br /&gt;
array: xml-ids (strings) of all items |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var res = game.GetAllItems();&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Gets all items.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetItems|&lt;br /&gt;
* int: level&lt;br /&gt;
* string[]: item_types |&lt;br /&gt;
array: xml-ids (strings) of items |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var res = game.GetItems(15, [&amp;quot;Hull&amp;quot;, &amp;quot;Consumable&amp;quot;]);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Gets all items of specified type.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetItemTypes|&lt;br /&gt;
void |&lt;br /&gt;
array: strings of types |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var res = game.GetItemTypes();&amp;lt;/pre&amp;gt; |&lt;br /&gt;
&#039;&#039;&#039;not implemented&#039;&#039;&#039;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetProjectileFromSystemByID|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* int: projectile_id |&lt;br /&gt;
object:&lt;br /&gt;
* string: id&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y&lt;br /&gt;
* int: caster_id |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var proj = game.GetProjectileFromSystemByID(15,2524);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns basic information about specified projectile. ID in returned object is full projectile ID, which is&lt;br /&gt;
xml_weapon_id + &amp;quot;_&amp;quot; + number_of_projectile_in_weapon.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|ProjectileFromSystemDestroy|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* int: projectile_id |&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;game.ProjectileFromSystemDestroy(15,2524);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Destroys specified projectile.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|ProjectileFromSystemSetSpeed|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* int: projectile_id&lt;br /&gt;
* double: speed_x&lt;br /&gt;
* double: speed_y|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;game.ProjectileFromSystemSetSpeed(15,2524, 0, 0); //stop projectile&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets projectile linear speed. Useful for manipulating projectile speed, doesn&#039;t affect it&#039;s direction.&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Damonwall</name></author>
	</entry>
	<entry>
		<id>https://wiki.atomictorch.com/index.php?title=VoidExpanse/scope-ship&amp;diff=131</id>
		<title>VoidExpanse/scope-ship</title>
		<link rel="alternate" type="text/html" href="https://wiki.atomictorch.com/index.php?title=VoidExpanse/scope-ship&amp;diff=131"/>
		<updated>2014-03-13T10:21:20Z</updated>

		<summary type="html">&lt;p&gt;Damonwall: /* List of functions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:VoidExpanse/api_scopes]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Scope ship =&lt;br /&gt;
Used to get info and manipulate objects if type &amp;quot;ship&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Visibility:&#039;&#039;&#039; Global.&lt;br /&gt;
&lt;br /&gt;
== List of functions ==&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddItem|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: xml_item_type&lt;br /&gt;
* int: quantity|&lt;br /&gt;
object:&lt;br /&gt;
* int: quantity - amount added&lt;br /&gt;
* string: type - &amp;quot;item&amp;quot; or &amp;quot;resource&amp;quot;|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var obj = ship.Add(24556, &amp;quot;SomeItem2&amp;quot;, 5);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds item to ship&#039;s inventory.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddItemToStorage|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: xml_item_type&lt;br /&gt;
* int: quantity|&lt;br /&gt;
object:&lt;br /&gt;
* int: quantity - amount added&lt;br /&gt;
* string: type - &amp;quot;item&amp;quot; or &amp;quot;resource&amp;quot;|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var obj = ship.AddItemToStorage(24556, &amp;quot;BFG&amp;quot;, 0);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds item to ship&#039;s storage, not inventory (only works on a base). Useful when you need to add new hull through scripts, but&lt;br /&gt;
it cannot be added to inventory, only to storage.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RemoveItem|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* int: item_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.RemoveItem(24556, 5562);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes item from ship&#039;s inventory.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RemoveItemByType|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: item_xml_type|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.RemoveItemByType(24556, &amp;quot;SomeItem2&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes item from PLAYER&#039;s inventory by type. If there&#039;s no item of specified type in ship&#039;s&lt;br /&gt;
inventory, nothing will happen.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RemoveCargoByType|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: cargo_type&lt;br /&gt;
* &#039;&#039;(optional) int: cargo_quantity&#039;&#039;|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.RemoveCargoByType(24556, &amp;quot;SomeCargo&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes cargo from PLAYER&#039;s inventory by type. If there&#039;s no cargo of specified type in ship&#039;s&lt;br /&gt;
inventory, nothing will happen.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddSkillPointsToPlayer|&lt;br /&gt;
* string: player_name&lt;br /&gt;
* int: skillpoints|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.AddSkillPointsToPlayer(&amp;quot;DLirry&amp;quot;, 20);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds skill points to specified player.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddSkillPointsToShip|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* int: skillpoints|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.AddSkillPointsToShip(12335, 20);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds skill points to specified ship (works only on player&#039;s ships, non-npc).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetCargoAmount|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: cargo_type|&lt;br /&gt;
int: amount|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var left = ship.GetCargoAmount(24556, &amp;quot;SomeCargo&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns amount of specified cargo in player&#039;s inventory.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetCoordinates|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
vector2: coordinates|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var coords = ship.GetCoordinates(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns current coordinates of specified ship. Alias of GetPosition.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetShipsInScope|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
array of int: ids|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var ships = ship.GetShipsInScope(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns IDs of all ships, that are currently in specified ship&#039;s scope.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetProjectilesInScope|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
array of int: ids|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var bullets = ship.GetProjectilesInScope(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns IDs of all projectiles, that are currently in specified ship&#039;s scope.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetDistanceToObj|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* int: object_id |&lt;br /&gt;
double: distance|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var dist = ship.GetDistanceToObj(24556, 25225);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns distance from specified ship to specified object.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|HasCargoAmount|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: cargo_type&lt;br /&gt;
* int: amount|&lt;br /&gt;
bool|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var hasCargo = ship.HasCargoAmount(24556, &amp;quot;SomeCargo&amp;quot;, 14);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Checks if player has specified amount of cargo.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|HasItemOfType|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: item_id|&lt;br /&gt;
bool: if player&#039;s ship has item of specified type|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var hasItem = ship.HasItemOfType(24556, &amp;quot;SomeItem1&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Useful in quests.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetBuffs|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
array of objects:&lt;br /&gt;
* int: caster - id of ship casted this active effect&lt;br /&gt;
* double: time_left - time left&lt;br /&gt;
* double: effect_base&lt;br /&gt;
* double: effect_cap&lt;br /&gt;
* double: effect_per_level&lt;br /&gt;
* string: effect_type|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var effects = ship.GetBuffs(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns all specified ship&#039;s active effects. Active effects are temporary effects, which are usually&lt;br /&gt;
effects of consumables or devices.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetBuffsCache|&lt;br /&gt;
* int: ship_id |&lt;br /&gt;
array: key - value |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var cache = ship.GetBuffsCache(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns current buffs cache. Used in FinalCacheCalculations.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetCurrentValue|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: name|&lt;br /&gt;
double: current value with specified key|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var val = ship.GetCurrentValue(24556, &amp;quot;structure&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns current value of ship.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetCurrentValuesList|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
array: key -&amp;gt; value|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var values = ship.GetCurrentValuesList(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns all current values of ship.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetEquipment|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
array: unique IDs (int) of equipped items|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var equipment = ship.GetEquipment(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns current equipment of player&#039;s ship. Npc ship has no equipment, so it cannot be retreieved this way.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetWeapons|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
array: unique IDs (int) of equipped weapons|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var weapons = ship.GetWeapons(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns currently equipped weapons of a ship. Npc ship has no equipment, so it cannot be retireved this way.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetWeaponsOfType|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* int: weapon_type (1 for energy, 2 for ballistic, 3 for missile)|&lt;br /&gt;
array: unique IDs (int) of equipped weapons|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var weapons = ship.GetWeapons(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns currently equipped weapons of a ship of a specified type. Npc ship has no equipment, so it cannot be retireved this way.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RefillAmmoForWeapon|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* int: weapon_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.RefillAmmoForWeapon(24556, 15252);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Refills ammo for weapon with specified unique in-game id (GID).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetHullXmlID|&lt;br /&gt;
* int: ship_id |&lt;br /&gt;
string: current ship&#039;s hull&#039;s xml type|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var hull = ship.GetHullXmlID(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns currently equipped hull&#039;s xml_id.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetEquipmentCache|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
array: key-value|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var cache = ship.GetEquipmentCache(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns current equipment cache of ship.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetFinalCache|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
array: key-value|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var cache = ship.GetFinalCache(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns current final cache of ship.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetFinalCacheValue|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: name|&lt;br /&gt;
double: specified cache value|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var val = ship.GetFinalCacheValue(24556, &amp;quot;structure&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns final cache value.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetSkills|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
array of objects:&lt;br /&gt;
* string: id&lt;br /&gt;
* int: level&lt;br /&gt;
* string: skill_id|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var skills = ship.GetSkills(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns all current skills of ship.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetSkillsCache|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
array: key-value|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var cache = ship.GetSkillsCache(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns current skills cache.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetLevel|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
int: current level of ship|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var level = ship.GetLevel(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetTags|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
object: tags of a ship|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var tags = ship.GetTags(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetSystemID|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
int: ID of ship&#039;s current system|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var sys_id = ship.GetSystemID(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|IsDocked|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
bool: returns whether ship is currently docked|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var docked = ship.IsDocked(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|EnteringJumpgate|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
int: returns ID of jumpgate ship is entering (or 0 if none)|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var current_jumpgate = ship.EnteringJumpgate(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetCurrentBase|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
int: returns ID of base to which ship is docked (or -1 if none)|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var current_base = ship.GetCurrentBase(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetTimeSinceLastHit|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
double: time since ship last time dealt damage to someone|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var time = ship.GetTimeSinceLastHit(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Used in AI&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetTimeSinceLastHitted|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
double: time since ship last time took damage from someone|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var time = ship.GetTimeSinceLastHitted(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Used in ship&#039;s shield reestablishment calculations.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|IsShieldUp|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
bool: returns whether ship&#039;s shield is up|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var shield_up = ship.IsShieldUp(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|IsNpc|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
bool: returns whether ship is npc-controlled|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var is_npc = ship.IsNpc(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|IsEngineOn|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
bool: returns whether ship&#039;s engine is working|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var is_engine_on = ship.IsEngineOn(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RegenerateWeapons|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* double: energy&lt;br /&gt;
* double: mult|&lt;br /&gt;
double: amount of energy spent on weapons regeneration|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var energy_spent = ship.RegenerateWeapons(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Hardcoded part - trying to regenerate weapons with energy. Only usable on PLAYER&#039;s ships. Returns amount of energy spent on weapons regeneration.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|ReleaseGrappler|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.ReleaseGrappler(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Release all current grappled objects.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetGrappledCount|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
int: number of grappled objects|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var grappled = ship.GetGrappledCount(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Get number of grappled objects. Useful in caluclation of grappler energy consumption.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetBuffsCacheValue|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: field_name&lt;br /&gt;
* double: value|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.SetBuffsCacheValue(24556, &amp;quot;structure&amp;quot;, 2);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets buff cache value.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|ClearBuffsCache|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.ClearBuffsCache(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Clears all current buffs cache values.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetCurrentValue|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: field_name&lt;br /&gt;
* double: val|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.SetCurrentValue(24556, &amp;quot;structure&amp;quot;, 59);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets current value of ship&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetCurrentValueDelta|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: field_name&lt;br /&gt;
* double: val|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.SetCurrentValueDelta(24556, &amp;quot;structure&amp;quot;, -10);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Alters current value to specified value. Value will be clamped automatically between 0 and it&#039;s max value (which is governed by ship params.)&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetDrift|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* double: time|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.SetDrift(24556, 5000);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Enables driftmode of ship - in this mode ship cannot be controlled and can gain torque (which is always 0 when driftmode is off). Useful in explosion effects.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetEquipmentCacheValue|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: field_name&lt;br /&gt;
* double: value|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.SetEquipmentCacheValue(24556, &amp;quot;structure&amp;quot;, 5000);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets equipment cache value.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|ClearEquipmentCache|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.ClearEquipmentCache(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Clears equipment cache.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetFinalCacheValue|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: field_name&lt;br /&gt;
* double: value|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.SetFinalCacheValue(24556, &amp;quot;structure&amp;quot;, 5000);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets final cache value. Final cache is the one used in all in-game caluclations.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetShieldUp|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* bool: status - true or false|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.SetShieldUp(24556, true);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets shield up/down status. Affects collision and damage models. Does not applies visual effects (see more in [[VoidExpanse/scope-visual|VisualScope]]). &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetSkillsCacheValue|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: field_name&lt;br /&gt;
* double: value|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.SetSkillsCacheValue(24556, &amp;quot;structure&amp;quot;, 5000);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets skill cache value.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|ClearSkillsCache|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.ClearSkillsCache(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Clear skills cache.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetShipAsArrivedFromJumpgate|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* int: jumpgate_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.SetShipAsArrivedFromJumpgate(24556, 15);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Set visual and physical effects, that looks like ship just arrived from specified jumpgate.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetDamageByShip|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* double: damage&lt;br /&gt;
* int: caster_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.SetDamageByShip(24556, 15, 44535);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets damage from ship. Useful in AI - you can count damage from player ship and decide, whether to attack or not.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetDamageByShip|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* int: caster_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var dmg = ship.SetDamageByShip(24556, 44535);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Gets damage by ship, which was set by ship.SetDamageByShip method.&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Damonwall</name></author>
	</entry>
	<entry>
		<id>https://wiki.atomictorch.com/index.php?title=VoidExpanse/scope-ship&amp;diff=130</id>
		<title>VoidExpanse/scope-ship</title>
		<link rel="alternate" type="text/html" href="https://wiki.atomictorch.com/index.php?title=VoidExpanse/scope-ship&amp;diff=130"/>
		<updated>2014-03-11T10:43:52Z</updated>

		<summary type="html">&lt;p&gt;Damonwall: /* List of functions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:VoidExpanse/api_scopes]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Scope ship =&lt;br /&gt;
Used to get info and manipulate objects if type &amp;quot;ship&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Visibility:&#039;&#039;&#039; Global.&lt;br /&gt;
&lt;br /&gt;
== List of functions ==&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddItem|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: xml_item_type&lt;br /&gt;
* int: quantity|&lt;br /&gt;
object:&lt;br /&gt;
* int: quantity - amount added&lt;br /&gt;
* string: type - &amp;quot;item&amp;quot; or &amp;quot;resource&amp;quot;|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var obj = ship.Add(24556, &amp;quot;SomeItem2&amp;quot;, 5);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds item to ship&#039;s inventory.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddItemToStorage|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: xml_item_type&lt;br /&gt;
* int: quantity|&lt;br /&gt;
object:&lt;br /&gt;
* int: quantity - amount added&lt;br /&gt;
* string: type - &amp;quot;item&amp;quot; or &amp;quot;resource&amp;quot;|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var obj = ship.AddItemToStorage(24556, &amp;quot;BFG&amp;quot;, 0);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds item to ship&#039;s storage, not inventory (only works on a base). Useful when you need to add new hull through scripts, but&lt;br /&gt;
it cannot be added to inventory, only to storage.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RemoveItem|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* int: item_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.RemoveItem(24556, 5562);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes item from ship&#039;s inventory.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RemoveItemByType|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: item_xml_type|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.RemoveItemByType(24556, &amp;quot;SomeItem2&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes item from PLAYER&#039;s inventory by type. If there&#039;s no item of specified type in ship&#039;s&lt;br /&gt;
inventory, nothing will happen.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RemoveCargoByType|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: cargo_type&lt;br /&gt;
* &#039;&#039;(optional) int: cargo_quantity&#039;&#039;|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.RemoveCargoByType(24556, &amp;quot;SomeCargo&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes cargo from PLAYER&#039;s inventory by type. If there&#039;s no cargo of specified type in ship&#039;s&lt;br /&gt;
inventory, nothing will happen.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddSkillPointsToPlayer|&lt;br /&gt;
* string: player_name&lt;br /&gt;
* int: skillpoints|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.AddSkillPointsToPlayer(&amp;quot;DLirry&amp;quot;, 20);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds skill points to specified player.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddSkillPointsToShip|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* int: skillpoints|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.AddSkillPointsToShip(12335, 20);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds skill points to specified ship (works only on player&#039;s ships, non-npc).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetCargoAmount|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: cargo_type|&lt;br /&gt;
int: amount|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var left = ship.GetCargoAmount(24556, &amp;quot;SomeCargo&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns amount of specified cargo in player&#039;s inventory.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|HasCargoAmount|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: cargo_type&lt;br /&gt;
* int: amount|&lt;br /&gt;
bool|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var hasCargo = ship.HasCargoAmount(24556, &amp;quot;SomeCargo&amp;quot;, 14);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Checks if player has specified amount of cargo.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|HasItemOfType|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: item_id|&lt;br /&gt;
bool: if player&#039;s ship has item of specified type|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var hasItem = ship.HasItemOfType(24556, &amp;quot;SomeItem1&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Useful in quests.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetBuffs|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
array of objects:&lt;br /&gt;
* int: caster - id of ship casted this active effect&lt;br /&gt;
* double: time_left - time left&lt;br /&gt;
* double: effect_base&lt;br /&gt;
* double: effect_cap&lt;br /&gt;
* double: effect_per_level&lt;br /&gt;
* string: effect_type|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var effects = ship.GetBuffs(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns all specified ship&#039;s active effects. Active effects are temporary effects, which are usually&lt;br /&gt;
effects of consumables or devices.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetBuffsCache|&lt;br /&gt;
* int: ship_id |&lt;br /&gt;
array: key - value |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var cache = ship.GetBuffsCache(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns current buffs cache. Used in FinalCacheCalculations.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetCurrentValue|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: name|&lt;br /&gt;
double: current value with specified key|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var val = ship.GetCurrentValue(24556, &amp;quot;structure&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns current value of ship.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetCurrentValuesList|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
array: key -&amp;gt; value|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var values = ship.GetCurrentValuesList(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns all current values of ship.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetEquipment|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
array: unique IDs (int) of equipped items|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var equipment = ship.GetEquipment(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns current equipment of player&#039;s ship. Npc ship has no equipment, so it cannot be retreieved this way.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetWeapons|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
array: unique IDs (int) of equipped weapons|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var weapons = ship.GetWeapons(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns currently equipped weapons of a ship. Npc ship has no equipment, so it cannot be retireved this way.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetWeaponsOfType|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* int: weapon_type (1 for energy, 2 for ballistic, 3 for missile)|&lt;br /&gt;
array: unique IDs (int) of equipped weapons|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var weapons = ship.GetWeapons(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns currently equipped weapons of a ship of a specified type. Npc ship has no equipment, so it cannot be retireved this way.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RefillAmmoForWeapon|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* int: weapon_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.RefillAmmoForWeapon(24556, 15252);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Refills ammo for weapon with specified unique in-game id (GID).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetHullXmlID|&lt;br /&gt;
* int: ship_id |&lt;br /&gt;
string: current ship&#039;s hull&#039;s xml type|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var hull = ship.GetHullXmlID(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns currently equipped hull&#039;s xml_id.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetEquipmentCache|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
array: key-value|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var cache = ship.GetEquipmentCache(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns current equipment cache of ship.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetFinalCache|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
array: key-value|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var cache = ship.GetFinalCache(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns current final cache of ship.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetFinalCacheValue|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: name|&lt;br /&gt;
double: specified cache value|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var val = ship.GetFinalCacheValue(24556, &amp;quot;structure&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns final cache value.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetSkills|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
array of objects:&lt;br /&gt;
* string: id&lt;br /&gt;
* int: level&lt;br /&gt;
* string: skill_id|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var skills = ship.GetSkills(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns all current skills of ship.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetSkillsCache|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
array: key-value|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var cache = ship.GetSkillsCache(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns current skills cache.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetLevel|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
int: current level of ship|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var level = ship.GetLevel(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetTags|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
object: tags of a ship|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var tags = ship.GetTags(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetSystemID|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
int: ID of ship&#039;s current system|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var sys_id = ship.GetSystemID(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|IsDocked|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
bool: returns whether ship is currently docked|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var docked = ship.IsDocked(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|EnteringJumpgate|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
int: returns ID of jumpgate ship is entering (or 0 if none)|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var current_jumpgate = ship.EnteringJumpgate(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetCurrentBase|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
int: returns ID of base to which ship is docked (or -1 if none)|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var current_base = ship.GetCurrentBase(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetTimeSinceLastHit|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
double: time since ship last time dealt damage to someone|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var time = ship.GetTimeSinceLastHit(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Used in AI&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetTimeSinceLastHitted|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
double: time since ship last time took damage from someone|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var time = ship.GetTimeSinceLastHitted(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Used in ship&#039;s shield reestablishment calculations.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|IsShieldUp|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
bool: returns whether ship&#039;s shield is up|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var shield_up = ship.IsShieldUp(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|IsNpc|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
bool: returns whether ship is npc-controlled|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var is_npc = ship.IsNpc(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|IsEngineOn|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
bool: returns whether ship&#039;s engine is working|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var is_engine_on = ship.IsEngineOn(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RegenerateWeapons|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* double: energy&lt;br /&gt;
* double: mult|&lt;br /&gt;
double: amount of energy spent on weapons regeneration|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var energy_spent = ship.RegenerateWeapons(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Hardcoded part - trying to regenerate weapons with energy. Only usable on PLAYER&#039;s ships. Returns amount of energy spent on weapons regeneration.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|ReleaseGrappler|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.ReleaseGrappler(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Release all current grappled objects.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetGrappledCount|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
int: number of grappled objects|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var grappled = ship.GetGrappledCount(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Get number of grappled objects. Useful in caluclation of grappler energy consumption.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetBuffsCacheValue|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: field_name&lt;br /&gt;
* double: value|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.SetBuffsCacheValue(24556, &amp;quot;structure&amp;quot;, 2);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets buff cache value.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|ClearBuffsCache|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.ClearBuffsCache(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Clears all current buffs cache values.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetCurrentValue|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: field_name&lt;br /&gt;
* double: val|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.SetCurrentValue(24556, &amp;quot;structure&amp;quot;, 59);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets current value of ship&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetCurrentValueDelta|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: field_name&lt;br /&gt;
* double: val|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.SetCurrentValueDelta(24556, &amp;quot;structure&amp;quot;, -10);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Alters current value to specified value. Value will be clamped automatically between 0 and it&#039;s max value (which is governed by ship params.)&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetDrift|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* double: time|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.SetDrift(24556, 5000);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Enables driftmode of ship - in this mode ship cannot be controlled and can gain torque (which is always 0 when driftmode is off). Useful in explosion effects.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetEquipmentCacheValue|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: field_name&lt;br /&gt;
* double: value|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.SetEquipmentCacheValue(24556, &amp;quot;structure&amp;quot;, 5000);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets equipment cache value.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|ClearEquipmentCache|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.ClearEquipmentCache(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Clears equipment cache.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetFinalCacheValue|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: field_name&lt;br /&gt;
* double: value|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.SetFinalCacheValue(24556, &amp;quot;structure&amp;quot;, 5000);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets final cache value. Final cache is the one used in all in-game caluclations.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetShieldUp|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* bool: status - true or false|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.SetShieldUp(24556, true);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets shield up/down status. Affects collision and damage models. Does not applies visual effects (see more in [[VoidExpanse/scope-visual|VisualScope]]). &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetSkillsCacheValue|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: field_name&lt;br /&gt;
* double: value|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.SetSkillsCacheValue(24556, &amp;quot;structure&amp;quot;, 5000);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets skill cache value.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|ClearSkillsCache|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.ClearSkillsCache(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Clear skills cache.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetShipAsArrivedFromJumpgate|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* int: jumpgate_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.SetShipAsArrivedFromJumpgate(24556, 15);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Set visual and physical effects, that looks like ship just arrived from specified jumpgate.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetDamageByShip|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* double: damage&lt;br /&gt;
* int: caster_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.SetDamageByShip(24556, 15, 44535);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets damage from ship. Useful in AI - you can count damage from player ship and decide, whether to attack or not.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetDamageByShip|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* int: caster_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var dmg = ship.SetDamageByShip(24556, 44535);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Gets damage by ship, which was set by ship.SetDamageByShip method.&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Damonwall</name></author>
	</entry>
	<entry>
		<id>https://wiki.atomictorch.com/index.php?title=VoidExpanse/scope-generator&amp;diff=129</id>
		<title>VoidExpanse/scope-generator</title>
		<link rel="alternate" type="text/html" href="https://wiki.atomictorch.com/index.php?title=VoidExpanse/scope-generator&amp;diff=129"/>
		<updated>2014-03-11T08:20:05Z</updated>

		<summary type="html">&lt;p&gt;Damonwall: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:VoidExpanse/api_scopes]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Scope generator =&lt;br /&gt;
Used for generation items, objects, systems in game, and also for getting some specific info about them.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Visibility:&#039;&#039;&#039; Global.&lt;br /&gt;
&lt;br /&gt;
== List of functions ==&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddAsteroid|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y&lt;br /&gt;
* string: type - xml id of asteroid&lt;br /&gt;
* double: scale&lt;br /&gt;
* double: resQ - resouces modifier&lt;br /&gt;
* object: rotation&lt;br /&gt;
* object: rotationSpeed |&lt;br /&gt;
int: identifier of created object|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var id = generator.AddAsteroid(1,100,100,&amp;quot;Asteroid01&amp;quot;,1, 0, {x:0,y:0,z:0}, {x:0,y:0,z:0});&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds asteroid with specified parameters into game world. Asteroid contents (extractable resources), asteroid&#039;s look and other parameters&lt;br /&gt;
can be modified only in .xml file, which is specified in this function by parameter &amp;quot;type&amp;quot;. &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddBase|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y&lt;br /&gt;
* string: type - xml id of base&lt;br /&gt;
* string: name&lt;br /&gt;
* &#039;&#039;(optional) object: tags&#039;&#039; |&lt;br /&gt;
int: identifier of created object|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var id = generator.AddBase(1, 100, 100, &amp;quot;Base01&amp;quot;, &amp;quot;Station Horizon&amp;quot;, {class: &amp;quot;order&amp;quot;});&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds space station to game world.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddItem|&lt;br /&gt;
* int: object_id&lt;br /&gt;
* string: item_xml_id&lt;br /&gt;
* int: quantity |&lt;br /&gt;
object:&lt;br /&gt;
* quantity - quantity was actually added&lt;br /&gt;
* type - can be &amp;quot;item&amp;quot; or &amp;quot;resource&amp;quot;|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var obj = generator.AddItem(1, &amp;quot;SomeItem&amp;quot;, 5);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds item to some object&#039;s inventory. In VoidExpanse not all objects do have inventory, so this function must be applied&lt;br /&gt;
only to those, which have it, such as ships, space stations, containers.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddItemToSpecifiedContainer|&lt;br /&gt;
* int: container_id&lt;br /&gt;
* string: item_xml_id&lt;br /&gt;
* int: quantity |&lt;br /&gt;
object:&lt;br /&gt;
* quantity - quantity was actually added&lt;br /&gt;
* type - can be &amp;quot;item&amp;quot; or &amp;quot;resource&amp;quot;|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var obj = generator.AddItemToSpecifiedContainer(1525, &amp;quot;SomeItem&amp;quot;, 5);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Important notice: container_id - is a special, unique in-game identifier for containers, which cannot be obtained by any way through API. Container id can only be obtained as a function parameter in events.&lt;br /&gt;
Currently used in OnInstancedContainerGeneration event. &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GenerateItemsWithItemlist|&lt;br /&gt;
* int: item_list_xml_id|&lt;br /&gt;
array of objects:&lt;br /&gt;
* quantity - quantity was actually added&lt;br /&gt;
* id - xml-id of item|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var items = generator.GenerateItemsWithItemlist(1, &amp;quot;SomeItem&amp;quot;, 5);&lt;br /&gt;
for(var i = 0; i &amp;lt; items.length; i++)&lt;br /&gt;
{&lt;br /&gt;
	generator.AddItemToSpecifiedContainer(&lt;br /&gt;
		args.container_id,&lt;br /&gt;
		items[i].id,&lt;br /&gt;
		items[i].quantity );&lt;br /&gt;
}&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Generates set of items with itemlist. After generation, items can be added to any container.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddContainer|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y&lt;br /&gt;
* string: xml_type&lt;br /&gt;
* string: droplist&lt;br /&gt;
* &#039;&#039;(optional) object: tags&#039;&#039; |&lt;br /&gt;
int: identifier of object created|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var id = generator.AddContainer(1, 0, 0, &amp;quot;Container01&amp;quot;, &amp;quot;DropList01&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds a floating container to game world. By default container is empty. Also containers, which has no contents, are unstable (self-destroyed as soon as&lt;br /&gt;
someone will look at it&#039;s contents), so it&#039;s better not to create empty containers. Content can be added with generator.AddItem function.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddDecoration|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* string: item_xml_id&lt;br /&gt;
* vector2: position&lt;br /&gt;
* double: depth&lt;br /&gt;
* vector2: rotation&lt;br /&gt;
* vector2: rotation_speed,&lt;br /&gt;
* double: scale |&lt;br /&gt;
int: ID of created object|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var id = generator.AddDecoration(1, &amp;quot;Decoration01&amp;quot;, {x:0,y:0}, 100, {x:5, y:5}, {x:5, y:5}, 2);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds a decoration to game world. Decoration is a non-interactive object, which is used as a... decoration.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddJumpgate|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* int: system_to&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y&lt;br /&gt;
* double: angle&lt;br /&gt;
* string: xml_type&lt;br /&gt;
* &#039;&#039;(optional) object: tags&#039;&#039;|&lt;br /&gt;
int: ID of created object|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var id = generator.AddJumpgate(1, 2, 100, 100, 20, &amp;quot;Jumpgate01&amp;quot;, {sometag: &amp;quot;sometag&amp;quot;});&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds a jumpgate - an object, which allows ships to travel between systems. Every jumpgate must be paired with another one,&lt;br /&gt;
for example, if in system A theres a jumpgate, that leads to system B, then in system B must be a jumpgate, that leads to system A.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddNPCShipToSystem|&lt;br /&gt;
* string: npc_name&lt;br /&gt;
* string: behavior - AI-script (&amp;quot;brains&amp;quot;)&lt;br /&gt;
* int: level&lt;br /&gt;
* string: xml_type - npc xml type&lt;br /&gt;
* int: system_id&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y&lt;br /&gt;
* &#039;&#039;(optional) object: tags&#039;&#039;|&lt;br /&gt;
int: ID of created object|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var id = generator.AddNPCShipToSystem(&amp;quot;Pirate&amp;quot;,&lt;br /&gt;
	&amp;quot;PirateAI&amp;quot;, 100, &amp;quot;PirateNpc01&amp;quot;,&lt;br /&gt;
	1, 105, 223, &lt;br /&gt;
	{class: &amp;quot;pirate&amp;quot;, uniq_id: &amp;quot;boss&amp;quot;});&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds an npc ship into game. NPC&#039;s avatar and faction are set through another functions - generator.SetNPCAvatar and relations.SetShipFaction&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|OverrideDropList|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* array: droplists - strings array of droplists|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.OverrideDropList(23303, [&amp;quot;DropList01&amp;quot;, &amp;quot;DropList02&amp;quot;]);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds specified droplists to npc&#039;s droplists list.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddPlanet|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y&lt;br /&gt;
* string: name&lt;br /&gt;
* int: seed |&lt;br /&gt;
int: ID of created object|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var id = generator.AddPlanet(1, 0, 0, &amp;quot;Earth&amp;quot;, 123);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds planet to game world. Planet&#039;s look is driven by seed, based on which planet&#039;s look will be defined&lt;br /&gt;
by random generator. If you want a particular planet, you should either use seed with defined results (by our tool - SeedGenerator), or use another function - AddPlanetWithType.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddPlanetWithType|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y&lt;br /&gt;
* string: name&lt;br /&gt;
* int: seed&lt;br /&gt;
* string: planet_config_type |&lt;br /&gt;
int: ID of created object|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var id = generator.AddPlanetWithType(1, 0, 0, &amp;quot;Earth&amp;quot;, 123, &amp;quot;EarthTypePlanet&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds planet to game world. Planet&#039;s look is driven partially be seed, but mostly by the specified type.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddSpaceObject|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y&lt;br /&gt;
* string: xml_type_id&lt;br /&gt;
* object: tags |&lt;br /&gt;
int: ID of created object|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var id = generator.AddSpaceObject(1, 0, 0, &amp;quot;Debris01&amp;quot;, {class: &amp;quot;mine&amp;quot;})&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds a space object to game world. Space objects are interactive object. They cannot be destroyed, but they are interactive and collision-enabled. For example, spacemines are created with space objects. &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddSpaceObject|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y&lt;br /&gt;
* string: xml_type_id&lt;br /&gt;
* object: tags |&lt;br /&gt;
int: ID of created object|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var id = generator.AddSpaceObject(1, 0, 0, &amp;quot;Debris01&amp;quot;, {class: &amp;quot;mine&amp;quot;})&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds a space object to game world. Space objects are interactive object. They cannot be destroyed, but they are interactive and collision-enabled. For example, spacemines are created with space objects.&lt;br /&gt;
NOTE: As xml_type_id you can use keyword &amp;quot;random&amp;quot; - then a random space object will spawn.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddStar|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y&lt;br /&gt;
* int: seed&lt;br /&gt;
* int: heat - how much damage star deals, when ship approaches&lt;br /&gt;
* &#039;&#039;(optional) string: typeID&#039;&#039;&lt;br /&gt;
|&lt;br /&gt;
int: ID of created object|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var id = generator.AddStar(1, 0, 0, 234, 0)&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds a star. Conventionally, you shouldn&#039;t add more then 1 star to a system.&lt;br /&gt;
If typeID is not specified, type will be picked by random, based on seed parameter.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddSystem|&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y&lt;br /&gt;
* string: name&lt;br /&gt;
* int: seed|&lt;br /&gt;
int: ID of created system|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var id = generator.AddSystem(0, 0, &amp;quot;Hawkins Eta&amp;quot;, 123)&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds a star system. Star system can be added anywhere, and by default it won&#039;t be connected to any other systems. See tutorial to see, how systems generation works.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetSystemTags|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* object: tags|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.SetSystemTags(1, {&amp;quot;show_clouds&amp;quot;: &amp;quot;yes&amp;quot;})&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets tags of specified star system. Can be expanded with generator.AddSystemTag and retrieved by&lt;br /&gt;
generator.GetSystemTags.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddSystemTag|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* string: name&lt;br /&gt;
* object: value|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.AddSystemTag(1, &amp;quot;show_clouds&amp;quot;, &amp;quot;yes&amp;quot;)&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds tag to star system tags (or overwrites existing one with the same name).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetSystemTags|&lt;br /&gt;
* int: system_id|&lt;br /&gt;
object: tags set by methods above|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var tags = generator.GetSystemTags(1);&lt;br /&gt;
if(tags != null &amp;amp;&amp;amp; tags[&amp;quot;show_clouds&amp;quot;] == &amp;quot;yes&amp;quot;)&lt;br /&gt;
{&lt;br /&gt;
	console.Print(&amp;quot;System 1 was told to show clouds&amp;quot;);&lt;br /&gt;
}&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Retrieves tags of star system, which were set by SetSystemTags and AddSystemTag.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddAnomaly|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* string: anomaly_id&lt;br /&gt;
* object: args |&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.AddAnomaly(args.sys_id, &amp;quot;radar_disable&amp;quot;, {});&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds anomaly to star system. There are few predefined anomalies (see more in the article [[VoidExpanse/anomalies|Anomalies]]), but you can specify and implement your own anomalies.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SystemClose|&lt;br /&gt;
* int: system_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.SystemClose(20);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets system status to closed. Can be used anywhere, has no hardcoded implementation. For example, now&lt;br /&gt;
it&#039;s being used to prevent player to travel to alien systems. System can be opened with generator.SystemOpen.&lt;br /&gt;
All systems are opened by default.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SystemOpen|&lt;br /&gt;
* int: system_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.SystemOpen(20);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets system status to opened. Can be used anywhere, has no hardcoded implementation. For example, now&lt;br /&gt;
it&#039;s being used to prevent player to travel to alien systems. System can be closed with generator.SystemClose.&lt;br /&gt;
All systems are opened by default.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|IsSystemClosed|&lt;br /&gt;
* int: system_id|&lt;br /&gt;
bool|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var closed = generator.IsSystemClosed(20);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Check whether system is closed or not.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|CountNpcInSystemByTags|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* object: tags|&lt;br /&gt;
int|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var numOfPirates= generator.CountNpcInSystemByTags(20, {class: &amp;quot;pirate&amp;quot;});&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Counts npcs with specified tags in specified system.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetSystemPlaylists|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* object: key-&amp;gt;value object|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.SetSystemPlaylists(args.sys_id,&lt;br /&gt;
				{&lt;br /&gt;
					&amp;quot;explore&amp;quot;: &amp;quot;playlist_generic_explore&amp;quot;,&lt;br /&gt;
					&amp;quot;combat&amp;quot;: &amp;quot;playlist_generic_combat&amp;quot;&lt;br /&gt;
				}&lt;br /&gt;
			);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets system music playlists. There are few possible keys, see more in [[VoidExpanse/MusicPlaylists|MusicPlaylists]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddSystemsLink|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* int: system_2_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.AddSystemsLink(1,2);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
This function creates a link between two systems. This links are simply logical, but there are&lt;br /&gt;
few hardcoded rules about them. There are some specific rules, that are applied to every link:&lt;br /&gt;
* Duplication - cannot create a link between already linked systems&lt;br /&gt;
* Future Linking - cannot create a link between systems, that aren&#039;t exist yet&lt;br /&gt;
* Proximity - link cannot pass closer then 2 units to a star&lt;br /&gt;
* Intersections - link cannot intersect any other link&lt;br /&gt;
Links created this way are displayed on galaxy map. By this links jumpgates are created (though, there is no hard rule about that - you can create jumpgate without link between two star systems, but this connection won&#039;t be displayed on galaxy map).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|FixConnectivity|&lt;br /&gt;
void|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.FixConnectivity();&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Should be called after all stars and links were created. It checks, if all stars are reachable from one another, and, if not, it creates missing star systems links.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|DockShipToBase|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* int: base_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.DockShipToBase(12253,2);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Immediately, without any animations, checkups and routines, docks ship to a space station. It&#039;s better not to use it on players, because it&#039;ll have unpredictable behavior.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|ExpandArea|&lt;br /&gt;
* array: array of stars IDs |&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var stars = [3];&lt;br /&gt;
while(true)&lt;br /&gt;
{&lt;br /&gt;
	stars = generator.ExpandArea(stars);&lt;br /&gt;
	if(newstars.length &amp;gt;= 10) break;&lt;br /&gt;
}&lt;br /&gt;
console.Print(&amp;quot;Now we have an area of 10 or more stars around star with id 3&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Function, which returns the same array, as input + all stars, which are linked to input ones by 1 link. In other words, it returns an area, expanded by 1 link. Very useful during generation of zones in galaxy, such as faction territories.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetAllSystems|&lt;br /&gt;
void|&lt;br /&gt;
array: IDs of all systems|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var arr = generator.GetAllSystems();&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetAsteroidTypes|&lt;br /&gt;
void|&lt;br /&gt;
array: xml_ids (strings) of all asteroids|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var arr = generator.GetAsteroidTypes();&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetClosestSystemToPoint|&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y|&lt;br /&gt;
int: ID of picked system of 0, if none|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var sys_id = generator.GetClosestSystemToPoint(0,0);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Useful during generation process.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetDebrisTypes|&lt;br /&gt;
void|&lt;br /&gt;
array: xml_ids (strings) of all space objects|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var arr = generator.GetDebrisTypes();&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Useful during generation process. Alias of generator.GetSpaceObjectsTypes.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetSpaceObjectsTypes|&lt;br /&gt;
void|&lt;br /&gt;
array: xml_ids (strings) of all space objects|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var arr = generator.GetSpaceObjectsTypes();&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Useful during generation process. The same as generator.GetDebrisTypes.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetIntersection|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y |&lt;br /&gt;
string: intersection in format &amp;quot;coord_x;coord_y&amp;quot; or empty string|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var intersection = generator.GetIntersection(0, 15, 15);&lt;br /&gt;
if(intersection.length &amp;gt; 0)&lt;br /&gt;
{&lt;br /&gt;
	var arr = intersection.split(&#039;;&#039;);&lt;br /&gt;
	console.Print(&amp;quot;Intersection was found: point X:&amp;quot; + arr[0] +&amp;quot;, Y:&amp;quot; + arr[1]);&lt;br /&gt;
}&amp;lt;/pre&amp;gt; |&lt;br /&gt;
The function answers the question: if a put a link between system with specified id and point with&lt;br /&gt;
coordinates coord_x;coord_y, will it intersect any other links? Useful during galaxy generation process.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetJumpsBetweenSystems|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* int: system_2_id|&lt;br /&gt;
int: number of jumps|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var jumps = generator.GetJumpsBetweenSystems(1,1000);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns length (number of links) of the minimal way between two systems.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetLinkedSystems|&lt;br /&gt;
* int: sys_id|&lt;br /&gt;
array: IDs of systems|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var arr = generator.GetLinkedSystems(1);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns an array with IDs of all systems linked to the specified one.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetMinDistanceToSystem|&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y|&lt;br /&gt;
double: distance to the closest system (or maximum double value if none)|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var dist = generator.GetLinkedSystems(1);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Return distance to the closest system to a specified point.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetNumberOfLinks|&lt;br /&gt;
* int: system_id|&lt;br /&gt;
int: number of links to specified system|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var links = generator.GetNumberOfLinks(1);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetPlanetCoordinates|&lt;br /&gt;
* int: planet_id|&lt;br /&gt;
vector2: coordinates of a planet|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var coords = generator.GetPlanetCoordinates(242);&lt;br /&gt;
console.Print(&amp;quot;Planet coordinates: X:&amp;quot; + coords.x + &amp;quot;, Y:&amp;quot; + coords.y);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns coordinates of specified planet.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetRandomPlanetInSystem|&lt;br /&gt;
* int: system_id|&lt;br /&gt;
int: ID of a planet|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var id = generator.GetRandomPlanetInSystem(1);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns ID of random planet in system (or 0 if there are no planets).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetSystemPlanets|&lt;br /&gt;
* int: system_id|&lt;br /&gt;
array: IDs of planets|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var arr = generator.GetSystemPlanets(1);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns an array with IDs of all planets in system.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetSystemByID|&lt;br /&gt;
* int: system_id|&lt;br /&gt;
object:&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y&lt;br /&gt;
* int: seed&lt;br /&gt;
* string: faction&lt;br /&gt;
* int: danger_level&lt;br /&gt;
* int: tech_level&lt;br /&gt;
* string: name|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var obj = generator.GetSystemByID(1);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns basic info about specified system. Tags of star system can be gained with generator.GetSystemTags.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetBaseByID|&lt;br /&gt;
* int: base_id|&lt;br /&gt;
object:&lt;br /&gt;
* string: faction&lt;br /&gt;
* int: tech_level&lt;br /&gt;
* string: name&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var obj = generator.GetBaseByID(1);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns space station basic description. Tags cannot be retrieved with this function - use game.GetTags instead.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetSystemsByDistanceTo|&lt;br /&gt;
* int: system_id|&lt;br /&gt;
array: IDs of systems|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var arr = generator.GetSystemsByDistanceTo(1);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns an array with IDs of systems, which are sorted by distance to specified system. Specified system is included into resulting array.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetAllResources|&lt;br /&gt;
void|&lt;br /&gt;
array: xml_ids (strings) of resources|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var arr = generator.GetAllResources();&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns an array of all resources of VoidExpanse.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetResourceByID|&lt;br /&gt;
* string: xml_id|&lt;br /&gt;
object:&lt;br /&gt;
* double: price - standard price of this item&lt;br /&gt;
* int: shops_level - level of shops in which this resource should be sold&lt;br /&gt;
* string: name - name of resource&lt;br /&gt;
* string: id - xml id of resource|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var obj = generator.GetResourceByID(&amp;quot;Resource01&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns a description of a resource by it&#039;s xml_id.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetItemByXmlID|&lt;br /&gt;
* string: xml_id|&lt;br /&gt;
object:&lt;br /&gt;
* double: price - standard price of this item&lt;br /&gt;
* int: shops_level - level of shops in which this resource should be sold&lt;br /&gt;
* string: name - name of resource&lt;br /&gt;
* string: id - xml id of resource|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var obj = generator.GetItemByXmlID(&amp;quot;Item01&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns a description of an item by it&#039;s xml_id.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RemoveAsteroid|&lt;br /&gt;
* int: asteroid_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.RemoveAsteroid(123);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes asteroid from a game world.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RemoveBase|&lt;br /&gt;
* int: base_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.RemoveBase(123);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes base (space station) from a game world.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RemoveDecoration|&lt;br /&gt;
* int: decoration_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.RemoveDecoration(123);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes decoration from a game world.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RemoveJumpgate|&lt;br /&gt;
* int: jumpgate_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.RemoveJumpgate(123);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes a jumpgate from a game world.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RemovePlanet|&lt;br /&gt;
* int: planet_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.RemovePlanet(123);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes a planet from a game world.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RemoveStar|&lt;br /&gt;
* int: star_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.RemoveStar(123);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes a star from a game world.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RemoveSystemsLink|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* int: system_2_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.RemoveSystemsLink(1,2);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes a link between two systems.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|ReportLoadingPhase|&lt;br /&gt;
* string: phase|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.ReportLoadingPhase(&amp;quot;Loading galaxy&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds message to singleplayer client with loader (then to alter loader use generator.ReportLoadingProgress).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|ReportLoadingPhaseNoLoader|&lt;br /&gt;
* string: phase|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.ReportLoadingPhaseNoLoader(&amp;quot;Loading galaxy&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds message to singleplayer client.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|ReportLoadingProgress|&lt;br /&gt;
* double: percent - a value from 0 to 1|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.ReportLoadingProgress(0.5);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds message to singleplayer client.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetNPCAvatar|&lt;br /&gt;
* int: npc_ship_id&lt;br /&gt;
* object: avatar parameters|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.SetNPCAvatar(12553, [1,2,3,4,5,6]);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets npc avatar.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetSystemDangerLevel|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* int: danger_level - from 0 to 100|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.SetSystemDangerLevel(1, 99);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Set star system danger level. Danger level usually affects a level of system&#039;s npc and many other parameters.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetSystemTechLevel|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* int: tech_level - from 0 to 100|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.SetSystemTechLevel(1, 99);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Set star system tech level. Tech level usually affects shops store items.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|ShipExists|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
bool: whether ship exists or not|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.ShipExists(12552);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Damonwall</name></author>
	</entry>
	<entry>
		<id>https://wiki.atomictorch.com/index.php?title=VoidExpanse/scope-generator&amp;diff=128</id>
		<title>VoidExpanse/scope-generator</title>
		<link rel="alternate" type="text/html" href="https://wiki.atomictorch.com/index.php?title=VoidExpanse/scope-generator&amp;diff=128"/>
		<updated>2014-03-11T06:20:13Z</updated>

		<summary type="html">&lt;p&gt;Damonwall: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:VoidExpanse/api_scopes]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Scope generator =&lt;br /&gt;
Used for generation items, objects, systems in game, and also for getting some specific info about them.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Visibility:&#039;&#039;&#039; Global.&lt;br /&gt;
&lt;br /&gt;
== List of functions ==&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddAsteroid|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y&lt;br /&gt;
* string: type - xml id of asteroid&lt;br /&gt;
* double: scale&lt;br /&gt;
* double: resQ - resouces modifier&lt;br /&gt;
* object: rotation&lt;br /&gt;
* object: rotationSpeed |&lt;br /&gt;
int: identifier of created object|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var id = generator.AddAsteroid(1,100,100,&amp;quot;Asteroid01&amp;quot;,1, 0, {x:0,y:0,z:0}, {x:0,y:0,z:0});&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds asteroid with specified parameters into game world. Asteroid contents (extractable resources), asteroid&#039;s look and other parameters&lt;br /&gt;
can be modified only in .xml file, which is specified in this function by parameter &amp;quot;type&amp;quot;. &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddBase|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y&lt;br /&gt;
* string: type - xml id of base&lt;br /&gt;
* string: name&lt;br /&gt;
* &#039;&#039;(optional) object: tags&#039;&#039; |&lt;br /&gt;
int: identifier of created object|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var id = generator.AddBase(1, 100, 100, &amp;quot;Base01&amp;quot;, &amp;quot;Station Horizon&amp;quot;, {class: &amp;quot;order&amp;quot;});&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds space station to game world.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddItem|&lt;br /&gt;
* int: object_id&lt;br /&gt;
* string: item_xml_id&lt;br /&gt;
* int: quantity |&lt;br /&gt;
object:&lt;br /&gt;
* quantity - quantity was actually added&lt;br /&gt;
* type - can be &amp;quot;item&amp;quot; or &amp;quot;resource&amp;quot;|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var obj = generator.AddItem(1, &amp;quot;SomeItem&amp;quot;, 5);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds item to some object&#039;s inventory. In VoidExpanse not all objects do have inventory, so this function must be applied&lt;br /&gt;
only to those, which have it, such as ships, space stations, containers.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddItemToSpecifiedContainer|&lt;br /&gt;
* int: container_id&lt;br /&gt;
* string: item_xml_id&lt;br /&gt;
* int: quantity |&lt;br /&gt;
object:&lt;br /&gt;
* quantity - quantity was actually added&lt;br /&gt;
* type - can be &amp;quot;item&amp;quot; or &amp;quot;resource&amp;quot;|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var obj = generator.AddItemToSpecifiedContainer(1525, &amp;quot;SomeItem&amp;quot;, 5);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Important notice: container_id - is a special, unique in-game identifier for containers, which cannot be obtained by any way through API. Container id can only be obtained as a function parameter in events.&lt;br /&gt;
Currently used in OnInstancedContainerGeneration event. &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GenerateItemsWithItemlist|&lt;br /&gt;
* int: item_list_xml_id|&lt;br /&gt;
array of objects:&lt;br /&gt;
* quantity - quantity was actually added&lt;br /&gt;
* id - xml-id of item|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var items = generator.GenerateItemsWithItemlist(1, &amp;quot;SomeItem&amp;quot;, 5);&lt;br /&gt;
for(var i = 0; i &amp;lt; items.length; i++)&lt;br /&gt;
{&lt;br /&gt;
	generator.AddItemToSpecifiedContainer(&lt;br /&gt;
		args.container_id,&lt;br /&gt;
		items[i].id,&lt;br /&gt;
		items[i].quantity );&lt;br /&gt;
}&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Generates set of items with itemlist. After generation, items can be added to any container.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddContainer|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y&lt;br /&gt;
* string: xml_type&lt;br /&gt;
* string: droplist&lt;br /&gt;
* &#039;&#039;(optional) object: tags&#039;&#039; |&lt;br /&gt;
int: identifier of object created|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var id = generator.AddContainer(1, 0, 0, &amp;quot;Container01&amp;quot;, &amp;quot;DropList01&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds a floating container to game world. By default container is empty. Also containers, which has no contents, are unstable (self-destroyed as soon as&lt;br /&gt;
someone will look at it&#039;s contents), so it&#039;s better not to create empty containers. Content can be added with generator.AddItem function.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddDecoration|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* string: item_xml_id&lt;br /&gt;
* vector2: position&lt;br /&gt;
* double: depth&lt;br /&gt;
* vector2: rotation&lt;br /&gt;
* vector2: rotation_speed,&lt;br /&gt;
* double: scale |&lt;br /&gt;
int: ID of created object|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var id = generator.AddDecoration(1, &amp;quot;Decoration01&amp;quot;, {x:0,y:0}, 100, {x:5, y:5}, {x:5, y:5}, 2);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds a decoration to game world. Decoration is a non-interactive object, which is used as a... decoration.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddJumpgate|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* int: system_to&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y&lt;br /&gt;
* double: angle&lt;br /&gt;
* string: xml_type&lt;br /&gt;
* &#039;&#039;(optional) object: tags&#039;&#039;|&lt;br /&gt;
int: ID of created object|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var id = generator.AddJumpgate(1, 2, 100, 100, 20, &amp;quot;Jumpgate01&amp;quot;, {sometag: &amp;quot;sometag&amp;quot;});&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds a jumpgate - an object, which allows ships to travel between systems. Every jumpgate must be paired with another one,&lt;br /&gt;
for example, if in system A theres a jumpgate, that leads to system B, then in system B must be a jumpgate, that leads to system A.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddNPCShipToSystem|&lt;br /&gt;
* string: npc_name&lt;br /&gt;
* string: behavior - AI-script (&amp;quot;brains&amp;quot;)&lt;br /&gt;
* int: level&lt;br /&gt;
* string: xml_type - npc xml type&lt;br /&gt;
* int: system_id&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y&lt;br /&gt;
* &#039;&#039;(optional) object: tags&#039;&#039;|&lt;br /&gt;
int: ID of created object|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var id = generator.AddNPCShipToSystem(&amp;quot;Pirate&amp;quot;,&lt;br /&gt;
	&amp;quot;PirateAI&amp;quot;, 100, &amp;quot;PirateNpc01&amp;quot;,&lt;br /&gt;
	1, 105, 223, &lt;br /&gt;
	{class: &amp;quot;pirate&amp;quot;, uniq_id: &amp;quot;boss&amp;quot;});&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds an npc ship into game. NPC&#039;s avatar and faction are set through another functions - generator.SetNPCAvatar and relations.SetShipFaction&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|OverrideDropList|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* array: droplists - strings array of droplists|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.OverrideDropList(23303, [&amp;quot;DropList01&amp;quot;, &amp;quot;DropList02&amp;quot;]);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds specified droplists to npc&#039;s droplists list.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddPlanet|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y&lt;br /&gt;
* string: name&lt;br /&gt;
* int: seed |&lt;br /&gt;
int: ID of created object|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var id = generator.AddPlanet(1, 0, 0, &amp;quot;Earth&amp;quot;, 123);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds planet to game world. Planet&#039;s look is driven by seed, based on which planet&#039;s look will be defined&lt;br /&gt;
by random generator. If you want a particular planet, you should either use seed with defined results (by our tool - SeedGenerator), or use another function - AddPlanetWithType.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddPlanetWithType|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y&lt;br /&gt;
* string: name&lt;br /&gt;
* int: seed&lt;br /&gt;
* string: planet_config_type |&lt;br /&gt;
int: ID of created object|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var id = generator.AddPlanetWithType(1, 0, 0, &amp;quot;Earth&amp;quot;, 123, &amp;quot;EarthTypePlanet&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds planet to game world. Planet&#039;s look is driven partially be seed, but mostly by the specified type.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddSpaceObject|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y&lt;br /&gt;
* string: xml_type_id&lt;br /&gt;
* object: tags |&lt;br /&gt;
int: ID of created object|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var id = generator.AddSpaceObject(1, 0, 0, &amp;quot;Debris01&amp;quot;, {class: &amp;quot;mine&amp;quot;})&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds a space object to game world. Space objects are interactive object. They cannot be destroyed, but they are interactive and collision-enabled. For example, spacemines are created with space objects. &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddSpaceObject|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y&lt;br /&gt;
* string: xml_type_id&lt;br /&gt;
* object: tags |&lt;br /&gt;
int: ID of created object|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var id = generator.AddSpaceObject(1, 0, 0, &amp;quot;Debris01&amp;quot;, {class: &amp;quot;mine&amp;quot;})&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds a space object to game world. Space objects are interactive object. They cannot be destroyed, but they are interactive and collision-enabled. For example, spacemines are created with space objects.&lt;br /&gt;
NOTE: As xml_type_id you can use keyword &amp;quot;random&amp;quot; - then a random space object will spawn.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddStar|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y&lt;br /&gt;
* int: seed&lt;br /&gt;
* int: heat - how much damage star deals, when ship approaches&lt;br /&gt;
* &#039;&#039;(optional) string: typeID&#039;&#039;&lt;br /&gt;
|&lt;br /&gt;
int: ID of created object|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var id = generator.AddStar(1, 0, 0, 234, 0)&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds a star. Conventionally, you shouldn&#039;t add more then 1 star to a system.&lt;br /&gt;
If typeID is not specified, type will be picked by random, based on seed parameter.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddSystem|&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y&lt;br /&gt;
* string: name&lt;br /&gt;
* int: seed|&lt;br /&gt;
int: ID of created system|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var id = generator.AddSystem(0, 0, &amp;quot;Hawkins Eta&amp;quot;, 123)&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds a star system. Star system can be added anywhere, and by default it won&#039;t be connected to any other systems. See tutorial to see, how systems generation works.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetSystemTags|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* object: tags|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.SetSystemTags(1, {&amp;quot;show_clouds&amp;quot;: &amp;quot;yes&amp;quot;})&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets tags of specified star system. Can be expanded with generator.AddSystemTag and retrieved by&lt;br /&gt;
generator.GetSystemTags.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddSystemTag|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* string: name&lt;br /&gt;
* object: value|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.AddSystemTag(1, &amp;quot;show_clouds&amp;quot;, &amp;quot;yes&amp;quot;)&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds tag to star system tags (or overwrites existing one with the same name).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetSystemTags|&lt;br /&gt;
* int: system_id|&lt;br /&gt;
object: tags set by methods above|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var tags = generator.GetSystemTags(1);&lt;br /&gt;
if(tags != null &amp;amp;&amp;amp; tags[&amp;quot;show_clouds&amp;quot;] == &amp;quot;yes&amp;quot;)&lt;br /&gt;
{&lt;br /&gt;
	console.Print(&amp;quot;System 1 was told to show clouds&amp;quot;);&lt;br /&gt;
}&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Retrieves tags of star system, which were set by SetSystemTags and AddSystemTag.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddAnomaly|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* string: anomaly_id&lt;br /&gt;
* object: args |&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.AddAnomaly(args.sys_id, &amp;quot;radar_disable&amp;quot;, {});&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds anomaly to star system. There are few predefined anomalies (see more in the article [[VoidExpanse/anomalies|Anomalies]]), but you can specify and implement your own anomalies.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SystemClose|&lt;br /&gt;
* int: system_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.SystemClose(20);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets system status to closed. Can be used anywhere, has no hardcoded implementation. For example, now&lt;br /&gt;
it&#039;s being used to prevent player to travel to alien systems. System can be opened with generator.SystemOpen.&lt;br /&gt;
All systems are opened by default.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SystemOpen|&lt;br /&gt;
* int: system_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.SystemOpen(20);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets system status to opened. Can be used anywhere, has no hardcoded implementation. For example, now&lt;br /&gt;
it&#039;s being used to prevent player to travel to alien systems. System can be closed with generator.SystemClose.&lt;br /&gt;
All systems are opened by default.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|IsSystemClosed|&lt;br /&gt;
* int: system_id|&lt;br /&gt;
bool|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var closed = generator.IsSystemClosed(20);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Check whether system is closed or not.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetSystemPlaylists|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* object: key-&amp;gt;value object|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.SetSystemPlaylists(args.sys_id,&lt;br /&gt;
				{&lt;br /&gt;
					&amp;quot;explore&amp;quot;: &amp;quot;playlist_generic_explore&amp;quot;,&lt;br /&gt;
					&amp;quot;combat&amp;quot;: &amp;quot;playlist_generic_combat&amp;quot;&lt;br /&gt;
				}&lt;br /&gt;
			);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets system music playlists. There are few possible keys, see more in [[VoidExpanse/MusicPlaylists|MusicPlaylists]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddSystemsLink|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* int: system_2_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.AddSystemsLink(1,2);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
This function creates a link between two systems. This links are simply logical, but there are&lt;br /&gt;
few hardcoded rules about them. There are some specific rules, that are applied to every link:&lt;br /&gt;
* Duplication - cannot create a link between already linked systems&lt;br /&gt;
* Future Linking - cannot create a link between systems, that aren&#039;t exist yet&lt;br /&gt;
* Proximity - link cannot pass closer then 2 units to a star&lt;br /&gt;
* Intersections - link cannot intersect any other link&lt;br /&gt;
Links created this way are displayed on galaxy map. By this links jumpgates are created (though, there is no hard rule about that - you can create jumpgate without link between two star systems, but this connection won&#039;t be displayed on galaxy map).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|FixConnectivity|&lt;br /&gt;
void|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.FixConnectivity();&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Should be called after all stars and links were created. It checks, if all stars are reachable from one another, and, if not, it creates missing star systems links.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|DockShipToBase|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* int: base_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.DockShipToBase(12253,2);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Immediately, without any animations, checkups and routines, docks ship to a space station. It&#039;s better not to use it on players, because it&#039;ll have unpredictable behavior.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|ExpandArea|&lt;br /&gt;
* array: array of stars IDs |&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var stars = [3];&lt;br /&gt;
while(true)&lt;br /&gt;
{&lt;br /&gt;
	stars = generator.ExpandArea(stars);&lt;br /&gt;
	if(newstars.length &amp;gt;= 10) break;&lt;br /&gt;
}&lt;br /&gt;
console.Print(&amp;quot;Now we have an area of 10 or more stars around star with id 3&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Function, which returns the same array, as input + all stars, which are linked to input ones by 1 link. In other words, it returns an area, expanded by 1 link. Very useful during generation of zones in galaxy, such as faction territories.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetAllSystems|&lt;br /&gt;
void|&lt;br /&gt;
array: IDs of all systems|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var arr = generator.GetAllSystems();&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetAsteroidTypes|&lt;br /&gt;
void|&lt;br /&gt;
array: xml_ids (strings) of all asteroids|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var arr = generator.GetAsteroidTypes();&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetClosestSystemToPoint|&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y|&lt;br /&gt;
int: ID of picked system of 0, if none|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var sys_id = generator.GetClosestSystemToPoint(0,0);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Useful during generation process.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetDebrisTypes|&lt;br /&gt;
void|&lt;br /&gt;
array: xml_ids (strings) of all space objects|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var arr = generator.GetDebrisTypes();&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Useful during generation process. Alias of generator.GetSpaceObjectsTypes.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetSpaceObjectsTypes|&lt;br /&gt;
void|&lt;br /&gt;
array: xml_ids (strings) of all space objects|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var arr = generator.GetSpaceObjectsTypes();&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Useful during generation process. The same as generator.GetDebrisTypes.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetIntersection|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y |&lt;br /&gt;
string: intersection in format &amp;quot;coord_x;coord_y&amp;quot; or empty string|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var intersection = generator.GetIntersection(0, 15, 15);&lt;br /&gt;
if(intersection.length &amp;gt; 0)&lt;br /&gt;
{&lt;br /&gt;
	var arr = intersection.split(&#039;;&#039;);&lt;br /&gt;
	console.Print(&amp;quot;Intersection was found: point X:&amp;quot; + arr[0] +&amp;quot;, Y:&amp;quot; + arr[1]);&lt;br /&gt;
}&amp;lt;/pre&amp;gt; |&lt;br /&gt;
The function answers the question: if a put a link between system with specified id and point with&lt;br /&gt;
coordinates coord_x;coord_y, will it intersect any other links? Useful during galaxy generation process.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetJumpsBetweenSystems|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* int: system_2_id|&lt;br /&gt;
int: number of jumps|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var jumps = generator.GetJumpsBetweenSystems(1,1000);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns length (number of links) of the minimal way between two systems.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetLinkedSystems|&lt;br /&gt;
* int: sys_id|&lt;br /&gt;
array: IDs of systems|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var arr = generator.GetLinkedSystems(1);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns an array with IDs of all systems linked to the specified one.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetMinDistanceToSystem|&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y|&lt;br /&gt;
double: distance to the closest system (or maximum double value if none)|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var dist = generator.GetLinkedSystems(1);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Return distance to the closest system to a specified point.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetNumberOfLinks|&lt;br /&gt;
* int: system_id|&lt;br /&gt;
int: number of links to specified system|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var links = generator.GetNumberOfLinks(1);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetPlanetCoordinates|&lt;br /&gt;
* int: planet_id|&lt;br /&gt;
vector2: coordinates of a planet|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var coords = generator.GetPlanetCoordinates(242);&lt;br /&gt;
console.Print(&amp;quot;Planet coordinates: X:&amp;quot; + coords.x + &amp;quot;, Y:&amp;quot; + coords.y);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns coordinates of specified planet.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetRandomPlanetInSystem|&lt;br /&gt;
* int: system_id|&lt;br /&gt;
int: ID of a planet|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var id = generator.GetRandomPlanetInSystem(1);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns ID of random planet in system (or 0 if there are no planets).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetSystemPlanets|&lt;br /&gt;
* int: system_id|&lt;br /&gt;
array: IDs of planets|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var arr = generator.GetSystemPlanets(1);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns an array with IDs of all planets in system.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetSystemByID|&lt;br /&gt;
* int: system_id|&lt;br /&gt;
object:&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y&lt;br /&gt;
* int: seed&lt;br /&gt;
* string: faction&lt;br /&gt;
* int: danger_level&lt;br /&gt;
* int: tech_level&lt;br /&gt;
* string: name|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var obj = generator.GetSystemByID(1);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns basic info about specified system. Tags of star system can be gained with generator.GetSystemTags.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetBaseByID|&lt;br /&gt;
* int: base_id|&lt;br /&gt;
object:&lt;br /&gt;
* string: faction&lt;br /&gt;
* int: tech_level&lt;br /&gt;
* string: name&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var obj = generator.GetBaseByID(1);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns space station basic description. Tags cannot be retrieved with this function - use game.GetTags instead.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetSystemsByDistanceTo|&lt;br /&gt;
* int: system_id|&lt;br /&gt;
array: IDs of systems|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var arr = generator.GetSystemsByDistanceTo(1);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns an array with IDs of systems, which are sorted by distance to specified system. Specified system is included into resulting array.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetAllResources|&lt;br /&gt;
void|&lt;br /&gt;
array: xml_ids (strings) of resources|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var arr = generator.GetAllResources();&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns an array of all resources of VoidExpanse.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetResourceByID|&lt;br /&gt;
* string: xml_id|&lt;br /&gt;
object:&lt;br /&gt;
* double: price - standard price of this item&lt;br /&gt;
* int: shops_level - level of shops in which this resource should be sold&lt;br /&gt;
* string: name - name of resource&lt;br /&gt;
* string: id - xml id of resource|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var obj = generator.GetResourceByID(&amp;quot;Resource01&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns a description of a resource by it&#039;s xml_id.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetItemByXmlID|&lt;br /&gt;
* string: xml_id|&lt;br /&gt;
object:&lt;br /&gt;
* double: price - standard price of this item&lt;br /&gt;
* int: shops_level - level of shops in which this resource should be sold&lt;br /&gt;
* string: name - name of resource&lt;br /&gt;
* string: id - xml id of resource|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var obj = generator.GetItemByXmlID(&amp;quot;Item01&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns a description of an item by it&#039;s xml_id.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RemoveAsteroid|&lt;br /&gt;
* int: asteroid_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.RemoveAsteroid(123);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes asteroid from a game world.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RemoveBase|&lt;br /&gt;
* int: base_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.RemoveBase(123);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes base (space station) from a game world.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RemoveDecoration|&lt;br /&gt;
* int: decoration_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.RemoveDecoration(123);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes decoration from a game world.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RemoveJumpgate|&lt;br /&gt;
* int: jumpgate_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.RemoveJumpgate(123);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes a jumpgate from a game world.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RemovePlanet|&lt;br /&gt;
* int: planet_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.RemovePlanet(123);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes a planet from a game world.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RemoveStar|&lt;br /&gt;
* int: star_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.RemoveStar(123);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes a star from a game world.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RemoveSystemsLink|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* int: system_2_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.RemoveSystemsLink(1,2);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes a link between two systems.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|ReportLoadingPhase|&lt;br /&gt;
* string: phase|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.ReportLoadingPhase(&amp;quot;Loading galaxy&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds message to singleplayer client with loader (then to alter loader use generator.ReportLoadingProgress).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|ReportLoadingPhaseNoLoader|&lt;br /&gt;
* string: phase|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.ReportLoadingPhaseNoLoader(&amp;quot;Loading galaxy&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds message to singleplayer client.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|ReportLoadingProgress|&lt;br /&gt;
* double: percent - a value from 0 to 1|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.ReportLoadingProgress(0.5);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds message to singleplayer client.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetNPCAvatar|&lt;br /&gt;
* int: npc_ship_id&lt;br /&gt;
* object: avatar parameters|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.SetNPCAvatar(12553, [1,2,3,4,5,6]);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets npc avatar.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetSystemDangerLevel|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* int: danger_level - from 0 to 100|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.SetSystemDangerLevel(1, 99);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Set star system danger level. Danger level usually affects a level of system&#039;s npc and many other parameters.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetSystemTechLevel|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* int: tech_level - from 0 to 100|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.SetSystemTechLevel(1, 99);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Set star system tech level. Tech level usually affects shops store items.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|ShipExists|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
bool: whether ship exists or not|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;generator.ShipExists(12552);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Damonwall</name></author>
	</entry>
	<entry>
		<id>https://wiki.atomictorch.com/index.php?title=VoidExpanse/Consumable_scripting&amp;diff=127</id>
		<title>VoidExpanse/Consumable scripting</title>
		<link rel="alternate" type="text/html" href="https://wiki.atomictorch.com/index.php?title=VoidExpanse/Consumable_scripting&amp;diff=127"/>
		<updated>2014-03-07T10:27:01Z</updated>

		<summary type="html">&lt;p&gt;Damonwall: Created page with &amp;quot;== Consumables Scripting ==  In most cases, standard xml-structures are more then enough to implement consumable effect. However, if we need to do something special, for examp...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Consumables Scripting ==&lt;br /&gt;
&lt;br /&gt;
In most cases, standard xml-structures are more then enough to implement consumable effect. However, if we need&lt;br /&gt;
to do something special, for example, restock ammo, self-destruct, teleport or kill all ships in front of ship, you&#039;ll need scripts.&lt;br /&gt;
&lt;br /&gt;
There are no hard rules about consumables scripting. Here are just a couple of tips.&lt;br /&gt;
For example, we need to create a consumable, that refills ammo in all ballistic weapons.&lt;br /&gt;
First of all, we need to create an empty consumable xml. Under &amp;quot;empty&amp;quot; I mean with no effects.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
	&amp;lt;effects&amp;gt;&lt;br /&gt;
		&amp;lt;!-- no effects here --&amp;gt;&lt;br /&gt;
	&amp;lt;/effects&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, you create a new global script in folder /scripts/globals/, in which you hooks some function to a special trigger:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function OnInit()&lt;br /&gt;
{&lt;br /&gt;
	actions.BindToTrigger(&amp;quot;onConsumableUsed&amp;quot;, &amp;quot;onBallisticAmmoConsumableUsed&amp;quot;,&lt;br /&gt;
		{id: &amp;quot;consumable_ballistic_ammo&amp;quot;});&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
After then, every time you use consumable with xml-id &amp;quot;consumable_ballistic_ammo&amp;quot;, function &amp;quot;onBallisticAmmoConsumableUsed&amp;quot; will be called.&lt;br /&gt;
&lt;br /&gt;
Now, all that&#039;s left is to implement ammo refill:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function onBallisticAmmoConsumableUsed( args )&lt;br /&gt;
{&lt;br /&gt;
	var ballisticWeapons = ship.GetWeaponsOfType( args.ship_id, 2 );&lt;br /&gt;
	if(ballisticWeapons == null) return;&lt;br /&gt;
	&lt;br /&gt;
	for(var i =0; i &amp;lt; ballisticWeapons.length; i++)&lt;br /&gt;
	{&lt;br /&gt;
		ship.RefillAmmoForWeapon( args.ship_id, ballisticWeapons[i] );&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That&#039;s all, now we have consumable, that refills ammo of ballistic weapons!&lt;/div&gt;</summary>
		<author><name>Damonwall</name></author>
	</entry>
	<entry>
		<id>https://wiki.atomictorch.com/index.php?title=VoidExpanse/scope-ship&amp;diff=126</id>
		<title>VoidExpanse/scope-ship</title>
		<link rel="alternate" type="text/html" href="https://wiki.atomictorch.com/index.php?title=VoidExpanse/scope-ship&amp;diff=126"/>
		<updated>2014-03-07T04:00:19Z</updated>

		<summary type="html">&lt;p&gt;Damonwall: /* List of functions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:VoidExpanse/api_scopes]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Scope ship =&lt;br /&gt;
Used to get info and manipulate objects if type &amp;quot;ship&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Visibility:&#039;&#039;&#039; Global.&lt;br /&gt;
&lt;br /&gt;
== List of functions ==&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddItem|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: xml_item_type&lt;br /&gt;
* int: quantity|&lt;br /&gt;
object:&lt;br /&gt;
* int: quantity - amount added&lt;br /&gt;
* string: type - &amp;quot;item&amp;quot; or &amp;quot;resource&amp;quot;|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var obj = ship.Add(24556, &amp;quot;SomeItem2&amp;quot;, 5);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds item to ship&#039;s inventory.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddItemToStorage|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: xml_item_type&lt;br /&gt;
* int: quantity|&lt;br /&gt;
object:&lt;br /&gt;
* int: quantity - amount added&lt;br /&gt;
* string: type - &amp;quot;item&amp;quot; or &amp;quot;resource&amp;quot;|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var obj = ship.AddItemToStorage(24556, &amp;quot;BFG&amp;quot;, 0);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds item to ship&#039;s storage, not inventory (only works on a base). Useful when you need to add new hull through scripts, but&lt;br /&gt;
it cannot be added to inventory, only to storage.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RemoveItem|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* int: item_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.RemoveItem(24556, 5562);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes item from ship&#039;s inventory.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RemoveItemByType|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: item_xml_type|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.RemoveItemByType(24556, &amp;quot;SomeItem2&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes item from PLAYER&#039;s inventory by type. If there&#039;s no item of specified type in ship&#039;s&lt;br /&gt;
inventory, nothing will happen.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RemoveCargoByType|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: cargo_type&lt;br /&gt;
* &#039;&#039;(optional) int: cargo_quantity&#039;&#039;|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.RemoveCargoByType(24556, &amp;quot;SomeCargo&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes cargo from PLAYER&#039;s inventory by type. If there&#039;s no cargo of specified type in ship&#039;s&lt;br /&gt;
inventory, nothing will happen.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetCargoAmount|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: cargo_type|&lt;br /&gt;
int: amount|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var left = ship.GetCargoAmount(24556, &amp;quot;SomeCargo&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns amount of specified cargo in player&#039;s inventory.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|HasCargoAmount|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: cargo_type&lt;br /&gt;
* int: amount|&lt;br /&gt;
bool|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var hasCargo = ship.HasCargoAmount(24556, &amp;quot;SomeCargo&amp;quot;, 14);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Checks if player has specified amount of cargo.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|HasItemOfType|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: item_id|&lt;br /&gt;
bool: if player&#039;s ship has item of specified type|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var hasItem = ship.HasItemOfType(24556, &amp;quot;SomeItem1&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Useful in quests.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetBuffs|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
array of objects:&lt;br /&gt;
* int: caster - id of ship casted this active effect&lt;br /&gt;
* double: time_left - time left&lt;br /&gt;
* double: effect_base&lt;br /&gt;
* double: effect_cap&lt;br /&gt;
* double: effect_per_level&lt;br /&gt;
* string: effect_type|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var effects = ship.GetBuffs(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns all specified ship&#039;s active effects. Active effects are temporary effects, which are usually&lt;br /&gt;
effects of consumables or devices.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetBuffsCache|&lt;br /&gt;
* int: ship_id |&lt;br /&gt;
array: key - value |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var cache = ship.GetBuffsCache(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns current buffs cache. Used in FinalCacheCalculations.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetCurrentValue|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: name|&lt;br /&gt;
double: current value with specified key|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var val = ship.GetCurrentValue(24556, &amp;quot;structure&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns current value of ship.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetCurrentValuesList|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
array: key -&amp;gt; value|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var values = ship.GetCurrentValuesList(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns all current values of ship.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetEquipment|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
array: unique IDs (int) of equipped items|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var equipment = ship.GetEquipment(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns current equipment of player&#039;s ship. Npc ship has no equipment, so it cannot be retreieved this way.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetWeapons|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
array: unique IDs (int) of equipped weapons|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var weapons = ship.GetWeapons(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns currently equipped weapons of a ship. Npc ship has no equipment, so it cannot be retireved this way.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetWeaponsOfType|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* int: weapon_type (1 for energy, 2 for ballistic, 3 for missile)|&lt;br /&gt;
array: unique IDs (int) of equipped weapons|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var weapons = ship.GetWeapons(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns currently equipped weapons of a ship of a specified type. Npc ship has no equipment, so it cannot be retireved this way.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RefillAmmoForWeapon|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* int: weapon_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.RefillAmmoForWeapon(24556, 15252);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Refills ammo for weapon with specified unique in-game id (GID).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetHullXmlID|&lt;br /&gt;
* int: ship_id |&lt;br /&gt;
string: current ship&#039;s hull&#039;s xml type|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var hull = ship.GetHullXmlID(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns currently equipped hull&#039;s xml_id.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetEquipmentCache|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
array: key-value|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var cache = ship.GetEquipmentCache(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns current equipment cache of ship.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetFinalCache|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
array: key-value|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var cache = ship.GetFinalCache(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns current final cache of ship.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetFinalCacheValue|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: name|&lt;br /&gt;
double: specified cache value|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var val = ship.GetFinalCacheValue(24556, &amp;quot;structure&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns final cache value.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetSkills|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
array of objects:&lt;br /&gt;
* string: id&lt;br /&gt;
* int: level&lt;br /&gt;
* string: skill_id|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var skills = ship.GetSkills(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns all current skills of ship.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetSkillsCache|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
array: key-value|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var cache = ship.GetSkillsCache(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns current skills cache.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetLevel|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
int: current level of ship|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var level = ship.GetLevel(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetTags|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
object: tags of a ship|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var tags = ship.GetTags(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetSystemID|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
int: ID of ship&#039;s current system|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var sys_id = ship.GetSystemID(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|IsDocked|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
bool: returns whether ship is currently docked|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var docked = ship.IsDocked(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|EnteringJumpgate|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
int: returns ID of jumpgate ship is entering (or 0 if none)|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var current_jumpgate = ship.EnteringJumpgate(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetCurrentBase|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
int: returns ID of base to which ship is docked (or -1 if none)|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var current_base = ship.GetCurrentBase(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetTimeSinceLastHit|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
double: time since ship last time dealt damage to someone|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var time = ship.GetTimeSinceLastHit(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Used in AI&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetTimeSinceLastHitted|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
double: time since ship last time took damage from someone|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var time = ship.GetTimeSinceLastHitted(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Used in ship&#039;s shield reestablishment calculations.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|IsShieldUp|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
bool: returns whether ship&#039;s shield is up|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var shield_up = ship.IsShieldUp(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|IsNpc|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
bool: returns whether ship is npc-controlled|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var is_npc = ship.IsNpc(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|IsEngineOn|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
bool: returns whether ship&#039;s engine is working|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var is_engine_on = ship.IsEngineOn(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RegenerateWeapons|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* double: energy&lt;br /&gt;
* double: mult|&lt;br /&gt;
double: amount of energy spent on weapons regeneration|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var energy_spent = ship.RegenerateWeapons(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Hardcoded part - trying to regenerate weapons with energy. Only usable on PLAYER&#039;s ships. Returns amount of energy spent on weapons regeneration.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|ReleaseGrappler|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.ReleaseGrappler(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Release all current grappled objects.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetGrappledCount|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
int: number of grappled objects|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var grappled = ship.GetGrappledCount(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Get number of grappled objects. Useful in caluclation of grappler energy consumption.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetBuffsCacheValue|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: field_name&lt;br /&gt;
* double: value|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.SetBuffsCacheValue(24556, &amp;quot;structure&amp;quot;, 2);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets buff cache value.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|ClearBuffsCache|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.ClearBuffsCache(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Clears all current buffs cache values.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetCurrentValue|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: field_name&lt;br /&gt;
* double: val|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.SetCurrentValue(24556, &amp;quot;structure&amp;quot;, 59);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets current value of ship&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetCurrentValueDelta|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: field_name&lt;br /&gt;
* double: val|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.SetCurrentValueDelta(24556, &amp;quot;structure&amp;quot;, -10);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Alters current value to specified value. Value will be clamped automatically between 0 and it&#039;s max value (which is governed by ship params.)&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetDrift|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* double: time|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.SetDrift(24556, 5000);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Enables driftmode of ship - in this mode ship cannot be controlled and can gain torque (which is always 0 when driftmode is off). Useful in explosion effects.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetEquipmentCacheValue|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: field_name&lt;br /&gt;
* double: value|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.SetEquipmentCacheValue(24556, &amp;quot;structure&amp;quot;, 5000);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets equipment cache value.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|ClearEquipmentCache|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.ClearEquipmentCache(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Clears equipment cache.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetFinalCacheValue|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: field_name&lt;br /&gt;
* double: value|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.SetFinalCacheValue(24556, &amp;quot;structure&amp;quot;, 5000);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets final cache value. Final cache is the one used in all in-game caluclations.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetShieldUp|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* bool: status - true or false|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.SetShieldUp(24556, true);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets shield up/down status. Affects collision and damage models. Does not applies visual effects (see more in [[VoidExpanse/scope-visual|VisualScope]]). &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetSkillsCacheValue|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: field_name&lt;br /&gt;
* double: value|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.SetSkillsCacheValue(24556, &amp;quot;structure&amp;quot;, 5000);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets skill cache value.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|ClearSkillsCache|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.ClearSkillsCache(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Clear skills cache.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetShipAsArrivedFromJumpgate|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* int: jumpgate_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.SetShipAsArrivedFromJumpgate(24556, 15);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Set visual and physical effects, that looks like ship just arrived from specified jumpgate.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetDamageByShip|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* double: damage&lt;br /&gt;
* int: caster_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.SetDamageByShip(24556, 15, 44535);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets damage from ship. Useful in AI - you can count damage from player ship and decide, whether to attack or not.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetDamageByShip|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* int: caster_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var dmg = ship.SetDamageByShip(24556, 44535);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Gets damage by ship, which was set by ship.SetDamageByShip method.&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Damonwall</name></author>
	</entry>
	<entry>
		<id>https://wiki.atomictorch.com/index.php?title=VoidExpanse/scripting_api&amp;diff=125</id>
		<title>VoidExpanse/scripting api</title>
		<link rel="alternate" type="text/html" href="https://wiki.atomictorch.com/index.php?title=VoidExpanse/scripting_api&amp;diff=125"/>
		<updated>2014-03-07T03:55:30Z</updated>

		<summary type="html">&lt;p&gt;Damonwall: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Scripting overview =&lt;br /&gt;
&lt;br /&gt;
== Basic concepts ==&lt;br /&gt;
Scripting is done via actions that custom scripts can subscribe to. There are number of actions that are called by server automatically, plus users can create their own actions and call them when needed. This also makes possible for users to create scripting frameworks for others to use.&lt;br /&gt;
Each action has one argument (ΓÇ£argsΓÇ¥) that is a JavaScript object containing several variables inside depending on a particular action. In some actions this ΓÇ£argsΓÇ¥ object can be empty. But either way it allows for unified format for all actions within the scripting system.&lt;br /&gt;
&lt;br /&gt;
=== Scripting naming convention ===&lt;br /&gt;
* String IDΓÇÖs in mods can only contain alphanumeric characters and underscores. Any other characters are illegal.&lt;br /&gt;
* Using underscore for variables and properties.&lt;br /&gt;
* Using CamelCase for functions and methods.&lt;br /&gt;
* zxc_q - ΓÇ£qΓÇ¥ in the variable always represents ΓÇ£quantityΓÇ¥ or ΓÇ£number of ...ΓÇ¥.&lt;br /&gt;
* zxc_id - ΓÇ£idΓÇ¥ always means either string id from XML file if it is of the type of string, or if it is uint then it is entity (instance) id of some object.&lt;br /&gt;
* zxc_req - ΓÇ£reqΓÇ¥ always means ΓÇ£requirementsΓÇ¥.&lt;br /&gt;
* All mods should prefix their variables, functions, classes, storage keys and all the rest with a key for isolation from other mods, example of such prefix would be ΓÇ£prf_ΓÇ¥ -&amp;gt; ΓÇ£prf_some_variableΓÇ¥, ΓÇ£prf_SomeFunctionΓÇ¥.&lt;br /&gt;
&lt;br /&gt;
=== Internal scripts (Overridable) ===&lt;br /&gt;
{{Main|VoidExpanse/Internal_scripts|Internal scripts}}&lt;br /&gt;
These scripts are called usually once and only in a particular situation. Each of these script files must exist in only one instance. If a new script is added the previous one will be overridden. Each of the script files must implement only one script action. Usually players should not modify these scripts unless they want to completely re-implement some game feature.&lt;br /&gt;
&lt;br /&gt;
=== Global scripts (called in the world dynamically) ===&lt;br /&gt;
{{Main|VoidExpanse/Global_scripts|Global scripts}}&lt;br /&gt;
Global scripts are executed continuously during gameplay. For each event there could be many bound scripts. Also it is possible to create custom actions and subscribe to them.&lt;br /&gt;
&lt;br /&gt;
=== Object scripts ===&lt;br /&gt;
{{Main|VoidExpanse/Object_scripts|Object scripts}}&lt;br /&gt;
Object scripts are scripts attached to a particular game object. When that object starts an action, if script has an appropriate handler for this action it will be executed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== VoidExpanse Scripting API ==&lt;br /&gt;
&lt;br /&gt;
=== Library inclusion and scopes usage ===&lt;br /&gt;
Preprocessor directive &amp;lt;code&amp;gt;include(libname.js);&amp;lt;/code&amp;gt; includes a library scripts into a current JS instance. Library scripts also can include each other (no echo effect will appear).&lt;br /&gt;
&lt;br /&gt;
Allows to use functions and objects of these libraries in this particular script instance.&lt;br /&gt;
* Inclusions of libraries directive must be the first lines in the script file (not necessarily, but preferably - to maintain order in scripts).&lt;br /&gt;
* All include directives must be before first function declaration.&lt;br /&gt;
&lt;br /&gt;
Preprocessor directive &amp;lt;code&amp;gt;using(scopename);&amp;lt;/code&amp;gt; allows to use specific scope in a specific script. Scope name must be an existing scope name (see scopes below). Except for some specific scopes (like topic or npc), which are available only in specific places, like topic scripts or AI behaviors.&lt;br /&gt;
&lt;br /&gt;
=== Scopes ===&lt;br /&gt;
Each scope contains a number of functions available from it.&lt;br /&gt;
&lt;br /&gt;
* [[VoidExpanse/scope-config]] (available: global)&lt;br /&gt;
* [[VoidExpanse/scope-script]] (available: global)&lt;br /&gt;
* [[VoidExpanse/scope-actions]] (available: global)&lt;br /&gt;
* [[VoidExpanse/scope-server]] (available: global)&lt;br /&gt;
* [[VoidExpanse/scope-generator]] (available: global)&lt;br /&gt;
* [[VoidExpanse/scope-spawn]] (available: global)&lt;br /&gt;
* [[VoidExpanse/scope-station]] (available: global)&lt;br /&gt;
* [[VoidExpanse/scope-chat]] (available: global)&lt;br /&gt;
* [[VoidExpanse/scope-console]] (available: global)&lt;br /&gt;
* [[VoidExpanse/scope-storage]] (available: global)&lt;br /&gt;
* [[VoidExpanse/scope-game]] (available: global)&lt;br /&gt;
* [[VoidExpanse/scope-ship]] (available: global)&lt;br /&gt;
* [[VoidExpanse/scope-visual]] (available: global)&lt;br /&gt;
* [[VoidExpanse/scope-player]] (available: global)&lt;br /&gt;
* [[VoidExpanse/scope-topic]] (available: only in topics)&lt;br /&gt;
* [[VoidExpanse/scope-topics]] (available: global)&lt;br /&gt;
* [[VoidExpanse/scope-relations]] (available: global)&lt;br /&gt;
* [[VoidExpanse/scope-npc]] (available: global)&lt;br /&gt;
* [[VoidExpanse/scope-timer]] (available: global)&lt;br /&gt;
* [[VoidExpanse/scope-debug]] (available: global)&lt;br /&gt;
&lt;br /&gt;
== Device scripts ==&lt;br /&gt;
{{Main|VoidExpanse/Device_scripts|Device scripts}}&lt;br /&gt;
Devices uses effect scripts, which is similar to any object scripts, but uses itΓÇÖs own special system of arguments. These scripts are shared between instances of the same device type, therefore global variables in this scripts are denied.&lt;br /&gt;
&lt;br /&gt;
There are four possible functions for device script.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Consumables scripting ==&lt;br /&gt;
{{Main|VoidExpanse/Consumable_scripting|Consumables scripting}}&lt;br /&gt;
Consumables can be programmed with standart xml-values, but, in order to implement something&lt;br /&gt;
special, one can use special techniques, described in this article.&lt;/div&gt;</summary>
		<author><name>Damonwall</name></author>
	</entry>
	<entry>
		<id>https://wiki.atomictorch.com/index.php?title=VoidExpanse/scope-ship&amp;diff=124</id>
		<title>VoidExpanse/scope-ship</title>
		<link rel="alternate" type="text/html" href="https://wiki.atomictorch.com/index.php?title=VoidExpanse/scope-ship&amp;diff=124"/>
		<updated>2014-03-03T09:38:45Z</updated>

		<summary type="html">&lt;p&gt;Damonwall: /* List of functions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:VoidExpanse/api_scopes]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Scope ship =&lt;br /&gt;
Used to get info and manipulate objects if type &amp;quot;ship&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Visibility:&#039;&#039;&#039; Global.&lt;br /&gt;
&lt;br /&gt;
== List of functions ==&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddItem|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: xml_item_type&lt;br /&gt;
* int: quantity|&lt;br /&gt;
object:&lt;br /&gt;
* int: quantity - amount added&lt;br /&gt;
* string: type - &amp;quot;item&amp;quot; or &amp;quot;resource&amp;quot;|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var obj = ship.Add(24556, &amp;quot;SomeItem2&amp;quot;, 5);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds item to ship&#039;s inventory.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddItemToStorage|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: xml_item_type&lt;br /&gt;
* int: quantity|&lt;br /&gt;
object:&lt;br /&gt;
* int: quantity - amount added&lt;br /&gt;
* string: type - &amp;quot;item&amp;quot; or &amp;quot;resource&amp;quot;|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var obj = ship.AddItemToStorage(24556, &amp;quot;BFG&amp;quot;, 0);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds item to ship&#039;s storage, not inventory (only works on a base). Useful when you need to add new hull through scripts, but&lt;br /&gt;
it cannot be added to inventory, only to storage.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RemoveItem|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* int: item_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.RemoveItem(24556, 5562);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes item from ship&#039;s inventory.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RemoveItemByType|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: item_xml_type|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.RemoveItemByType(24556, &amp;quot;SomeItem2&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes item from PLAYER&#039;s inventory by type. If there&#039;s no item of specified type in ship&#039;s&lt;br /&gt;
inventory, nothing will happen.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RemoveCargoByType|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: cargo_type&lt;br /&gt;
* &#039;&#039;(optional) int: cargo_quantity&#039;&#039;|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.RemoveCargoByType(24556, &amp;quot;SomeCargo&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes cargo from PLAYER&#039;s inventory by type. If there&#039;s no cargo of specified type in ship&#039;s&lt;br /&gt;
inventory, nothing will happen.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetCargoAmount|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: cargo_type|&lt;br /&gt;
int: amount|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var left = ship.GetCargoAmount(24556, &amp;quot;SomeCargo&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns amount of specified cargo in player&#039;s inventory.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|HasCargoAmount|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: cargo_type&lt;br /&gt;
* int: amount|&lt;br /&gt;
bool|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var hasCargo = ship.HasCargoAmount(24556, &amp;quot;SomeCargo&amp;quot;, 14);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Checks if player has specified amount of cargo.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|HasItemOfType|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: item_id|&lt;br /&gt;
bool: if player&#039;s ship has item of specified type|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var hasItem = ship.HasItemOfType(24556, &amp;quot;SomeItem1&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Useful in quests.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetBuffs|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
array of objects:&lt;br /&gt;
* int: caster - id of ship casted this active effect&lt;br /&gt;
* double: time_left - time left&lt;br /&gt;
* double: effect_base&lt;br /&gt;
* double: effect_cap&lt;br /&gt;
* double: effect_per_level&lt;br /&gt;
* string: effect_type|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var effects = ship.GetBuffs(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns all specified ship&#039;s active effects. Active effects are temporary effects, which are usually&lt;br /&gt;
effects of consumables or devices.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetBuffsCache|&lt;br /&gt;
* int: ship_id |&lt;br /&gt;
array: key - value |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var cache = ship.GetBuffsCache(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns current buffs cache. Used in FinalCacheCalculations.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetCurrentValue|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: name|&lt;br /&gt;
double: current value with specified key|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var val = ship.GetCurrentValue(24556, &amp;quot;structure&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns current value of ship.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetCurrentValuesList|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
array: key -&amp;gt; value|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var values = ship.GetCurrentValuesList(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns all current values of ship.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetEquipment|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
array: unique IDs (int) of equipped items|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var equipment = ship.GetEquipment(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns current equipment of player&#039;s ship. Npc ship has no equipment, so it cannot be retreieved this way.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetHullXmlID|&lt;br /&gt;
* int: ship_id |&lt;br /&gt;
string: current ship&#039;s hull&#039;s xml type|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var hull = ship.GetHullXmlID(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns currently equipped hull&#039;s xml_id.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetEquipmentCache|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
array: key-value|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var cache = ship.GetEquipmentCache(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns current equipment cache of ship.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetFinalCache|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
array: key-value|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var cache = ship.GetFinalCache(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns current final cache of ship.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetFinalCacheValue|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: name|&lt;br /&gt;
double: specified cache value|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var val = ship.GetFinalCacheValue(24556, &amp;quot;structure&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns final cache value.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetSkills|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
array of objects:&lt;br /&gt;
* string: id&lt;br /&gt;
* int: level&lt;br /&gt;
* string: skill_id|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var skills = ship.GetSkills(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns all current skills of ship.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetSkillsCache|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
array: key-value|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var cache = ship.GetSkillsCache(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns current skills cache.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetLevel|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
int: current level of ship|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var level = ship.GetLevel(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetTags|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
object: tags of a ship|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var tags = ship.GetTags(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetSystemID|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
int: ID of ship&#039;s current system|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var sys_id = ship.GetSystemID(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|IsDocked|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
bool: returns whether ship is currently docked|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var docked = ship.IsDocked(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|EnteringJumpgate|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
int: returns ID of jumpgate ship is entering (or 0 if none)|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var current_jumpgate = ship.EnteringJumpgate(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetCurrentBase|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
int: returns ID of base to which ship is docked (or -1 if none)|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var current_base = ship.GetCurrentBase(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetTimeSinceLastHit|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
double: time since ship last time dealt damage to someone|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var time = ship.GetTimeSinceLastHit(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Used in AI&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetTimeSinceLastHitted|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
double: time since ship last time took damage from someone|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var time = ship.GetTimeSinceLastHitted(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Used in ship&#039;s shield reestablishment calculations.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|IsShieldUp|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
bool: returns whether ship&#039;s shield is up|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var shield_up = ship.IsShieldUp(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|IsNpc|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
bool: returns whether ship is npc-controlled|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var is_npc = ship.IsNpc(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|IsEngineOn|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
bool: returns whether ship&#039;s engine is working|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var is_engine_on = ship.IsEngineOn(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RegenerateWeapons|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* double: energy&lt;br /&gt;
* double: mult|&lt;br /&gt;
double: amount of energy spent on weapons regeneration|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var energy_spent = ship.RegenerateWeapons(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Hardcoded part - trying to regenerate weapons with energy. Only usable on PLAYER&#039;s ships. Returns amount of energy spent on weapons regeneration.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|ReleaseGrappler|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.ReleaseGrappler(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Release all current grappled objects.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetGrappledCount|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
int: number of grappled objects|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var grappled = ship.GetGrappledCount(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Get number of grappled objects. Useful in caluclation of grappler energy consumption.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetBuffsCacheValue|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: field_name&lt;br /&gt;
* double: value|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.SetBuffsCacheValue(24556, &amp;quot;structure&amp;quot;, 2);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets buff cache value.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|ClearBuffsCache|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.ClearBuffsCache(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Clears all current buffs cache values.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetCurrentValue|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: field_name&lt;br /&gt;
* double: val|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.SetCurrentValue(24556, &amp;quot;structure&amp;quot;, 59);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets current value of ship&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetCurrentValueDelta|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: field_name&lt;br /&gt;
* double: val|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.SetCurrentValueDelta(24556, &amp;quot;structure&amp;quot;, -10);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Alters current value to specified value. Value will be clamped automatically between 0 and it&#039;s max value (which is governed by ship params.)&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetDrift|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* double: time|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.SetDrift(24556, 5000);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Enables driftmode of ship - in this mode ship cannot be controlled and can gain torque (which is always 0 when driftmode is off). Useful in explosion effects.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetEquipmentCacheValue|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: field_name&lt;br /&gt;
* double: value|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.SetEquipmentCacheValue(24556, &amp;quot;structure&amp;quot;, 5000);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets equipment cache value.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|ClearEquipmentCache|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.ClearEquipmentCache(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Clears equipment cache.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetFinalCacheValue|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: field_name&lt;br /&gt;
* double: value|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.SetFinalCacheValue(24556, &amp;quot;structure&amp;quot;, 5000);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets final cache value. Final cache is the one used in all in-game caluclations.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetShieldUp|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* bool: status - true or false|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.SetShieldUp(24556, true);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets shield up/down status. Affects collision and damage models. Does not applies visual effects (see more in [[VoidExpanse/scope-visual|VisualScope]]). &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetSkillsCacheValue|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* string: field_name&lt;br /&gt;
* double: value|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.SetSkillsCacheValue(24556, &amp;quot;structure&amp;quot;, 5000);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets skill cache value.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|ClearSkillsCache|&lt;br /&gt;
* int: ship_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.ClearSkillsCache(24556);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Clear skills cache.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetShipAsArrivedFromJumpgate|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* int: jumpgate_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.SetShipAsArrivedFromJumpgate(24556, 15);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Set visual and physical effects, that looks like ship just arrived from specified jumpgate.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetDamageByShip|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* double: damage&lt;br /&gt;
* int: caster_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;ship.SetDamageByShip(24556, 15, 44535);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets damage from ship. Useful in AI - you can count damage from player ship and decide, whether to attack or not.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetDamageByShip|&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* int: caster_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var dmg = ship.SetDamageByShip(24556, 44535);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Gets damage by ship, which was set by ship.SetDamageByShip method.&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Damonwall</name></author>
	</entry>
	<entry>
		<id>https://wiki.atomictorch.com/index.php?title=VoidExpanse/scope-npc&amp;diff=123</id>
		<title>VoidExpanse/scope-npc</title>
		<link rel="alternate" type="text/html" href="https://wiki.atomictorch.com/index.php?title=VoidExpanse/scope-npc&amp;diff=123"/>
		<updated>2014-02-18T10:34:35Z</updated>

		<summary type="html">&lt;p&gt;Damonwall: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:VoidExpanse/api_scopes]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Scope npc =&lt;br /&gt;
Manages NPC bahavior, interactions and parameters.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Visibility:&#039;&#039;&#039; Global.&lt;br /&gt;
&lt;br /&gt;
== List of functions ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Objectives ==&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|CountObjectives|&lt;br /&gt;
* int: npc_ship_id |&lt;br /&gt;
int: current number of objectives|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var obj = npc.CountObjectives(25334);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddObjective|&lt;br /&gt;
* int: npc_ship_id&lt;br /&gt;
* string: name&lt;br /&gt;
* &#039;&#039;(optional) object: parameters&#039;&#039; |&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;npc.AddObjective(25334, &amp;quot;go_to_jumpgate&amp;quot;, {jumpgate_id: 15});&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds new objective to npc. All objectives must be implemented in npc&#039;s behavior script.&lt;br /&gt;
NOTE: in object parameters there shouldn&#039;t be parameters &amp;quot;name&amp;quot; - it will be overriden by name of objective.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|CleanObjectives|&lt;br /&gt;
* int: npc_ship_id |&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;npc.CleanObjectives(25334);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes all objectives from npc ship.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|NextObjective|&lt;br /&gt;
* int: npc_ship_id |&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;npc.NextObjective(25334);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Moves current objective pointer to next position, removes previous objective.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetCurrentObjective|&lt;br /&gt;
* int: npc_ship_id |&lt;br /&gt;
object:&lt;br /&gt;
* string: name - name of objective, specified in AddObjective&lt;br /&gt;
* string: key - value - other parameters, specified in AddObjective|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var objective = npc.GetCurrentObjective(25334);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Gets current npc&#039;s objective (or null if none)&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetCurrentObjectiveTimer|&lt;br /&gt;
* int: npc_ship_id |&lt;br /&gt;
double: time - how long npc is doing his current objective|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var time = npc.GetCurrentObjectiveTimer(25334);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== NODES ==&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddNode|&lt;br /&gt;
* int: npc_ship_id&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;npc.AddNode(25334, 100, 100);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds a node to npc. NPC can use nodes for patrolling, or for any other reason.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|ClearNodes|&lt;br /&gt;
* int: npc_ship_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;npc.ClearNodes(25334);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes all nodes from npc.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetDistanceToNode|&lt;br /&gt;
* int: npc_ship_id&lt;br /&gt;
* int: node_id - number of node|&lt;br /&gt;
double: distance_to_node|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var dist = npc.GetDistanceToNode(25334, 1);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetNodes|&lt;br /&gt;
* int: npc_ship_id|&lt;br /&gt;
array of objects:&lt;br /&gt;
* double: CoordX&lt;br /&gt;
* double: CoordY|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var nodes = npc.GetNodes(25334);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RemoveNode|&lt;br /&gt;
* int: npc_ship_id&lt;br /&gt;
* int: node_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;npc.RemoveNode(25334, 1);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes node from npc nodes.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|FollowRouteToObject|&lt;br /&gt;
* int: npc_ship_id&lt;br /&gt;
* int: object_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;npc.FollowRouteToObject(25334, 2535);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Creates route to object and follow it.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|FollowRouteToBase|&lt;br /&gt;
* int: npc_ship_id&lt;br /&gt;
* int: base_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;npc.FollowRouteToBase(25334, 2535);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Creates route to base and follow it.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|StopFollowingRoute|&lt;br /&gt;
* int: npc_ship_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;npc.StopFollowingRoute(25334);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Stops following current route.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|IsNodeReached|&lt;br /&gt;
* int: npc_ship_id&lt;br /&gt;
* int: is_node_reached|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var res = npc.IsNodeReached(25334, 0);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Checks if node is reached.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Battle ==&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|Fire|&lt;br /&gt;
* int: npc_ship_id&lt;br /&gt;
* int: slot|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;npc.Fire(25334, 0);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Fires from specified slot.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetWeaponUsage|&lt;br /&gt;
* int: npc_ship_id&lt;br /&gt;
* string: projectile_type - &amp;quot;Ray&amp;quot;,&amp;quot;DirectHit&amp;quot;,&amp;quot;BulletOrMissile&amp;quot;&lt;br /&gt;
* double: min_dist&lt;br /&gt;
* double: max_dist&lt;br /&gt;
* double: delay|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;npc.SetWeaponUsage(25334, &amp;quot;Ray&amp;quot;, 2,10, 200);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets weapon usage. It means npc will try to shoot with it&#039;s weapons of specified type&lt;br /&gt;
only on specified distance and will make specified delays between shots.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Movement ==&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|CapSpeed|&lt;br /&gt;
* int: npc_ship_id&lt;br /&gt;
* double: value|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;npc.CapSpeed(25334, 2);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Caps npc&#039;s ship speed.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|FaceFromObj|&lt;br /&gt;
* int: npc_ship_id&lt;br /&gt;
* int: object_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;npc.FaceFromObj(25334, 235);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
NPC faces from object.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|FaceObj|&lt;br /&gt;
* int: npc_ship_id&lt;br /&gt;
* int: object_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;npc.FaceObj(25334, 235);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
NPC faces to object.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|FaceStickPoint|&lt;br /&gt;
* int: npc_ship_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;npc.FaceStickPoint(25334, 235);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
NPC faces current stick point.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|FaceCoord|&lt;br /&gt;
* int: npc_ship_id&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;npc.v(25334, 100, 105);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
NPC faces specified coordinates.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GoBackward|&lt;br /&gt;
* int: npc_ship_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;npc.GoBackward(25334);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GoForward|&lt;br /&gt;
* int: npc_ship_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;npc.GoForward(25334);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RotLeft|&lt;br /&gt;
* int: npc_ship_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;npc.RotLeft(25334);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RotRight|&lt;br /&gt;
* int: npc_ship_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;npc.RotRight(25334);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|Stop|&lt;br /&gt;
* int: npc_ship_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;npc.Stop(25334);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|InstantStop|&lt;br /&gt;
* int: npc_ship_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;npc.InstantStop(25334);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|StrafeLeft|&lt;br /&gt;
* int: npc_ship_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;npc.StrafeLeft(25334);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|StrafeRight|&lt;br /&gt;
* int: npc_ship_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;npc.StrafeRight(25334);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|StopEvasion|&lt;br /&gt;
* int: npc_ship_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;npc.StopEvasion(25334);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Turns evasion mode off. Evasion mode is the mode, when npc can avoid attacks with rockets and ballistics by strafing.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|StartEvasion|&lt;br /&gt;
* int: npc_ship_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;npc.StartEvasion(25334);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Turns evasion mode on. Evasion mode is the mode, when npc can avoid attacks with rockets and ballistics by strafing.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Locks ==&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|FriendlyLockOnTarget|&lt;br /&gt;
* int: npc_ship_id&lt;br /&gt;
* int: target_id&lt;br /&gt;
* double: get_away_dist|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;npc.FriendlyLockOnTarget(25334, 16);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Friendly lock is a type of lock, when npc facing it&#039;s target, but do not attack.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetLockTarget|&lt;br /&gt;
* int: npc_ship_id|&lt;br /&gt;
int: lock target object ID|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var lockTarget = npc.GetLockTarget(25334);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Gets current target, on which npc is locked.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetStickObject|&lt;br /&gt;
* int: npc_ship_id|&lt;br /&gt;
int: object_id - current stick object id|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var stickObject = npc.GetStickObject(25334);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Get current stick object.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetFriendlyLockTarget|&lt;br /&gt;
* int: npc_ship_id|&lt;br /&gt;
int: object_id - current friendly lock target|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var lockTarget = npc.GetFriendlyLockTarget(25334);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Get current lock target&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|IsFriendlyLocked|&lt;br /&gt;
* int: npc_ship_id|&lt;br /&gt;
bool: is npc friendly locked|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var is_locked = npc.IsFriendlyLocked(25334);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns whether npc is friendly locked.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|IsLocked|&lt;br /&gt;
* int: npc_ship_id|&lt;br /&gt;
bool: is npc locked on target|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var is_locked = npc.IsLocked(25334);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns whether npc is locked on target.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|Unlock|&lt;br /&gt;
* int: npc_ship_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;npc.Unlock(25334);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Unlocks from target or frienly lock target.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|IsStickToPoint|&lt;br /&gt;
* int: npc_ship_id|&lt;br /&gt;
bool: is_sticked - whether npc is sticked to point|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var res = npc.IsStickToPoint(25334);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|IsStickToObject|&lt;br /&gt;
* int: npc_ship_id|&lt;br /&gt;
bool: is_sticked - whether npc is sticked to point|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var res = npc.IsStickToObject(25334);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetDistanceToStickPoint|&lt;br /&gt;
* int: npc_ship_id|&lt;br /&gt;
double: distance|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var distance = npc.GetDistanceToStickPoint(25334);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns distance to current stick point.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetDistanceToStickObject|&lt;br /&gt;
* int: npc_ship_id|&lt;br /&gt;
double: distance|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var distance = npc.GetDistanceToStickObject(25334);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns distance to current stick object.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|LockOnTarget|&lt;br /&gt;
* int: npc_ship_id&lt;br /&gt;
* int: target_id&lt;br /&gt;
* double: get_away_dist|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;npc.LockOnTarget(25334, 25343, 20);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Locks on target. Npc will automatically unlock, when distance to target object will be more then get_away_dist.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|StickToObject|&lt;br /&gt;
* int: npc_ship_id&lt;br /&gt;
* int: target_object&lt;br /&gt;
* &#039;&#039;(optional) double: get_away_dist&#039;&#039;|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;npc.StickToObject(25334, 24000, 20);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sticks NPC to object. Npc will try to approach sticked object. Will automatically unstick, when distance to object will exceed get_away_dist parameter.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|StickToPoint|&lt;br /&gt;
* int: npc_ship_id&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y&lt;br /&gt;
* double: get_back_distance|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;npc.StickToPoint(25334, 100, 100, 20);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
NPC sticks to specified point. If NPC goes further then get_back_distance, npc will try to get back to stick point.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|Unstick|&lt;br /&gt;
* int: npc_ship_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;npc.Unstick(25334);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Unsticks NPC from point or object.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetLockedTime|&lt;br /&gt;
* int: npc_ship_id|&lt;br /&gt;
double: locked_time|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var time = npc.GetLockedTime(25334);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns time, during which NPC is locked on it&#039;s current target.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Interaction ==&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|DeviceActivateOnObject|&lt;br /&gt;
* int: npc_ship_id&lt;br /&gt;
* string: id&lt;br /&gt;
* int: target|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;npc.DeviceActivateOnObject(25334, &amp;quot;device&amp;quot;, 1541);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
NPC tries to activate device on specified target.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|DeviceActivateOnCoords|&lt;br /&gt;
* int: npc_ship_id&lt;br /&gt;
* string: id&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;npc.DeviceActivateOnCoords(25334, &amp;quot;device&amp;quot;, 100, 100);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
NPC tries to activate device on specified coordinates.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|DeviceActivateOnSelf|&lt;br /&gt;
* int: npc_ship_id&lt;br /&gt;
* string: id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;npc.DeviceActivateOnSelf(25334, &amp;quot;device&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
NPC tries to activate device on self.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|DeviceDeactivate|&lt;br /&gt;
* int: npc_ship_id&lt;br /&gt;
* string: id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;npc.DeviceDeactivate(25334, &amp;quot;device&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Deactivates device.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|EnterBase|&lt;br /&gt;
* int: npc_ship_id&lt;br /&gt;
* int: base_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;npc.EnterBase(25334, 15);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Npc enters base (with animation, routine etc.)&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|EnterJumpgate|&lt;br /&gt;
* int: npc_ship_id&lt;br /&gt;
* int: jumpgate_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;npc.EnterJumpgate(25334, 16);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Npc enters jumpgate (with animation, routine etc.) After entering jumpgate, ship will be destroyed.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|TravelThroughJumpgate|&lt;br /&gt;
* int: npc_ship_id&lt;br /&gt;
* int: jumpgate_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;npc.TravelThroughJumpgate(25334, 16);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Npc enters jumpgate (with animation, routine etc.). After travel, ship will actually appear in destination system.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetDistanceToObj|&lt;br /&gt;
* int: npc_ship_id&lt;br /&gt;
* int: object_id|&lt;br /&gt;
double: distance|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var distance = npc.GetDistanceToObj(25334, 165);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns distance from npc to specified object.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetCurrentCoordinates|&lt;br /&gt;
* int: npc_ship_id|&lt;br /&gt;
vector2: distance|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var coords = npc.GetCurrentCoordinates(25334);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns current coordinates of NPC.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetDockedTime|&lt;br /&gt;
* int: npc_ship_id|&lt;br /&gt;
double: docked_time|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var time = npc.GetDockedTime(25334);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetObstacleOnTheWay|&lt;br /&gt;
* int: npc_ship_id&lt;br /&gt;
* double: distance|&lt;br /&gt;
int: ID of first obstacle on the way of NPC|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var obstacle_id = npc.GetObstacleOnTheWay(25334, 7);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetSystemAsteroidsByDistanceToNPC|&lt;br /&gt;
* int: npc_ship_id&lt;br /&gt;
* int: limit|&lt;br /&gt;
array: IDs of asteroids|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var asteroids = npc.GetSystemAsteroidsByDistanceToNPC(25334, 8);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns an array of asteroids, which are ordered by distance to NPC (from closest to furthest)&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetShipsInScope|&lt;br /&gt;
* int: npc_ship_id|&lt;br /&gt;
array: IDs of all ships in scope (int)|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var ships = npc.GetShipsInScope(25334);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns an array of ships in NPC&#039;s scope.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetCurrentSystemID|&lt;br /&gt;
* int: npc_ship_id|&lt;br /&gt;
int: current system id|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var sys_id = npc.GetCurrentSystemID(25334);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|IsOnBase|&lt;br /&gt;
* int: npc_ship_id|&lt;br /&gt;
bool: whether npc is docked to base right now|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var res = npc.IsOnBase(25334);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|IsAtBaseEntry|&lt;br /&gt;
* int: npc_ship_id&lt;br /&gt;
* int: base_id|&lt;br /&gt;
bool: whether npc is at base entry point|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var res = npc.IsAtBaseEntry(25334);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|LeaveBase|&lt;br /&gt;
* int: npc_ship_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;npc.LeaveBase(25334);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
NPC undocks from a base.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetTags|&lt;br /&gt;
* int: npc_ship_id|&lt;br /&gt;
object: tags - tags of NPC&#039;s ship|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var tags = npc.GetTags(25334);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetBehavior|&lt;br /&gt;
* int: npc_ship_id&lt;br /&gt;
* string: behavior&lt;br /&gt;
* objects: parameters|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;npc.SetBehavior(25353, &amp;quot;avoid_asteroids&amp;quot;, true);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets behavior of NPC. See more on behaviors in [[VoidExpanse/Behaviors|Behaviors]] section.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetDecisionsPerSecond|&lt;br /&gt;
* int: npc_ship_id&lt;br /&gt;
* int: num|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;npc.SetDecisionsPerSecond(25444, 15);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
It affects how often function Decision on AIBehavior will be called. &lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Damonwall</name></author>
	</entry>
	<entry>
		<id>https://wiki.atomictorch.com/index.php?title=VoidExpanse/scope-chat&amp;diff=122</id>
		<title>VoidExpanse/scope-chat</title>
		<link rel="alternate" type="text/html" href="https://wiki.atomictorch.com/index.php?title=VoidExpanse/scope-chat&amp;diff=122"/>
		<updated>2014-02-18T10:31:37Z</updated>

		<summary type="html">&lt;p&gt;Damonwall: /* List of functions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:VoidExpanse/api_scopes]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Scope chat =&lt;br /&gt;
Used to control chat messages.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Visibility:&#039;&#039;&#039; Global.&lt;br /&gt;
&lt;br /&gt;
== List of functions ==&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SendToAll|&lt;br /&gt;
* string: player_from&lt;br /&gt;
* string: message|&lt;br /&gt;
void |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;chat.SendToAll(&amp;quot;dlirry&amp;quot;, &amp;quot;Mwahahahaha&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sends message to all connected players.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SendToPlayer|&lt;br /&gt;
* string: player_to&lt;br /&gt;
* &#039;&#039;(optional) string: player_from&#039;&#039;&lt;br /&gt;
* string: message|&lt;br /&gt;
void |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;&lt;br /&gt;
chat.SendToPlayer(&amp;quot;somePlayer&amp;quot;, &amp;quot;dlirry&amp;quot;, &amp;quot;Mwahahahaha&amp;quot;);&lt;br /&gt;
chat.SendToPlayer(&amp;quot;somePlayer&amp;quot;, &amp;quot;Mwahahahaha&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sends message to specified player.&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Damonwall</name></author>
	</entry>
	<entry>
		<id>https://wiki.atomictorch.com/index.php?title=VoidExpanse/scope-game&amp;diff=121</id>
		<title>VoidExpanse/scope-game</title>
		<link rel="alternate" type="text/html" href="https://wiki.atomictorch.com/index.php?title=VoidExpanse/scope-game&amp;diff=121"/>
		<updated>2014-02-18T10:29:46Z</updated>

		<summary type="html">&lt;p&gt;Damonwall: /* List of functions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:VoidExpanse/api_scopes]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Scope game =&lt;br /&gt;
Used for various in-game functions.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Visibility:&#039;&#039;&#039; Global.&lt;br /&gt;
&lt;br /&gt;
== List of functions ==&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|ApplyForceToObject|&lt;br /&gt;
* int: object_id&lt;br /&gt;
* double: force_x&lt;br /&gt;
* double: force_y |&lt;br /&gt;
void |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;game.ApplyForceToObject(153, 10, 0); // add x-axis force&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Applies force to physics object. Will work on any interactive object.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|ApplyTorqueToObject|&lt;br /&gt;
* int: object_id&lt;br /&gt;
* double: torque |&lt;br /&gt;
void |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;game.ApplyTorqueToObject(153, 10); // add torque&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Applies torque to physics object. Will work on any interactive object.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|DamageProjectile|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* int: projectile_id&lt;br /&gt;
* double: damage |&lt;br /&gt;
void |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;game.DamageProjectile(1, 12, 10);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Damages projectile. Projectile, that took enough damage, will explode.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|TryToRemoveContentFromAsteroid|&lt;br /&gt;
* int: asteroid_id&lt;br /&gt;
* string: name&lt;br /&gt;
* int: amount |&lt;br /&gt;
int: amount of content extracted from asteroid|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;game.TryToRemoveContentFromAsteroid(12, &amp;quot;ResourceOre&amp;quot;, 10);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Tries to remove specified resource from asteroid&#039;s contents. Returns extracted amount.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetItemEffects|&lt;br /&gt;
* string: xml_item_id|&lt;br /&gt;
array of objects:&lt;br /&gt;
* double: effect_base&lt;br /&gt;
* double: effect_cap&lt;br /&gt;
* double: effect_per_level&lt;br /&gt;
* double: effect_type|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var effects = game.GetItemEffects(&amp;quot;SomeItem&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns an array of all effects of specified item.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetItemPrice|&lt;br /&gt;
* string: xml_item_id|&lt;br /&gt;
int: item_price|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var price = game.GetItemPrice(&amp;quot;SomeItem&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetItemSID|&lt;br /&gt;
* int: unique_item_id |&lt;br /&gt;
string: xml_item_id |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var xml_item_id = game.GetItemSID(12352);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns xml_id of item by it&#039;s instance ID.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetProjectileDescriptionByXmlID|&lt;br /&gt;
* string: projectile_xml_id |&lt;br /&gt;
object:&lt;br /&gt;
* double: damage&lt;br /&gt;
* string: damage_type|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var xml_item_id = game.GetProjectileDescriptionByXmlID(&amp;quot;wpn_0&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Gets projectile description. Projectile xml ID is constructed by the following rule: wpn_id + &amp;quot;_&amp;quot; + projectile_order (starting with 0).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetSecondsMultiplier|&lt;br /&gt;
void |&lt;br /&gt;
void |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var multiplier = game.GetSecondsMultiplier();&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns time passed since last frame. Useful when calculating time-depended stuff, like health-regeneration or damage.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetGameObjectTags|&lt;br /&gt;
* int: object_id |&lt;br /&gt;
void |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var tags = game.GetGameObjectTags(131);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Gets game object tags. Any physical object, such as asteroid, space object, ship or else, has it&#039;s own tags. This function can retrieve it. Alias of game.GetTags.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetTags|&lt;br /&gt;
* int: object_id |&lt;br /&gt;
void |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var tags = game.GetTags(131);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Gets game object tags. Any physical object, such as asteroid, space object, ship or else, has it&#039;s own tags. This function can retrieve it. The same as game.GetGameObjectTags.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetShipOwner|&lt;br /&gt;
* int: ship_id |&lt;br /&gt;
string: owner_name |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var name = game.GetShipOwner(123142);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns name of ship&#039;s owner. If ship is npc-controller, that would be npc name, else - player&#039;s name.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetAsteroidMiningListByID|&lt;br /&gt;
* int: asteroid_id |&lt;br /&gt;
array of objects:&lt;br /&gt;
* string: xml_id&lt;br /&gt;
* int: quantity&lt;br /&gt;
* int: extraction|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var list = game.GetAsteroidMiningListByID(1252);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns actual ateroid mining list.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetAsteroidDescriptionByID|&lt;br /&gt;
* int: asteroid_id |&lt;br /&gt;
object:&lt;br /&gt;
* int: type&lt;br /&gt;
* int: difficulty|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var desc = game.GetAsteroidDescriptionByID(1252);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns asteroid description.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetSkillEffects|&lt;br /&gt;
* string: skill_xml_id |&lt;br /&gt;
array of objects:&lt;br /&gt;
* int: cost&lt;br /&gt;
* int: page&lt;br /&gt;
* string: title|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var effects = game.GetSkillEffects(&amp;quot;SomeSkill&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns array of specified skills&#039; effects.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|IsResource|&lt;br /&gt;
* string: item_xml_id |&lt;br /&gt;
bool: is specified item resource|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var is_res = game.IsResource(&amp;quot;SomeItemOrResource&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|IsHull|&lt;br /&gt;
* string: item_xml_id |&lt;br /&gt;
bool: is specified item is hull|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var is_hull = game.IsHull(&amp;quot;SomeItemOrResource&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|IsDevice|&lt;br /&gt;
* string: item_xml_id |&lt;br /&gt;
bool: is specified item is device|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var is_dev = game.IsDevice(&amp;quot;SomeItemOrResource&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|IsWeapon|&lt;br /&gt;
* string: item_xml_id |&lt;br /&gt;
bool: is specified item is weapon|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var is_wpn = game.IsWeapon(&amp;quot;SomeItemOrResource&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|IsShipPlayerControlled|&lt;br /&gt;
* int: ship_id |&lt;br /&gt;
bool: is ship controlled by player|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var is_player = game.IsShipPlayerControlled(123252);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetSystemJumpgates|&lt;br /&gt;
* int: system_id |&lt;br /&gt;
array: IDs of system jumpgates |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var jumpgates = game.GetSystemJumpgates(1);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns all jumpgates of specified system.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetSystemBases|&lt;br /&gt;
* int: system_id |&lt;br /&gt;
array: IDs of system bases |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var bases = game.GetSystemBases(1);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns all bases of specified system.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetSystemShips|&lt;br /&gt;
* int: system_id |&lt;br /&gt;
array: IDs of system ships |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var ships = game.GetSystemShips(1);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns all ships of specified system.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetSystemShipsOfClass|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* string: tags_class |&lt;br /&gt;
array: IDs of system ships |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var miner_ships = game.GetSystemShipsOfClass(1, &amp;quot;miner&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns all ships of specified system, which tag &amp;quot;class&amp;quot; is equal to specified value.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetSystemPlayersShips|&lt;br /&gt;
* int: system_id |&lt;br /&gt;
array: IDs of system players&#039; ships |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var ships = game.GetSystemPlayersShips(1);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns all player-controlled ships of specified system.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetObjectCoordinates|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* int: object_id |&lt;br /&gt;
vector2: coordinates |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var coords = game.GetObjectCoordinates(1, 25442);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns coordinates of specified object.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|DeleteGameObject|&lt;br /&gt;
* int: object_id |&lt;br /&gt;
void |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;game.DeleteGameObject(25442);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Deletes game object from game world.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetBaseEntryPointsByID|&lt;br /&gt;
* int: base_id |&lt;br /&gt;
array of vector2 |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var points = game.GetBaseEntryPointsByID(353);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns bases&#039; actual entry points coordinates.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetSecondsBetweenStarSystemUpdates|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* int: seconds |&lt;br /&gt;
void |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;game.SetSecondsBetweenStarSystemUpdates(1, 60);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets interval between event &amp;quot;OnStarSystemUpdate&amp;quot; for this system calls.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SendNotification|&lt;br /&gt;
* string: player_name&lt;br /&gt;
* string: title&lt;br /&gt;
* string: message |&lt;br /&gt;
void |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;game.SendNotification(&amp;quot;dlirry&amp;quot;, &amp;quot;Server notification&amp;quot;, &amp;quot;You are great player!&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sends notification to connected player.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetAllItems|&lt;br /&gt;
void |&lt;br /&gt;
array: xml-ids (strings) of all items |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var res = game.GetAllItems();&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Gets all items.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetItems|&lt;br /&gt;
* int: level&lt;br /&gt;
* string[]: item_types |&lt;br /&gt;
array: xml-ids (strings) of items |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var res = game.GetItems(15, [&amp;quot;Hull&amp;quot;, &amp;quot;Consumable&amp;quot;]);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Gets all items of specified type.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetItemTypes|&lt;br /&gt;
void |&lt;br /&gt;
array: strings of types |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var res = station.GetItemTypes();&amp;lt;/pre&amp;gt; |&lt;br /&gt;
&#039;&#039;&#039;not implemented&#039;&#039;&#039;&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Damonwall</name></author>
	</entry>
	<entry>
		<id>https://wiki.atomictorch.com/index.php?title=VoidExpanse/scope-game&amp;diff=120</id>
		<title>VoidExpanse/scope-game</title>
		<link rel="alternate" type="text/html" href="https://wiki.atomictorch.com/index.php?title=VoidExpanse/scope-game&amp;diff=120"/>
		<updated>2014-02-18T10:29:11Z</updated>

		<summary type="html">&lt;p&gt;Damonwall: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:VoidExpanse/api_scopes]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Scope game =&lt;br /&gt;
Used for various in-game functions.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Visibility:&#039;&#039;&#039; Global.&lt;br /&gt;
&lt;br /&gt;
== List of functions ==&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|ApplyForceToObject|&lt;br /&gt;
* int: object_id&lt;br /&gt;
* double: force_x&lt;br /&gt;
* double: force_y |&lt;br /&gt;
void |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;game.ApplyForceToObject(153, 10, 0); // add x-axis force&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Applies force to physics object. Will work on any interactive object.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|ApplyTorqueToObject|&lt;br /&gt;
* int: object_id&lt;br /&gt;
* double: torque |&lt;br /&gt;
void |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;game.ApplyTorqueToObject(153, 10); // add torque&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Applies torque to physics object. Will work on any interactive object.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|DamageProjectile|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* int: projectile_id&lt;br /&gt;
* double: damage |&lt;br /&gt;
void |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;game.DamageProjectile(1, 12, 10);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Damages projectile. Projectile, that took enough damage, will explode.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|TryToRemoveContentFromAsteroid|&lt;br /&gt;
* int: asteroid_id&lt;br /&gt;
* string: name&lt;br /&gt;
* int: amount |&lt;br /&gt;
int: amount of content extracted from asteroid|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;game.TryToRemoveContentFromAsteroid(12, &amp;quot;ResourceOre&amp;quot;, 10);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Tries to remove specified resource from asteroid&#039;s contents. Returns extracted amount.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetItemEffects|&lt;br /&gt;
* string: xml_item_id|&lt;br /&gt;
array of objects:&lt;br /&gt;
* double: effect_base&lt;br /&gt;
* double: effect_cap&lt;br /&gt;
* double: effect_per_level&lt;br /&gt;
* double: effect_type|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var effects = game.GetItemEffects(&amp;quot;SomeItem&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns an array of all effects of specified item.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetItemPrice|&lt;br /&gt;
* string: xml_item_id|&lt;br /&gt;
int: item_price|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var price = game.GetItemPrice(&amp;quot;SomeItem&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetItemSID|&lt;br /&gt;
* int: unique_item_id |&lt;br /&gt;
string: xml_item_id |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var xml_item_id = game.GetItemSID(12352);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns xml_id of item by it&#039;s instance ID.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetProjectileDescriptionByXmlID|&lt;br /&gt;
* string: projectile_xml_id |&lt;br /&gt;
object:&lt;br /&gt;
* double: damage&lt;br /&gt;
* string: damage_type|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var xml_item_id = game.GetProjectileDescriptionByXmlID(&amp;quot;wpn_0&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Gets projectile description. Projectile xml ID is constructed by the following rule: wpn_id + &amp;quot;_&amp;quot; + projectile_order (starting with 0).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetSecondsMultiplier|&lt;br /&gt;
void |&lt;br /&gt;
void |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var multiplier = game.GetSecondsMultiplier();&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns time passed since last frame. Useful when calculating time-depended stuff, like health-regeneration or damage.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetGameObjectTags|&lt;br /&gt;
* int: object_id |&lt;br /&gt;
void |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var tags = game.GetGameObjectTags(131);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Gets game object tags. Any physical object, such as asteroid, space object, ship or else, has it&#039;s own tags. This function can retrieve it. Alias of game.GetTags.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetTags|&lt;br /&gt;
* int: object_id |&lt;br /&gt;
void |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var tags = game.GetTags(131);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Gets game object tags. Any physical object, such as asteroid, space object, ship or else, has it&#039;s own tags. This function can retrieve it. The same as game.GetGameObjectTags.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetShipOwner|&lt;br /&gt;
* int: ship_id |&lt;br /&gt;
string: owner_name |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var name = game.GetShipOwner(123142);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns name of ship&#039;s owner. If ship is npc-controller, that would be npc name, else - player&#039;s name.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetAsteroidMiningListByID|&lt;br /&gt;
* int: asteroid_id |&lt;br /&gt;
array of objects:&lt;br /&gt;
* string: xml_id&lt;br /&gt;
* int: quantity&lt;br /&gt;
* int: extraction|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var list = game.GetAsteroidMiningListByID(1252);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns actual ateroid mining list.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetAsteroidDescriptionByID|&lt;br /&gt;
* int: asteroid_id |&lt;br /&gt;
object:&lt;br /&gt;
* int: type&lt;br /&gt;
* int: difficulty|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var desc = game.GetAsteroidDescriptionByID(1252);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns asteroid description.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetSkillEffects|&lt;br /&gt;
* string: skill_xml_id |&lt;br /&gt;
array of objects:&lt;br /&gt;
* int: cost&lt;br /&gt;
* int: page&lt;br /&gt;
* string: title|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var effects = game.GetSkillEffects(&amp;quot;SomeSkill&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns array of specified skills&#039; effects.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|IsResource|&lt;br /&gt;
* string: item_xml_id |&lt;br /&gt;
bool: is specified item resource|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var is_res = game.IsResource(&amp;quot;SomeItemOrResource&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|IsHull|&lt;br /&gt;
* string: item_xml_id |&lt;br /&gt;
bool: is specified item is hull|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var is_hull = game.IsHull(&amp;quot;SomeItemOrResource&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|IsDevice|&lt;br /&gt;
* string: item_xml_id |&lt;br /&gt;
bool: is specified item is device|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var is_dev = game.IsDevice(&amp;quot;SomeItemOrResource&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|IsWeapon|&lt;br /&gt;
* string: item_xml_id |&lt;br /&gt;
bool: is specified item is weapon|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var is_wpn = game.IsWeapon(&amp;quot;SomeItemOrResource&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|IsShipPlayerControlled|&lt;br /&gt;
* int: ship_id |&lt;br /&gt;
bool: is ship controlled by player|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var is_player = game.IsShipPlayerControlled(123252);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetSystemJumpgates|&lt;br /&gt;
* int: system_id |&lt;br /&gt;
array: IDs of system jumpgates |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var jumpgates = game.GetSystemJumpgates(1);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns all jumpgates of specified system.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetSystemBases|&lt;br /&gt;
* int: system_id |&lt;br /&gt;
array: IDs of system bases |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var bases = game.GetSystemBases(1);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns all bases of specified system.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetSystemShips|&lt;br /&gt;
* int: system_id |&lt;br /&gt;
array: IDs of system ships |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var ships = game.GetSystemShips(1);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns all ships of specified system.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetSystemShipsOfClass|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* string: tags_class |&lt;br /&gt;
array: IDs of system ships |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var miner_ships = game.GetSystemShipsOfClass(1, &amp;quot;miner&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns all ships of specified system, which tag &amp;quot;class&amp;quot; is equal to specified value.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetSystemPlayersShips|&lt;br /&gt;
* int: system_id |&lt;br /&gt;
array: IDs of system players&#039; ships |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var ships = game.GetSystemPlayersShips(1);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns all player-controlled ships of specified system.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetObjectCoordinates|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* int: object_id |&lt;br /&gt;
vector2: coordinates |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var coords = game.GetObjectCoordinates(1, 25442);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns coordinates of specified object.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|DeleteGameObject|&lt;br /&gt;
* int: object_id |&lt;br /&gt;
void |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;game.DeleteGameObject(25442);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Deletes game object from game world.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetBaseEntryPointsByID|&lt;br /&gt;
* int: base_id |&lt;br /&gt;
array of vector2 |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var points = game.GetBaseEntryPointsByID(353);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns bases&#039; actual entry points coordinates.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetSecondsBetweenStarSystemUpdates|&lt;br /&gt;
* int: system_id&lt;br /&gt;
* int: seconds |&lt;br /&gt;
void |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;game.SetSecondsBetweenStarSystemUpdates(1, 60);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets interval between event &amp;quot;OnStarSystemUpdate&amp;quot; for this system calls.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SendNotification|&lt;br /&gt;
* string: player_name&lt;br /&gt;
* string: title&lt;br /&gt;
* string: message |&lt;br /&gt;
void |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;game.SendNotification(&amp;quot;dlirry&amp;quot;, &amp;quot;Server notification&amp;quot;, &amp;quot;You are great player!&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sends notification to connected player.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetAllItems|&lt;br /&gt;
void |&lt;br /&gt;
array: xml-ids (strings) of all items |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var res = game.GetAllItems();&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Gets all items.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetITems|&lt;br /&gt;
* int: level&lt;br /&gt;
* string[]: item_types |&lt;br /&gt;
array: xml-ids (strings) of items |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var res = game.GetITems(15, [&amp;quot;Hull&amp;quot;, &amp;quot;Consumable&amp;quot;]);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Gets all items of specified type.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetItemTypes|&lt;br /&gt;
void |&lt;br /&gt;
array: strings of types |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var res = station.GetItemTypes();&amp;lt;/pre&amp;gt; |&lt;br /&gt;
&#039;&#039;&#039;not implemented&#039;&#039;&#039;&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Damonwall</name></author>
	</entry>
	<entry>
		<id>https://wiki.atomictorch.com/index.php?title=VoidExpanse/scope-station&amp;diff=119</id>
		<title>VoidExpanse/scope-station</title>
		<link rel="alternate" type="text/html" href="https://wiki.atomictorch.com/index.php?title=VoidExpanse/scope-station&amp;diff=119"/>
		<updated>2014-02-18T10:27:19Z</updated>

		<summary type="html">&lt;p&gt;Damonwall: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:VoidExpanse/api_scopes]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Scope station =&lt;br /&gt;
Useful during store generation process.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Visibility:&#039;&#039;&#039; Global.&lt;br /&gt;
&lt;br /&gt;
== List of functions ==&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddItem|&lt;br /&gt;
* int: base_id&lt;br /&gt;
* string: item_type&lt;br /&gt;
* &#039;&#039;(optional) int: quantity&#039;&#039;|&lt;br /&gt;
void |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;station.AddItem(12, &amp;quot;SomeItemToSell&amp;quot;, 10);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds item to station&#039;s store.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetBaseByID|&lt;br /&gt;
* int: base_id|&lt;br /&gt;
object:&lt;br /&gt;
* string: faction&lt;br /&gt;
* int: tech_level&lt;br /&gt;
* string: name&lt;br /&gt;
* double: coord_x&lt;br /&gt;
* double: coord_y|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;station.GetBaseByID(131);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns info about base.&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Damonwall</name></author>
	</entry>
	<entry>
		<id>https://wiki.atomictorch.com/index.php?title=VoidExpanse/scope-topic&amp;diff=114</id>
		<title>VoidExpanse/scope-topic</title>
		<link rel="alternate" type="text/html" href="https://wiki.atomictorch.com/index.php?title=VoidExpanse/scope-topic&amp;diff=114"/>
		<updated>2014-02-18T07:16:37Z</updated>

		<summary type="html">&lt;p&gt;Damonwall: /* List of functions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:VoidExpanse/api_scopes]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Scope topic =&lt;br /&gt;
Topic scope is used only inside topic scripts. Controls dialogs and quests.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Visibility:&#039;&#039;&#039; In topics only.&lt;br /&gt;
&lt;br /&gt;
== List of functions ==&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddChoice|&lt;br /&gt;
* int: choice_id&lt;br /&gt;
* string: choice_localisation_id&lt;br /&gt;
* string: choice_text&lt;br /&gt;
* &#039;&#039;(optional) object: parameters&#039;&#039;|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;topic.AddChoice(1, &amp;quot;c001&amp;quot;, &amp;quot;I&#039;d like to pass this one, please.&amp;quot;);&lt;br /&gt;
topic.AddChoice(1, &amp;quot;c001&amp;quot;, &amp;quot;I&#039;d like to pass this %one%, please.&amp;quot;, {one: &amp;quot;hamburger&amp;quot;});&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds a choice to dialog.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddPhrase|&lt;br /&gt;
* string: phrase_localisation_id&lt;br /&gt;
* string: phrase_text&lt;br /&gt;
* object: arguments|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;topic.AddPhrase(&amp;quot;p001&amp;quot;, &amp;quot;Hello, i&#039;m npc!&amp;quot;);&lt;br /&gt;
topic.AddPhrase(&amp;quot;p001&amp;quot;, &amp;quot;Hello, i&#039;m %npc_name%!&amp;quot;,&lt;br /&gt;
		{npc_name: &amp;quot;Scott&amp;quot;});&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds an npc phrase to dialog.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|AddTopic|&lt;br /&gt;
* string: topic_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;topic.AddTopic(&amp;quot;topic_id_01&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds specified topic to player&#039;s available topics.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RefreshTopics|&lt;br /&gt;
void|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;topic.RefreshTopics();&amp;lt;/pre&amp;gt; |&lt;br /&gt;
List of topics on client is loaded once per conversation. If new topic was added, or the old one removed, this list will be reloaded. But what if state of topic was changed, and current npc shouldn&#039;t have it now, but there&#039;s such topic in player&#039;s list because it was already loaded?&lt;br /&gt;
RefreshTopics reloads current list of topics, testing all of them with CheckRequiments and actualize topic list.&lt;br /&gt;
Can come in handly when single topic manages dialogs with multiple characters in sequence.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|HasTopic|&lt;br /&gt;
* string: topic_id|&lt;br /&gt;
bool: returns whether player already has this topic or not|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var bHasTopic = topic.HasTopic(&amp;quot;topic_id_01&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|HasQuest|&lt;br /&gt;
* string: quest_id|&lt;br /&gt;
bool: returns whether player already has this quest or not|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var bHasQuest = topic.HasQuest(&amp;quot;quest_id_01&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|Bind|&lt;br /&gt;
* string: trigger_name&lt;br /&gt;
* string: function_name&lt;br /&gt;
* object: parametes |&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;topic.Bind(&amp;quot;someTrigger&amp;quot;, &amp;quot;OnSomeTrigger&amp;quot;, { npc_id: &amp;quot;errors&amp;quot; });&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Binds function to a trigger.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|DialogueBreak|&lt;br /&gt;
void|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;topic.DialogueBreak();&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Immediately breaks current dialogue.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetCurrentNpcId|&lt;br /&gt;
void|&lt;br /&gt;
string: current npc id (name)|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var npc_id = topic.GetCurrentNpcId();&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetCurrentNpcShipId|&lt;br /&gt;
void|&lt;br /&gt;
int: current npc&#039;s ship id|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var npc_ship_id = topic.GetCurrentNpcShipId();&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetCurrentShipId|&lt;br /&gt;
void|&lt;br /&gt;
int: current player ship&#039;s ID|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var player_ship_id = topic.GetCurrentShipId();&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Has a global alias - PLAYER_SHIP. It&#039;s better to use alias - faster.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetInput|&lt;br /&gt;
void|&lt;br /&gt;
int: player&#039;s choice id|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var input = topic.GetInput();&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetState|&lt;br /&gt;
void|&lt;br /&gt;
int: topic state|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var state = topic.GetState();&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns current topic state - integer value. Usually state means current progress in questline, but it can be used any way possible.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|InputExists|&lt;br /&gt;
void|&lt;br /&gt;
bool: returns whether player choose something or not|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;var bInputExists = topic.InputExists();&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|QuestAddLog|&lt;br /&gt;
* string: quest_id&lt;br /&gt;
* string: entry_id&lt;br /&gt;
* string: quest_text&lt;br /&gt;
* &#039;&#039;(optional) object: args&#039;&#039;|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;topic.QuestAddLog(&amp;quot;some_quest&amp;quot;, &amp;quot;e001&amp;quot;, &amp;quot;I just got this quest into quest log.&amp;quot;);&lt;br /&gt;
topic.QuestAddLog(&amp;quot;some_quest&amp;quot;, &amp;quot;e001&amp;quot;, &amp;quot;I just got this %whaat% into quest log.&amp;quot;,&lt;br /&gt;
	{whaat: &amp;quot;hamburger&amp;quot;});&amp;lt;/pre&amp;gt; |&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|QuestAddMark|&lt;br /&gt;
* string: quest_id&lt;br /&gt;
* int: system_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;topic.QuestAddMark(&amp;quot;some_quest&amp;quot;, 1);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Adds questmark, that&#039;ll be visible on a galaxy map.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|QuestClearLog|&lt;br /&gt;
* string: quest_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;topic.QuestClearLog(&amp;quot;some_quest&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Clears log of specified quest.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|QuestSetState|&lt;br /&gt;
* string: quest_id&lt;br /&gt;
* int: state|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;topic.QuestSetState(&amp;quot;some_quest&amp;quot;, QuestStatus.Finished);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Sets state of quest. State can be QuestStatus.Active (0), QuestStatus.Finished (1), QuestStatus.Failed (2). All this constants are defined in any topic. You can use either them, or just numbers - 0,1,2. Status affects in which tab quest displays.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|QuestRemove|&lt;br /&gt;
* string: quest_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;topic.QuestRemove(&amp;quot;some_quest&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes quest completely - after that it won&#039;t appear in any tab.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|QuestRemoveMarkers|&lt;br /&gt;
* string: quest_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;topic.QuestRemoveMarkers(&amp;quot;some_quest&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes all markers of quest.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|QuestStart|&lt;br /&gt;
* string: quest_id&lt;br /&gt;
* string: quest_title |&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;topic.QuestStart(&amp;quot;some_quest&amp;quot;, &amp;quot;Rats in the cellar&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Stars quest. After that it will appear in journal, and log messages and markers can be added to it.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|RemoveTopic|&lt;br /&gt;
* string: topic_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;topic.RemoveTopic(&amp;quot;topic_id&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes topic completely.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetState|&lt;br /&gt;
* int: state_value|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;topic.SetState(200);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Changes state of current topic.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|Unbind|&lt;br /&gt;
* string: trigger_name&lt;br /&gt;
* string: function_name|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px;&amp;quot;&amp;gt;topic.Unbind(&amp;quot;someTrigger&amp;quot;, &amp;quot;OnSomeTrigger&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Unbinds function from a trigger.&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Damonwall</name></author>
	</entry>
	<entry>
		<id>https://wiki.atomictorch.com/index.php?title=VoidExpanse/scope-config&amp;diff=113</id>
		<title>VoidExpanse/scope-config</title>
		<link rel="alternate" type="text/html" href="https://wiki.atomictorch.com/index.php?title=VoidExpanse/scope-config&amp;diff=113"/>
		<updated>2014-02-18T07:12:44Z</updated>

		<summary type="html">&lt;p&gt;Damonwall: Undo revision 111 by Damonwall (talk)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:VoidExpanse/api_scopes]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
= Config scope =&lt;br /&gt;
Used to get access to server variables from config file.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Visibility:&#039;&#039;&#039; Global.&lt;br /&gt;
&lt;br /&gt;
== List of functions ==&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetFlag|&lt;br /&gt;
* string: name|&lt;br /&gt;
bool - whether the flag is set or not.|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px&amp;quot;&amp;gt;var a = config.GetFlag(&amp;quot;some_var&amp;quot;);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Returns a boolean server flag value by name. Basically used to read server config options.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|GetSetting|&lt;br /&gt;
* string: name|&lt;br /&gt;
object - a particular value of config.|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px&amp;quot;&amp;gt;var a = config.GetSetting(&amp;quot;some_var&amp;quot;);&amp;lt;/pre&amp;gt;|&lt;br /&gt;
Returns a server variable value by name. Basically used to read server config options from script. Standard return types are string, int, float, boolean.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|Wait|&lt;br /&gt;
* int: time_ms|&lt;br /&gt;
void |&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px&amp;quot;&amp;gt;config.Wait(1000); //wait for 1 second&amp;lt;/pre&amp;gt;|&lt;br /&gt;
Makes main thread to wait for specified time in milliseconds.&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Damonwall</name></author>
	</entry>
	<entry>
		<id>https://wiki.atomictorch.com/index.php?title=VoidExpanse/scope-timer&amp;diff=112</id>
		<title>VoidExpanse/scope-timer</title>
		<link rel="alternate" type="text/html" href="https://wiki.atomictorch.com/index.php?title=VoidExpanse/scope-timer&amp;diff=112"/>
		<updated>2014-02-18T07:12:04Z</updated>

		<summary type="html">&lt;p&gt;Damonwall: Created page with &amp;quot;&amp;lt;noinclude&amp;gt; Category:VoidExpanse/api_scopes &amp;lt;/noinclude&amp;gt; = Timer scope = Used to create and manage timers - delayed events. Timers only works inside it&amp;#039;s script, but they&amp;#039;...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:VoidExpanse/api_scopes]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
= Timer scope =&lt;br /&gt;
Used to create and manage timers - delayed events. Timers only works inside it&#039;s script, but&lt;br /&gt;
they&#039;re persistent through savegames.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Visibility:&#039;&#039;&#039; Global.&lt;br /&gt;
&lt;br /&gt;
== List of functions ==&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetTimer|&lt;br /&gt;
* double: time_in_seconds&lt;br /&gt;
* string: function_name&lt;br /&gt;
* object: args&lt;br /&gt;
* int: loops (0 - infinite)|&lt;br /&gt;
int - ID of created timer|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px&amp;quot;&amp;gt;var timer = timer.SetTimer(5, &amp;quot;SomeFunction&amp;quot;, {what_to_say: &amp;quot;hello&amp;quot;}, 1);&lt;br /&gt;
function SomeFunction( args )&lt;br /&gt;
{&lt;br /&gt;
	console.Print(&amp;quot;I was told to say &amp;quot; + args.what_to_say);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Creates a timed event, which will be executed after &amp;quot;time_in_seconds&amp;quot; interval. Can be infinite loop.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|ClearTimer|&lt;br /&gt;
* int: timer_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px&amp;quot;&amp;gt;timer.ClearTimer(5);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes timer with specified ID.&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Damonwall</name></author>
	</entry>
	<entry>
		<id>https://wiki.atomictorch.com/index.php?title=VoidExpanse/scope-config&amp;diff=111</id>
		<title>VoidExpanse/scope-config</title>
		<link rel="alternate" type="text/html" href="https://wiki.atomictorch.com/index.php?title=VoidExpanse/scope-config&amp;diff=111"/>
		<updated>2014-02-18T07:11:24Z</updated>

		<summary type="html">&lt;p&gt;Damonwall: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:VoidExpanse/api_scopes]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
= Timer scope =&lt;br /&gt;
Used to create and manage timers - delayed events. Timers only works inside it&#039;s script, but&lt;br /&gt;
they&#039;re persistent through savegames.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Visibility:&#039;&#039;&#039; Global.&lt;br /&gt;
&lt;br /&gt;
== List of functions ==&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|SetTimer|&lt;br /&gt;
* double: time_in_seconds&lt;br /&gt;
* string: function_name&lt;br /&gt;
* object: args&lt;br /&gt;
* int: loops (0 - infinite)|&lt;br /&gt;
int - ID of created timer|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px&amp;quot;&amp;gt;var timer = timer.SetTimer(5, &amp;quot;SomeFunction&amp;quot;, {what_to_say: &amp;quot;hello&amp;quot;}, 1);&lt;br /&gt;
function SomeFunction( args )&lt;br /&gt;
{&lt;br /&gt;
	console.Print(&amp;quot;I was told to say &amp;quot; + args.what_to_say);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Creates a timed event, which will be executed after &amp;quot;time_in_seconds&amp;quot; interval. Can be infinite loop.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Scripting_api|ClearTimer|&lt;br /&gt;
* int: timer_id|&lt;br /&gt;
void|&lt;br /&gt;
&amp;lt;pre style=&amp;quot;margin:0px&amp;quot;&amp;gt;timer.ClearTimer(5);&amp;lt;/pre&amp;gt; |&lt;br /&gt;
Removes timer with specified ID.&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Damonwall</name></author>
	</entry>
	<entry>
		<id>https://wiki.atomictorch.com/index.php?title=VoidExpanse/scripting_api&amp;diff=110</id>
		<title>VoidExpanse/scripting api</title>
		<link rel="alternate" type="text/html" href="https://wiki.atomictorch.com/index.php?title=VoidExpanse/scripting_api&amp;diff=110"/>
		<updated>2014-02-18T07:05:42Z</updated>

		<summary type="html">&lt;p&gt;Damonwall: /* Scopes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Scripting overview =&lt;br /&gt;
&lt;br /&gt;
== Basic concepts ==&lt;br /&gt;
Scripting is done via actions that custom scripts can subscribe to. There are number of actions that are called by server automatically, plus users can create their own actions and call them when needed. This also makes possible for users to create scripting frameworks for others to use.&lt;br /&gt;
Each action has one argument (ΓÇ£argsΓÇ¥) that is a JavaScript object containing several variables inside depending on a particular action. In some actions this ΓÇ£argsΓÇ¥ object can be empty. But either way it allows for unified format for all actions within the scripting system.&lt;br /&gt;
&lt;br /&gt;
=== Scripting naming convention ===&lt;br /&gt;
* String IDΓÇÖs in mods can only contain alphanumeric characters and underscores. Any other characters are illegal.&lt;br /&gt;
* Using underscore for variables and properties.&lt;br /&gt;
* Using CamelCase for functions and methods.&lt;br /&gt;
* zxc_q - ΓÇ£qΓÇ¥ in the variable always represents ΓÇ£quantityΓÇ¥ or ΓÇ£number of ...ΓÇ¥.&lt;br /&gt;
* zxc_id - ΓÇ£idΓÇ¥ always means either string id from XML file if it is of the type of string, or if it is uint then it is entity (instance) id of some object.&lt;br /&gt;
* zxc_req - ΓÇ£reqΓÇ¥ always means ΓÇ£requirementsΓÇ¥.&lt;br /&gt;
* All mods should prefix their variables, functions, classes, storage keys and all the rest with a key for isolation from other mods, example of such prefix would be ΓÇ£prf_ΓÇ¥ -&amp;gt; ΓÇ£prf_some_variableΓÇ¥, ΓÇ£prf_SomeFunctionΓÇ¥.&lt;br /&gt;
&lt;br /&gt;
=== Internal scripts (Overridable) ===&lt;br /&gt;
{{Main|VoidExpanse/Internal_scripts|Internal scripts}}&lt;br /&gt;
These scripts are called usually once and only in a particular situation. Each of these script files must exist in only one instance. If a new script is added the previous one will be overridden. Each of the script files must implement only one script action. Usually players should not modify these scripts unless they want to completely re-implement some game feature.&lt;br /&gt;
&lt;br /&gt;
=== Global scripts (called in the world dynamically) ===&lt;br /&gt;
{{Main|VoidExpanse/Global_scripts|Global scripts}}&lt;br /&gt;
Global scripts are executed continuously during gameplay. For each event there could be many bound scripts. Also it is possible to create custom actions and subscribe to them.&lt;br /&gt;
&lt;br /&gt;
=== Object scripts ===&lt;br /&gt;
{{Main|VoidExpanse/Object_scripts|Object scripts}}&lt;br /&gt;
Object scripts are scripts attached to a particular game object. When that object starts an action, if script has an appropriate handler for this action it will be executed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== VoidExpanse Scripting API ==&lt;br /&gt;
&lt;br /&gt;
=== Library inclusion and scopes usage ===&lt;br /&gt;
Preprocessor directive &amp;lt;code&amp;gt;include(libname.js);&amp;lt;/code&amp;gt; includes a library scripts into a current JS instance. Library scripts also can include each other (no echo effect will appear).&lt;br /&gt;
&lt;br /&gt;
Allows to use functions and objects of these libraries in this particular script instance.&lt;br /&gt;
* Inclusions of libraries directive must be the first lines in the script file (not necessarily, but preferably - to maintain order in scripts).&lt;br /&gt;
* All include directives must be before first function declaration.&lt;br /&gt;
&lt;br /&gt;
Preprocessor directive &amp;lt;code&amp;gt;using(scopename);&amp;lt;/code&amp;gt; allows to use specific scope in a specific script. Scope name must be an existing scope name (see scopes below). Except for some specific scopes (like topic or npc), which are available only in specific places, like topic scripts or AI behaviors.&lt;br /&gt;
&lt;br /&gt;
=== Scopes ===&lt;br /&gt;
Each scope contains a number of functions available from it.&lt;br /&gt;
&lt;br /&gt;
* [[VoidExpanse/scope-config]] (available: global)&lt;br /&gt;
* [[VoidExpanse/scope-script]] (available: global)&lt;br /&gt;
* [[VoidExpanse/scope-actions]] (available: global)&lt;br /&gt;
* [[VoidExpanse/scope-server]] (available: global)&lt;br /&gt;
* [[VoidExpanse/scope-generator]] (available: global)&lt;br /&gt;
* [[VoidExpanse/scope-spawn]] (available: global)&lt;br /&gt;
* [[VoidExpanse/scope-station]] (available: global)&lt;br /&gt;
* [[VoidExpanse/scope-chat]] (available: global)&lt;br /&gt;
* [[VoidExpanse/scope-console]] (available: global)&lt;br /&gt;
* [[VoidExpanse/scope-storage]] (available: global)&lt;br /&gt;
* [[VoidExpanse/scope-game]] (available: global)&lt;br /&gt;
* [[VoidExpanse/scope-ship]] (available: global)&lt;br /&gt;
* [[VoidExpanse/scope-visual]] (available: global)&lt;br /&gt;
* [[VoidExpanse/scope-player]] (available: global)&lt;br /&gt;
* [[VoidExpanse/scope-topic]] (available: only in topics)&lt;br /&gt;
* [[VoidExpanse/scope-topics]] (available: global)&lt;br /&gt;
* [[VoidExpanse/scope-relations]] (available: global)&lt;br /&gt;
* [[VoidExpanse/scope-npc]] (available: global)&lt;br /&gt;
* [[VoidExpanse/scope-timer]] (available: global)&lt;br /&gt;
&lt;br /&gt;
== Device scripts ==&lt;br /&gt;
{{Main|VoidExpanse/Device_scripts|Device scripts}}&lt;br /&gt;
Devices uses effect scripts, which is similar to any object scripts, but uses itΓÇÖs own special system of arguments. These scripts are shared between instances of the same device type, therefore global variables in this scripts are denied.&lt;br /&gt;
&lt;br /&gt;
There are four possible functions for device script.&lt;/div&gt;</summary>
		<author><name>Damonwall</name></author>
	</entry>
	<entry>
		<id>https://wiki.atomictorch.com/index.php?title=VoidExpanse/events&amp;diff=109</id>
		<title>VoidExpanse/events</title>
		<link rel="alternate" type="text/html" href="https://wiki.atomictorch.com/index.php?title=VoidExpanse/events&amp;diff=109"/>
		<updated>2014-02-18T07:04:53Z</updated>

		<summary type="html">&lt;p&gt;Damonwall: /* Events */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Events ==&lt;br /&gt;
&lt;br /&gt;
Events in scripts are governed by scope &#039;&#039;&#039;actions&#039;&#039;&#039;. You can create your own events, or you&lt;br /&gt;
can subscribe to events created by other modders, but all scripting system is based on built-in&lt;br /&gt;
events, which are the following:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;quot;OnEnterFrame&amp;quot;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
input:&lt;br /&gt;
* double: multiplier - time in seconds passed since last frame&lt;br /&gt;
&lt;br /&gt;
Called every frame on server.&lt;br /&gt;
NOTE: Can be manipulated with [[VoidExpanse/scope-script|scope-script]] - to make it work not every frame,&lt;br /&gt;
but every timer interval or definite frames per second.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;quot;OnChatReceive&amp;quot;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
input:&lt;br /&gt;
* string: from&lt;br /&gt;
* string: text&lt;br /&gt;
&lt;br /&gt;
Called when some player send chat message.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;quot;OnCalculateInventoryCache&amp;quot;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
input:&lt;br /&gt;
* string: player_name&lt;br /&gt;
* double: seconds_multiplier&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* int: level&lt;br /&gt;
&lt;br /&gt;
Called when it&#039;s time to recalculate equipment - for example, when player installs new hull or weapon.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;quot;OnCalculateSkillsCache&amp;quot;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
input:&lt;br /&gt;
* string: player_name&lt;br /&gt;
* double: seconds_multiplier&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* int: level&lt;br /&gt;
&lt;br /&gt;
Called when it&#039;s time to recalculate skills cache - usually when player takes new skill, or advances in an old one.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;quot;OnCalculateBuffsCache&amp;quot;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
input:&lt;br /&gt;
* string: player_name&lt;br /&gt;
* double: seconds_multiplier&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* int: level&lt;br /&gt;
&lt;br /&gt;
Called when active effects (buffs) are changed - for example, effect of consumable item is worn off.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;quot;OnCalculateShipParameters&amp;quot;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
input:&lt;br /&gt;
* string: player_name&lt;br /&gt;
* double: seconds_multiplier&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* int: level&lt;br /&gt;
&lt;br /&gt;
Called if any of other caches has been changed. Recalculation of final ship&#039;s cache.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;quot;OnCollision&amp;quot;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
input:&lt;br /&gt;
* double: collision_point_x&lt;br /&gt;
* double: collision_point_y&lt;br /&gt;
* double: impulse&lt;br /&gt;
* int: object_id_1&lt;br /&gt;
* int: object_id_2&lt;br /&gt;
* string: object_type_1&lt;br /&gt;
* string: object_type_2&lt;br /&gt;
* double: vector_x&lt;br /&gt;
* double: vector_y&lt;br /&gt;
&lt;br /&gt;
Called when some objects collided.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;quot;OnHit&amp;quot;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
input:&lt;br /&gt;
* int: caster_id&lt;br /&gt;
* double: collision_point_x&lt;br /&gt;
* double: collision_point_y&lt;br /&gt;
* int: object_id&lt;br /&gt;
* string: object_type&lt;br /&gt;
* string: projectile_id&lt;br /&gt;
* string: projectile_type //bullet, ray&lt;br /&gt;
* double: vector_x&lt;br /&gt;
* double: vector_y&lt;br /&gt;
* string: weapon_id&lt;br /&gt;
* double: distance&lt;br /&gt;
* double: projectile_distance&lt;br /&gt;
* double: projectile_max_distance&lt;br /&gt;
* double: multiplier&lt;br /&gt;
&lt;br /&gt;
Called every time one ship hits with weapon another one.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;quot;OnRayHitProjectile&amp;quot;&#039;&#039;&#039;&lt;br /&gt;
not implemented yet&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;quot;OnUpdateShipParameters&amp;quot;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
input:&lt;br /&gt;
* string: player_name&lt;br /&gt;
* double: seconds_multiplier&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* int: level&lt;br /&gt;
&lt;br /&gt;
Called 5 times per second. Used for regeneration, fuel and energy consumption calculations etc.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;quot;OnMaximizeShipValues&amp;quot;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
input:&lt;br /&gt;
* string: player_name&lt;br /&gt;
* double: seconds_multiplier&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* int: level&lt;br /&gt;
&lt;br /&gt;
Called every time ship values are maximized (on space station for example).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;quot;OnBaseGenerateStock&amp;quot;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
input:&lt;br /&gt;
* int: station_id&lt;br /&gt;
&lt;br /&gt;
Called every time stock on station is needed to be refreshed.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;quot;OnStarSystemUpdate&amp;quot;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
input:&lt;br /&gt;
* int: system_id&lt;br /&gt;
* bool: populated&lt;br /&gt;
&lt;br /&gt;
Called once per specified amount of time (which is set by special function in game scope). Called for populated systems and non-populated.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;quot;OnCalculateNpcLeveledCache&amp;quot;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
input:&lt;br /&gt;
* string: player_name&lt;br /&gt;
* double: seconds_multiplier&lt;br /&gt;
* int: ship_id&lt;br /&gt;
* int: level&lt;br /&gt;
&lt;br /&gt;
Called when NPC is created. As soon as npc doesn&#039;t have any real equipment, their equipment cache is calculated based on it&#039;s level, and&lt;br /&gt;
it should be done in this function.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;quot;OnShipTryToEnterJumpgate&amp;quot;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
input:&lt;br /&gt;
* int: current_system_id&lt;br /&gt;
* int: destination_system_id&lt;br /&gt;
* int: jumpgate_id&lt;br /&gt;
* int: ship_id&lt;br /&gt;
&lt;br /&gt;
Called when player&#039;s ship is trying to enter jumpgate.&lt;br /&gt;
NOTE! This event has a return value.&lt;br /&gt;
Handler may not return anything, but if it&#039;ll return object with field {allow: false},&lt;br /&gt;
ship will not pass through jumpgate. With field &amp;quot;message&amp;quot; : {message: &amp;quot;Use the force, Luke!&amp;quot;}&lt;br /&gt;
you can control notification, which client will see in his notification area.&lt;br /&gt;
As soon as any on handlers will return {allow:false}, chain of calls breaks, and other&lt;br /&gt;
subscribers won&#039;t get the event.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;quot;OnShipKilled&amp;quot;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
input:&lt;br /&gt;
* int: caster_id&lt;br /&gt;
* double: collision_point_x&lt;br /&gt;
* double: collision_point_y&lt;br /&gt;
* int: object_id&lt;br /&gt;
* string: object_type&lt;br /&gt;
* string: projectile_id&lt;br /&gt;
* string: projectile_type //bullet, ray&lt;br /&gt;
* double: vector_x&lt;br /&gt;
* double: vector_y&lt;br /&gt;
* string: weapon_id&lt;br /&gt;
* double: distance&lt;br /&gt;
* double: projectile_distance&lt;br /&gt;
* double: projectile_max_distance&lt;br /&gt;
* double: multiplier&lt;br /&gt;
&lt;br /&gt;
Called every time ship is killed by other ship.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;quot;OnShipDestroyed&amp;quot;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
input:&lt;br /&gt;
* int: ship_id&lt;br /&gt;
&lt;br /&gt;
Called every time ship is destroyed.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;quot;OnShipWarps&amp;quot;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
input:&lt;br /&gt;
* int: ship_id&lt;br /&gt;
&lt;br /&gt;
Called every time ship warps.&lt;br /&gt;
NOTE! This event has a return value.&lt;br /&gt;
Handler may not return anything, but if it&#039;ll return object with field {allow: false},&lt;br /&gt;
ship will not pass through jumpgate. With field &amp;quot;message&amp;quot; : {message: &amp;quot;Use the force, Luke!&amp;quot;}&lt;br /&gt;
you can control notification, which client will see in his notification area.&lt;br /&gt;
As soon as any on handlers will return {allow:false}, chain of calls breaks, and other&lt;br /&gt;
subscribers won&#039;t get the event.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;quot;OnPlayerEntersGame&amp;quot;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
input:&lt;br /&gt;
* string: name&lt;br /&gt;
&lt;br /&gt;
Called every time player enters the game&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;quot;OnPlayerEntersSystem&amp;quot;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
input:&lt;br /&gt;
* string: name&lt;br /&gt;
* int: system_id&lt;br /&gt;
&lt;br /&gt;
Called every time player enters system&lt;/div&gt;</summary>
		<author><name>Damonwall</name></author>
	</entry>
	<entry>
		<id>https://wiki.atomictorch.com/index.php?title=VoidExpanse/modding&amp;diff=108</id>
		<title>VoidExpanse/modding</title>
		<link rel="alternate" type="text/html" href="https://wiki.atomictorch.com/index.php?title=VoidExpanse/modding&amp;diff=108"/>
		<updated>2014-02-17T03:43:03Z</updated>

		<summary type="html">&lt;p&gt;Damonwall: Created page with &amp;quot;VoidExpanse was created to have an almost unlimited modding potential. Almost every aspect of game can be modified and extended. There are no hardcoded scripts and in-game log...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;VoidExpanse was created to have an almost unlimited modding potential. Almost every aspect of game can be modified and extended.&lt;br /&gt;
There are no hardcoded scripts and in-game logics, everything you see in VoidExpanse now was created as root mod. This concept is similar to&lt;br /&gt;
early GameBryo versions.&lt;/div&gt;</summary>
		<author><name>Damonwall</name></author>
	</entry>
	<entry>
		<id>https://wiki.atomictorch.com/index.php?title=Main_Page&amp;diff=107</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.atomictorch.com/index.php?title=Main_Page&amp;diff=107"/>
		<updated>2014-02-17T03:36:51Z</updated>

		<summary type="html">&lt;p&gt;Damonwall: /* VoidExpanse */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:AtomicTorchStudioLogoTransparent.png]]&amp;lt;br&amp;gt;Welcome to &#039;&#039;&#039;AtomicTorch Studio&#039;&#039;&#039; wiki!&lt;br /&gt;
&lt;br /&gt;
This wiki is work in progress and is in no way complete. We are only starting adding content here, for now mostly for our own reference. But if you would like to help - feel free to create an account.&lt;br /&gt;
&lt;br /&gt;
= VoidExpanse =&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width:100%&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:34%&amp;quot; | Get the game&lt;br /&gt;
! style=&amp;quot;width:33%&amp;quot; | The game&lt;br /&gt;
! style=&amp;quot;width:33%&amp;quot; | Modding&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;!-- get the game --&amp;gt;&lt;br /&gt;
VoidExpanse is currently in development. You can find all information about the game on the website.&lt;br /&gt;
* [http://atomictorch.com AtomicTorch Studio portal]&lt;br /&gt;
* [http://forums.atomictorch.com Forums]&lt;br /&gt;
| &amp;lt;!-- the game --&amp;gt;&lt;br /&gt;
* [[VoidExpanse/Version History|Version history]]&lt;br /&gt;
* [[VoidExpanse/Ships|Ships]]&lt;br /&gt;
* [[VoidExpanse/Weapons|Weapons]]&lt;br /&gt;
* [[VoidExpanse/Equipment|Equipment]]&lt;br /&gt;
| &amp;lt;!-- modding --&amp;gt;&lt;br /&gt;
* [[VoidExpanse/modding|Modding]]&lt;br /&gt;
* [[VoidExpanse/scripting_api|Scripting]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Editing wiki ==&lt;br /&gt;
* [[:Category:Templates|List of templates]]&lt;/div&gt;</summary>
		<author><name>Damonwall</name></author>
	</entry>
</feed>