Files
avorion-docgen/Documentation/EntityFunctions.html

1236 lines
60 KiB
HTML

<html>
<head>
<title> Avorion Predefined Functions - Entity</title>
<link rel="stylesheet" href="stylesheet.css"/>
<meta charset="utf-8"/>
</head>
<body>
<div class="maincentered">
<div class="maincontent">
<h1 class="documentationheader">Avorion Script API Documentation</h1>
<div class="sitemap">
<div class="headerlisting flexheader">
<div>
<a href="index.html">Home</a>
<a href="Functions.html">Functions</a>
<a href="Search.html">Search</a>
</div>
<div class="flexheaderwhitespace"></div>
<form action="Search.html" method="get">Search:<input name="search" class="headersearchinput" type="search"></form></div></div>
<div class="floatleft">
<div class="codecontainer">
<table>
<tr><td>
<a href="#initialize">initialize</a>
</td></tr>
<tr><td>
<a href="#update">update</a>
</td></tr>
<tr><td>
<a href="#getUpdateInterval">getUpdateInterval</a>
</td></tr>
<tr><td>
<a href="#onRemove">onRemove</a>
</td></tr>
<tr><td>
<a href="#onDelete">onDelete</a>
</td></tr>
<tr><td>
<a href="#secure">secure</a>
</td></tr>
<tr><td>
<a href="#restore">restore</a>
</td></tr>
<tr><td>
<a href="#initUI">initUI</a>
</td></tr>
<tr><td>
<a href="#onInteract">onInteract</a>
</td></tr>
<tr><td>
<a href="#onShowWindow">onShowWindow</a>
</td></tr>
<tr><td>
<a href="#onCloseWindow">onCloseWindow</a>
</td></tr>
<tr><td>
<a href="#updateUI">updateUI</a>
</td></tr>
<tr><td>
<a href="#renderUI">renderUI</a>
</td></tr>
<tr><td>
<a href="#renderUIIndicator">renderUIIndicator</a>
</td></tr>
<tr><td>
<a href="#renderUIPreHud">renderUIPreHud</a>
</td></tr>
<tr><td>
<a href="#renderUIPostHud">renderUIPostHud</a>
</td></tr>
<tr><td>
<a href="#onKeyboardEvent">onKeyboardEvent</a>
</td></tr>
<tr><td>
<a href="#onMouseEvent">onMouseEvent</a>
</td></tr>
<tr><td>
<a href="#interactionPossible">interactionPossible</a>
</td></tr>
<tr><td>
<a href="#updateClient">updateClient</a>
</td></tr>
<tr><td>
<a href="#getIcon">getIcon</a>
</td></tr>
<tr><td>
<a href="#updateServer">updateServer</a>
</td></tr>
<tr><td>
<a href="#isTransferrable">isTransferrable</a>
</td></tr>
<tr><td>
<a href="#canTransfer">canTransfer</a>
</td></tr>
<tr><td>
<a href="#getEnergy">getEnergy</a>
</td></tr>
<tr><td>
<a href="#getEnergy">getEnergy</a>
</td></tr>
<tr><td>
<a href="#updateParallelRead">updateParallelRead</a>
</td></tr>
<tr><td>
<a href="#updateParallelSelf">updateParallelSelf</a>
</td></tr>
<tr><td>
<a href="#onSectorChanged">onSectorChanged</a>
</td></tr>
<tr><td>
<a href="#onIndexChanged">onIndexChanged</a>
</td></tr>
<tr><td>
<a href="#initializationFinished">initializationFinished</a>
</td></tr>
</table>
</div>
</div>
<div class="floatright" id="Entity">
<h1>Entity Script Predefined Functions</h1>
<div class="codecontainer">
<p>Tip: Scroll down for an example script!</p>
</div>
<div id="initialize" class="codecontainer">
<p>
<span class="keyword">function</span> initialize(...) <br/>
</p>
<div id="initialize" class="code">
<p>
This function is always the very first function that is called in a script, and only once during the lifetime of the script. The function is always called on the server first, before client instances are available, so invoking client functions will never work. This function is both called when a script gets newly attached to an object, and when the object is loaded from the database during a load from disk operation. During a load from disk operation, no parameters are passed to the function, and a global variable '_restoring' is set to true.
</p>
<p><span class="parameter">Parameters</span></p>
<div class="indented">
<span class="parameter">...</span>
Parameters that are passed through from the adding of the script. nil if the script was loaded from the database while loading a sector or player or similar. <br/>
</div>
</p>
</div>
</div>
<div id="update" class="codecontainer">
<p>
<span class="keyword">function</span> update(timeStep) <br/>
</p>
<div id="update" class="code">
<p>
Called every tick, both on client and server. See the documentation for getUpdateInterval() for details on the frequency of these calls.
</p>
<p><span class="parameter">Parameters</span></p>
<div class="indented">
<span class="parameter">timeStep</span>
The amount of time passed since the last update tick <br/>
</div>
</p>
</div>
</div>
<div id="getUpdateInterval" class="codecontainer">
<p>
<span class="keyword">function</span> getUpdateInterval() <br/>
</p>
<div id="getUpdateInterval" class="code">
<p>
Defines the update tick interval of the script. This interval can not be less than the update tick interval of the server or client, depending on where the script is running. The update(), updateParallelRead(), updateParallelSelf(), updateClient() and updateServer() functions will only be called after at least this much time has passed. The minimum update interval for the client varies with the framerate of the client. The minimum update interval for the server is 50 ms. This function is called after initialize() or after the update functions were called. If this function is not defined, the update functions will be called every tick.
</p>
<p><span class="docheader">Expected return values</span></p>
<div class="indented">
<p>
The desired update tick interval in seconds
</p>
</div>
</p>
</div>
</div>
<div id="onRemove" class="codecontainer">
<p>
<span class="keyword">function</span> onRemove() <br/>
</p>
<div id="onRemove" class="code">
<p>
Called when the script is about to be removed from the object, before the removal.
</p>
</p>
</div>
</div>
<div id="onDelete" class="codecontainer">
<p>
<span class="keyword">function</span> onDelete() <br/>
</p>
<div id="onDelete" class="code">
<p>
Called when the script is about to be deleted from the object, before the deletion. This is the last call that will be done to an object script. This function is also called when the object it is attached to is deleted.
</p>
</p>
</div>
</div>
<div id="secure" class="codecontainer">
<p>
<span class="keyword">function</span> secure() <br/>
</p>
<div id="secure" class="code">
<p>
Called to secure values from the script. This function is called when the object is unloaded from the server. It's called at other times as well to refresh data, or when objects are copied or during regular saves. The table returned by this function will be passed to the restore() function when the object is loaded and read from disk. All values that are in the table must be numbers, strings or other tables. Values that aren't of the above types will be converted to nil and an error message will be printed.
</p>
<p><span class="docheader">Expected return values</span></p>
<div class="indented">
<p>
A table containing values that should be saved
</p>
</div>
</p>
</div>
</div>
<div id="restore" class="codecontainer">
<p>
<span class="keyword">function</span> restore(values) <br/>
</p>
<div id="restore" class="code">
<p>
Called to restore previously secured values for the script. This is called after initialize(). Receives the values that were gathered from the last called to the secure() function. This function is called when the object is read from disk and restored, after initialize() was called.
</p>
<p><span class="parameter">Parameters</span></p>
<div class="indented">
<span class="parameter">values</span>
The table previously returned by the secure() function <br/>
</div>
</p>
</div>
</div>
<div id="initUI" class="codecontainer">
<p>
<span class="keyword">function</span> initUI() <br/>
</p>
<div id="initUI" class="code">
<p>
This function is called when the game initializes the UI of the script. This function is only called once per script. You should initialize all your UI elements in this function and register all interactions for the entity here as well, so that they will be visible when the player interacts with the entity. <br/><br/><span class="warning">Client Function: This function is only called on the client.</span>
</p>
</p>
</div>
</div>
<div id="onInteract" class="codecontainer">
<p>
<span class="keyword">function</span> onInteract(optionIndex) <br/>
</p>
<div id="onInteract" class="code">
<p>
Executed whenever the player starts interacting with the script, before the registered interaction callback function is executed. <br/><br/><span class="warning">Client Function: This function is only called on the client.</span>
</p>
<p><span class="parameter">Parameters</span></p>
<div class="indented">
<span class="parameter">optionIndex</span>
Index of the option the player chose for interaction <br/>
</div>
</p>
</div>
</div>
<div id="onShowWindow" class="codecontainer">
<p>
<span class="keyword">function</span> onShowWindow(optionIndex) <br/>
</p>
<div id="onShowWindow" class="code">
<p>
Executed when the player starts interacting with the script and the registered window is shown. <br/><br/><span class="warning">Client Function: This function is only called on the client.</span>
</p>
<p><span class="parameter">Parameters</span></p>
<div class="indented">
<span class="parameter">optionIndex</span>
Index of the option the player chose for interaction <br/>
</div>
</p>
</div>
</div>
<div id="onCloseWindow" class="codecontainer">
<p>
<span class="keyword">function</span> onCloseWindow(optionIndex) <br/>
</p>
<div id="onCloseWindow" class="code">
<p>
Executed when the player stops interacting with the script or closes the main window for the specific interaction. <br/><br/><span class="warning">Client Function: This function is only called on the client.</span>
</p>
<p><span class="parameter">Parameters</span></p>
<div class="indented">
<span class="parameter">optionIndex</span>
Index of the option the player chose for interaction <br/>
</div>
</p>
</div>
</div>
<div id="updateUI" class="codecontainer">
<p>
<span class="keyword">function</span> updateUI() <br/>
</p>
<div id="updateUI" class="code">
<p>
Executed every tick while the player is interacting with the script. This function is expensive, so only define it if you need your script to be updated every tick. <br/><br/><span class="warning">Client Function: This function is only called on the client.</span>
</p>
</p>
</div>
</div>
<div id="renderUI" class="codecontainer">
<p>
<span class="keyword">function</span> renderUI() <br/>
</p>
<div id="renderUI" class="code">
<p>
Executed every tick while the player is interacting with the script. During this function, render calls are valid and can be done. All render calls from this function will be drawn over the current window. This function is expensive, so only define it if you need it. <br/><br/><span class="warning">Client Function: This function is only called on the client.</span>
</p>
</p>
</div>
</div>
<div id="renderUIIndicator" class="codecontainer">
<p>
<span class="keyword">function</span> renderUIIndicator(x, y, size) <br/>
</p>
<div id="renderUIIndicator" class="code">
<p>
Executed every tick if the entity is selected by the player. During this function, render calls are valid and can be done. All render calls from this function will be drawn on the same 2D plane as other UI indicators. This function is expensive, so only define it if you need it. <br/><br/><span class="warning">Client Function: This function is only called on the client.</span>
</p>
<p><span class="parameter">Parameters</span></p>
<div class="indented">
<span class="parameter">x</span>
The x position of the target indicator <br/>
<span class="parameter">y</span>
The y position of the target indicator <br/>
<span class="parameter">size</span>
The size of the target indicator <br/>
</div>
</p>
</div>
</div>
<div id="renderUIPreHud" class="codecontainer">
<p>
<span class="keyword">function</span> renderUIPreHud() <br/>
</p>
<div id="renderUIPreHud" class="code">
<p>
Executed every tick. During this function, render calls are valid and can be done. All render calls from this function will be drawn below the main HUD. This function is expensive, so only define it if you need it. <br/><br/><span class="warning">Client Function: This function is only called on the client.</span>
</p>
</p>
</div>
</div>
<div id="renderUIPostHud" class="codecontainer">
<p>
<span class="keyword">function</span> renderUIPostHud() <br/>
</p>
<div id="renderUIPostHud" class="code">
<p>
Executed every tick. During this function, render calls are valid and can be done. All render calls from this function will be drawn over the main HUD. This function is expensive, so only define it if you need it. <br/><br/><span class="warning">Client Function: This function is only called on the client.</span>
</p>
</p>
</div>
</div>
<div id="onKeyboardEvent" class="codecontainer">
<p>
<span class="keyword">function</span> onKeyboardEvent(key, pressed) <br/>
</p>
<div id="onKeyboardEvent" class="code">
<p>
Executed whenever a keyboard event is sent to the script. Keyboard events might be caught by other active menus first. If this function returns true then the event will be interpreted as used and won't be sent to any other menus. <br/><br/><span class="warning">Client Function: This function is only called on the client.</span>
</p>
<p><span class="parameter">Parameters</span></p>
<div class="indented">
<span class="parameter">key</span>
The key that was pressed or released <br/>
<span class="parameter">pressed</span>
A boolean indicating whether the key was pushed down or not <br/>
</div>
<p><span class="docheader">Expected return values</span></p>
<div class="indented">
<p>
Return true to indicate that the event was used by this script
</p>
</div>
</p>
</div>
</div>
<div id="onMouseEvent" class="codecontainer">
<p>
<span class="keyword">function</span> onMouseEvent(key, pressed, x, y) <br/>
</p>
<div id="onMouseEvent" class="code">
<p>
Executed whenever a mouse event is sent to the script. Mouse events might be caught by other active menus first. If this function returns true then the event will be interpreted as used and won't be sent to any other menus. <br/><br/><span class="warning">Client Function: This function is only called on the client.</span>
</p>
<p><span class="parameter">Parameters</span></p>
<div class="indented">
<span class="parameter">key</span>
The key that was pressed or released <br/>
<span class="parameter">pressed</span>
A boolean indicating whether the key was pushed down or not <br/>
<span class="parameter">x</span>
The x position of the mouse cursor <br/>
<span class="parameter">y</span>
The y position of the mouse cursor <br/>
</div>
<p><span class="docheader">Expected return values</span></p>
<div class="indented">
<p>
Return true to indicate that the event was used by this script
</p>
</div>
</p>
</div>
</div>
<div id="interactionPossible" class="codecontainer">
<p>
<span class="keyword">function</span> interactionPossible(playerIndex, optionIndex) <br/>
</p>
<div id="interactionPossible" class="code">
<p>
Determines whether or not the entity can be interacted with. If no values are returned or the function isn't defined, interaction will be deemed not possible. The game checks for general interaction possibilities sometimes, for example when a player selects a station, to show the "Press F to interact" text. If a non-empty error message is returned, the result will be interpreted as "failed", even if the first value was true. <br/><br/><span class="warning">Client Function: This function is only called on the client.</span>
</p>
<p><span class="parameter">Parameters</span></p>
<div class="indented">
<span class="parameter">playerIndex</span>
The index of the player that is trying to interact <br/>
<span class="parameter">optionIndex</span>
The index of the specific registered interaction option that is being chosen. nil if only a general query for interaction is done. <br/>
</div>
<p><span class="docheader">Expected return values</span></p>
<div class="indented">
<p>
A boolean indicating whether the interaction is possible and if not, an optional error message as string that says why the interaction failed
</p>
</div>
</p>
</div>
</div>
<div id="updateClient" class="codecontainer">
<p>
<span class="keyword">function</span> updateClient(timeStep) <br/>
</p>
<div id="updateClient" class="code">
<p>
Update tick that is only executed on the client. See the documentation for getUpdateInterval() for details on the frequency of these calls. Execution order of the updateXXX() functions is: updateParallelRead(), updateParallelSelf(), update(), update[Server/Client](). <br/><br/><span class="warning">Client Function: This function is only called on the client.</span>
</p>
<p><span class="parameter">Parameters</span></p>
<div class="indented">
<span class="parameter">timeStep</span>
The amount of time that passed since the last update tick <br/>
</div>
</p>
</div>
</div>
<div id="getIcon" class="codecontainer">
<p>
<span class="keyword">function</span> getIcon() <br/>
</p>
<div id="getIcon" class="code">
<p>
A function that is used by the UI to get the icon that will be used for the script interaction button on the top right of the screen. This function should return a string containing the path to the icon (example: "data/textures/icons/jigsaw-piece.png"). If this function isn't defined, or if nothing or empty string is returned, the displayed icon will be a placeholder icon. This function will only be called if the interactionPossible(...) test didn't fail. <br/><br/><span class="warning">Client Function: This function is only called on the client.</span>
</p>
<p><span class="docheader">Expected return values</span></p>
<div class="indented">
<p>
A string containing the path to the icon
</p>
</div>
</p>
</div>
</div>
<div id="updateServer" class="codecontainer">
<p>
<span class="keyword">function</span> updateServer(timeStep) <br/>
</p>
<div id="updateServer" class="code">
<p>
Update tick that is only executed on the server. See the documentation for getUpdateInterval() for details on the frequency of these calls. Execution order of the updateXXX() functions is: updateParallelRead(), updateParallelSelf(), update(), update[Server/Client](). <br/><br/><span class="warning">Server Function: This function is only called on the server.</span>
</p>
<p><span class="parameter">Parameters</span></p>
<div class="indented">
<span class="parameter">timeStep</span>
The amount of time that passed since the last update tick <br/>
</div>
</p>
</div>
</div>
<div id="isTransferrable" class="codecontainer">
<p>
<span class="keyword">function</span> isTransferrable(id, x, y) <br/>
</p>
<div id="isTransferrable" class="code">
<p>
Executed when the entity enters an area that triggers a sector transfer (ie. gate, wormhole). This should return a boolean value that indicates whether the entity can be transferred to the other sector or not. If any script that is attached to the entity and that implements this function returns false, the transfer fails and the entity won't be transferred. If a script doesn't implement this function, the value is interpreted as true. <br/><br/><span class="warning">Server Function: This function is only called on the server.</span>
</p>
<p><span class="parameter">Parameters</span></p>
<div class="indented">
<span class="parameter">id</span>
The id of the entity responsible for the transfer (ie. the gate or wormhole) <br/>
<span class="parameter">x</span>
The x coordinate of the target sector <br/>
<span class="parameter">y</span>
The y coordinate of the target sector <br/>
</div>
<p><span class="docheader">Expected return values</span></p>
<div class="indented">
<p>
A boolean whether or not the entity is allowed to transfer
</p>
</div>
</p>
</div>
</div>
<div id="canTransfer" class="codecontainer">
<p>
<span class="keyword">function</span> canTransfer(id) <br/>
</p>
<div id="canTransfer" class="code">
<p>
Executed if the entity has an EntityTransferrer component and when an entity enters the area that triggers a sector transfer. This should return a boolean value that indicates whether the entity can be transferred to the other sector or not. If any script that is attached to the entity and that implements this function returns false, the transfer fails and the entity won't be transferred. If a script doesn't implement this function, the value is interpreted as true. <br/><br/><span class="warning">Server Function: This function is only called on the server.</span>
</p>
<p><span class="parameter">Parameters</span></p>
<div class="indented">
<span class="parameter">id</span>
The id of the entity that entered the transfer area <br/>
</div>
<p><span class="docheader">Expected return values</span></p>
<div class="indented">
<p>
A boolean whether or not the entity is allowed to transfer
</p>
</div>
</p>
</div>
</div>
<div id="getEnergy" class="codecontainer">
<p>
<span class="keyword">function</span> getEnergy(seed, rarity, permanent) <br/>
</p>
<div id="getEnergy" class="code">
<p>
Used to gather the energy requirements of a system upgrade. The returned value must be in Watts.
</p>
<p><span class="parameter">Parameters</span></p>
<div class="indented">
<span class="parameter">seed</span>
The seed of the upgrade <br/>
<span class="parameter">rarity</span>
The rarity of the upgrade <br/>
<span class="parameter">permanent</span>
A bool indicating whether or not the upgrade was installed permanently <br/>
</div>
<p><span class="docheader">Expected return values</span></p>
<div class="indented">
<p>
The amount of currently required energy, in Watts.
</p>
</div>
</p>
</div>
</div>
<div id="getEnergy" class="codecontainer">
<p>
<span class="keyword">function</span> getEnergy(seed, rarity, permanent) <br/>
</p>
<div id="getEnergy" class="code">
<p>
Used to gather the energy requirements of a system upgrade. The returned value must be in Watts.
</p>
<p><span class="parameter">Parameters</span></p>
<div class="indented">
<span class="parameter">seed</span>
The seed of the upgrade <br/>
<span class="parameter">rarity</span>
The rarity of the upgrade <br/>
<span class="parameter">permanent</span>
A bool indicating whether or not the upgrade was installed permanently <br/>
</div>
<p><span class="docheader">Expected return values</span></p>
<div class="indented">
<p>
The amount of currently required energy, in Watts.
</p>
</div>
</p>
</div>
</div>
<div id="updateParallelRead" class="codecontainer">
<p>
<span class="keyword">function</span> updateParallelRead(timeStep) <br/>
</p>
<div id="updateParallelRead" class="code">
<p>
Called every tick, both on client and server. See the documentation for getUpdateInterval() for details on the frequency of these calls. This function is executed in parallel with other entities, but not other scripts of the same entity. During this function, only reading values from the sector and its entities is allowed. Execution order of the updateXXX() functions is: updateParallelRead(), updateParallelSelf(), update(), update[Server/Client]()
</p>
<p><span class="parameter">Parameters</span></p>
<div class="indented">
<span class="parameter">timeStep</span>
The amount of time passed since the last update tick <br/>
</div>
</p>
</div>
</div>
<div id="updateParallelSelf" class="codecontainer">
<p>
<span class="keyword">function</span> updateParallelSelf(timeStep) <br/>
</p>
<div id="updateParallelSelf" class="code">
<p>
Called every tick, both on client and server. See the documentation for getUpdateInterval() for details on the frequency of these calls. This function is executed in parallel with other entities, but not other scripts of the same entity. During this function, only modifying the own entity is allowed, access to other entities in the sector is prohibited. Execution order of the updateXXX() functions is: updateParallelRead(), updateParallelSelf(), update(), update[Server/Client]()
</p>
<p><span class="parameter">Parameters</span></p>
<div class="indented">
<span class="parameter">timeStep</span>
The amount of time passed since the last update tick <br/>
</div>
</p>
</div>
</div>
<div id="onSectorChanged" class="codecontainer">
<p>
<span class="keyword">function</span> onSectorChanged() <br/>
</p>
<div id="onSectorChanged" class="code">
<p>
Executed whenever the entity changes sectors or when first inserted into a sector, for example while loading a sector or when the entity is first created.
</p>
</p>
</div>
</div>
<div id="onIndexChanged" class="codecontainer">
<p>
<span class="keyword">function</span> onIndexChanged(old, id) <br/>
</p>
<div id="onIndexChanged" class="code">
<p>
Executed whenever the entity id changes, after the change took place. This happens *very* rarely and only when a database corruption was detected.
</p>
<p><span class="parameter">Parameters</span></p>
<div class="indented">
<span class="parameter">old</span>
The old id of the entity <br/>
<span class="parameter">id</span>
The new id of the entity <br/>
</div>
</p>
</div>
</div>
<div id="initializationFinished" class="codecontainer">
<p>
<span class="keyword">function</span> initializationFinished() <br/>
</p>
<div id="initializationFinished" class="code">
<p>
Executed when a sector was loaded entirely and is ready. This function is called on the client after a new sector was received and once it has been completely created and initialized. On the server, this function is called after a sector was generated or loaded from disk and once it has been completely initialized. The function is also called on every Entity that is added to an existing, initialized sector, once it can access all other entities. Use this function if you need to access other Entity objects or the Sector object during initialization, since they may not be available in the initialize() call.
</p>
</p>
</div>
</div>
<h2><br/>Entity Example Script</h2>
<div class="codecontainer">
<code>
<span class="comment">-- This function is always the very first function that is called in a script, and only once during </span><br/>
<span class="comment">-- the lifetime of the script. The function is always called on the server first, before client </span><br/>
<span class="comment">-- instances are available, so invoking client functions will never work. This function is both </span><br/>
<span class="comment">-- called when a script gets newly attached to an object, and when the object is loaded from the </span><br/>
<span class="comment">-- database during a load from disk operation. During a load from disk operation, no parameters </span><br/>
<span class="comment">-- are passed to the function, and a global variable '_restoring' is set to true. </span><br/>
<span class="keyword">function</span> initialize(...)<br/>
<br/>
<span class="keyword">end</span><br/>
<br/><span class="comment">-- Called every tick, both on client and server. See the documentation for getUpdateInterval() </span><br/>
<span class="comment">-- for details on the frequency of these calls. </span><br/>
<span class="keyword">function</span> update(timeStep)<br/>
<br/>
<span class="keyword">end</span><br/>
<br/><span class="comment">-- Defines the update tick interval of the script. This interval can not be less than the update </span><br/>
<span class="comment">-- tick interval of the server or client, depending on where the script is running. The update(), </span><br/>
<span class="comment">-- updateParallelRead(), updateParallelSelf(), updateClient() and updateServer() functions will </span><br/>
<span class="comment">-- only be called after at least this much time has passed. The minimum update interval for the </span><br/>
<span class="comment">-- client varies with the framerate of the client. The minimum update interval for the server </span><br/>
<span class="comment">-- is 50 ms. This function is called after initialize() or after the update functions were called. </span><br/>
<span class="comment">-- If this function is not defined, the update functions will be called every tick. </span><br/>
<span class="keyword">function</span> getUpdateInterval()<br/>
<br/>
<span class="keyword">end</span><br/>
<br/><span class="comment">-- Called when the script is about to be removed from the object, before the removal. </span><br/>
<span class="keyword">function</span> onRemove()<br/>
<br/>
<span class="keyword">end</span><br/>
<br/><span class="comment">-- Called when the script is about to be deleted from the object, before the deletion. This is </span><br/>
<span class="comment">-- the last call that will be done to an object script. This function is also called when the </span><br/>
<span class="comment">-- object it is attached to is deleted. </span><br/>
<span class="keyword">function</span> onDelete()<br/>
<br/>
<span class="keyword">end</span><br/>
<br/><span class="comment">-- Called to secure values from the script. This function is called when the object is unloaded </span><br/>
<span class="comment">-- from the server. It's called at other times as well to refresh data, or when objects are copied </span><br/>
<span class="comment">-- or during regular saves. The table returned by this function will be passed to the restore() </span><br/>
<span class="comment">-- function when the object is loaded and read from disk. All values that are in the table must </span><br/>
<span class="comment">-- be numbers, strings or other tables. Values that aren't of the above types will be converted </span><br/>
<span class="comment">-- to nil and an error message will be printed. </span><br/>
<span class="keyword">function</span> secure()<br/>
<br/>
<span class="keyword">end</span><br/>
<br/><span class="comment">-- Called to restore previously secured values for the script. This is called after initialize(). </span><br/>
<span class="comment">-- Receives the values that were gathered from the last called to the secure() function. This </span><br/>
<span class="comment">-- function is called when the object is read from disk and restored, after initialize() was called. </span><br/>
<span class="keyword">function</span> restore(values)<br/>
<br/>
<span class="keyword">end</span><br/>
<br/><span class="comment">-- This function is called when the game initializes the UI of the script. This function is only </span><br/>
<span class="comment">-- called once per script. You should initialize all your UI elements in this function and register </span><br/>
<span class="comment">-- all interactions for the entity here as well, so that they will be visible when the player </span><br/>
<span class="comment">-- interacts with the entity. </span><br/>
<span class="comment">-- Client Function: This function is only called on the client.</span><br/>
<span class="keyword">function</span> initUI()<br/>
<br/>
<span class="keyword">end</span><br/>
<br/><span class="comment">-- Executed whenever the player starts interacting with the script, before the registered interaction </span><br/>
<span class="comment">-- callback function is executed. </span><br/>
<span class="comment">-- Client Function: This function is only called on the client.</span><br/>
<span class="keyword">function</span> onInteract(optionIndex)<br/>
<br/>
<span class="keyword">end</span><br/>
<br/><span class="comment">-- Executed when the player starts interacting with the script and the registered window is shown. </span><br/>
<span class="comment">-- Client Function: This function is only called on the client.</span><br/>
<span class="keyword">function</span> onShowWindow(optionIndex)<br/>
<br/>
<span class="keyword">end</span><br/>
<br/><span class="comment">-- Executed when the player stops interacting with the script or closes the main window for the </span><br/>
<span class="comment">-- specific interaction. </span><br/>
<span class="comment">-- Client Function: This function is only called on the client.</span><br/>
<span class="keyword">function</span> onCloseWindow(optionIndex)<br/>
<br/>
<span class="keyword">end</span><br/>
<br/><span class="comment">-- Executed every tick while the player is interacting with the script. This function is expensive, </span><br/>
<span class="comment">-- so only define it if you need your script to be updated every tick. </span><br/>
<span class="comment">-- Client Function: This function is only called on the client.</span><br/>
<span class="keyword">function</span> updateUI()<br/>
<br/>
<span class="keyword">end</span><br/>
<br/><span class="comment">-- Executed every tick while the player is interacting with the script. During this function, </span><br/>
<span class="comment">-- render calls are valid and can be done. All render calls from this function will be drawn over </span><br/>
<span class="comment">-- the current window. This function is expensive, so only define it if you need it. </span><br/>
<span class="comment">-- Client Function: This function is only called on the client.</span><br/>
<span class="keyword">function</span> renderUI()<br/>
<br/>
<span class="keyword">end</span><br/>
<br/><span class="comment">-- Executed every tick if the entity is selected by the player. During this function, render calls </span><br/>
<span class="comment">-- are valid and can be done. All render calls from this function will be drawn on the same 2D </span><br/>
<span class="comment">-- plane as other UI indicators. This function is expensive, so only define it if you need it. </span><br/>
<span class="comment">-- Client Function: This function is only called on the client.</span><br/>
<span class="keyword">function</span> renderUIIndicator(x, y, size)<br/>
<br/>
<span class="keyword">end</span><br/>
<br/><span class="comment">-- Executed every tick. During this function, render calls are valid and can be done. All render </span><br/>
<span class="comment">-- calls from this function will be drawn below the main HUD. This function is expensive, so only </span><br/>
<span class="comment">-- define it if you need it. </span><br/>
<span class="comment">-- Client Function: This function is only called on the client.</span><br/>
<span class="keyword">function</span> renderUIPreHud()<br/>
<br/>
<span class="keyword">end</span><br/>
<br/><span class="comment">-- Executed every tick. During this function, render calls are valid and can be done. All render </span><br/>
<span class="comment">-- calls from this function will be drawn over the main HUD. This function is expensive, so only </span><br/>
<span class="comment">-- define it if you need it. </span><br/>
<span class="comment">-- Client Function: This function is only called on the client.</span><br/>
<span class="keyword">function</span> renderUIPostHud()<br/>
<br/>
<span class="keyword">end</span><br/>
<br/><span class="comment">-- Executed whenever a keyboard event is sent to the script. Keyboard events might be caught by </span><br/>
<span class="comment">-- other active menus first. If this function returns true then the event will be interpreted </span><br/>
<span class="comment">-- as used and won't be sent to any other menus. </span><br/>
<span class="comment">-- Client Function: This function is only called on the client.</span><br/>
<span class="keyword">function</span> onKeyboardEvent(key, pressed)<br/>
<br/>
<span class="keyword">end</span><br/>
<br/><span class="comment">-- Executed whenever a mouse event is sent to the script. Mouse events might be caught by other </span><br/>
<span class="comment">-- active menus first. If this function returns true then the event will be interpreted as used </span><br/>
<span class="comment">-- and won't be sent to any other menus. </span><br/>
<span class="comment">-- Client Function: This function is only called on the client.</span><br/>
<span class="keyword">function</span> onMouseEvent(key, pressed, x, y)<br/>
<br/>
<span class="keyword">end</span><br/>
<br/><span class="comment">-- Determines whether or not the entity can be interacted with. If no values are returned or the </span><br/>
<span class="comment">-- function isn't defined, interaction will be deemed not possible. The game checks for general </span><br/>
<span class="comment">-- interaction possibilities sometimes, for example when a player selects a station, to show the </span><br/>
<span class="comment">-- "Press F to interact" text. If a non-empty error message is returned, the result will be interpreted </span><br/>
<span class="comment">-- as "failed", even if the first value was true. </span><br/>
<span class="comment">-- Client Function: This function is only called on the client.</span><br/>
<span class="keyword">function</span> interactionPossible(playerIndex, optionIndex)<br/>
<br/>
<span class="keyword">end</span><br/>
<br/><span class="comment">-- Update tick that is only executed on the client. See the documentation for getUpdateInterval() </span><br/>
<span class="comment">-- for details on the frequency of these calls. Execution order of the updateXXX() functions is: </span><br/>
<span class="comment">-- updateParallelRead(), updateParallelSelf(), update(), update[Server/Client](). </span><br/>
<span class="comment">-- Client Function: This function is only called on the client.</span><br/>
<span class="keyword">function</span> updateClient(timeStep)<br/>
<br/>
<span class="keyword">end</span><br/>
<br/><span class="comment">-- A function that is used by the UI to get the icon that will be used for the script interaction </span><br/>
<span class="comment">-- button on the top right of the screen. This function should return a string containing the </span><br/>
<span class="comment">-- path to the icon (example: "data/textures/icons/jigsaw-piece.png"). If this function isn't </span><br/>
<span class="comment">-- defined, or if nothing or empty string is returned, the displayed icon will be a placeholder </span><br/>
<span class="comment">-- icon. This function will only be called if the interactionPossible(...) test didn't fail. </span><br/>
<span class="comment">-- Client Function: This function is only called on the client.</span><br/>
<span class="keyword">function</span> getIcon()<br/>
<br/>
<span class="keyword">end</span><br/>
<br/><span class="comment">-- Update tick that is only executed on the server. See the documentation for getUpdateInterval() </span><br/>
<span class="comment">-- for details on the frequency of these calls. Execution order of the updateXXX() functions is: </span><br/>
<span class="comment">-- updateParallelRead(), updateParallelSelf(), update(), update[Server/Client](). </span><br/>
<span class="comment">-- Server Function: This function is only called on the server.</span><br/>
<span class="keyword">function</span> updateServer(timeStep)<br/>
<br/>
<span class="keyword">end</span><br/>
<br/><span class="comment">-- Executed when the entity enters an area that triggers a sector transfer (ie. gate, wormhole). </span><br/>
<span class="comment">-- This should return a boolean value that indicates whether the entity can be transferred to </span><br/>
<span class="comment">-- the other sector or not. If any script that is attached to the entity and that implements this </span><br/>
<span class="comment">-- function returns false, the transfer fails and the entity won't be transferred. If a script </span><br/>
<span class="comment">-- doesn't implement this function, the value is interpreted as true. </span><br/>
<span class="comment">-- Server Function: This function is only called on the server.</span><br/>
<span class="keyword">function</span> isTransferrable(id, x, y)<br/>
<br/>
<span class="keyword">end</span><br/>
<br/><span class="comment">-- Executed if the entity has an EntityTransferrer component and when an entity enters the area </span><br/>
<span class="comment">-- that triggers a sector transfer. This should return a boolean value that indicates whether </span><br/>
<span class="comment">-- the entity can be transferred to the other sector or not. If any script that is attached to </span><br/>
<span class="comment">-- the entity and that implements this function returns false, the transfer fails and the entity </span><br/>
<span class="comment">-- won't be transferred. If a script doesn't implement this function, the value is interpreted </span><br/>
<span class="comment">-- as true. </span><br/>
<span class="comment">-- Server Function: This function is only called on the server.</span><br/>
<span class="keyword">function</span> canTransfer(id)<br/>
<br/>
<span class="keyword">end</span><br/>
<br/><span class="comment">-- Used to gather the energy requirements of a system upgrade. The returned value must be in Watts. </span><br/>
<span class="keyword">function</span> getEnergy(seed, rarity, permanent)<br/>
<br/>
<span class="keyword">end</span><br/>
<br/><span class="comment">-- Used to gather the energy requirements of a system upgrade. The returned value must be in Watts. </span><br/>
<span class="keyword">function</span> getEnergy(seed, rarity, permanent)<br/>
<br/>
<span class="keyword">end</span><br/>
<br/><span class="comment">-- Called every tick, both on client and server. See the documentation for getUpdateInterval() </span><br/>
<span class="comment">-- for details on the frequency of these calls. This function is executed in parallel with other </span><br/>
<span class="comment">-- entities, but not other scripts of the same entity. During this function, only reading values </span><br/>
<span class="comment">-- from the sector and its entities is allowed. Execution order of the updateXXX() functions is: </span><br/>
<span class="comment">-- updateParallelRead(), updateParallelSelf(), update(), update[Server/Client]() </span><br/>
<span class="keyword">function</span> updateParallelRead(timeStep)<br/>
<br/>
<span class="keyword">end</span><br/>
<br/><span class="comment">-- Called every tick, both on client and server. See the documentation for getUpdateInterval() </span><br/>
<span class="comment">-- for details on the frequency of these calls. This function is executed in parallel with other </span><br/>
<span class="comment">-- entities, but not other scripts of the same entity. During this function, only modifying the </span><br/>
<span class="comment">-- own entity is allowed, access to other entities in the sector is prohibited. Execution order </span><br/>
<span class="comment">-- of the updateXXX() functions is: updateParallelRead(), updateParallelSelf(), update(), update[Server/Client]() </span><br/>
<span class="keyword">function</span> updateParallelSelf(timeStep)<br/>
<br/>
<span class="keyword">end</span><br/>
<br/><span class="comment">-- Executed whenever the entity changes sectors or when first inserted into a sector, for example </span><br/>
<span class="comment">-- while loading a sector or when the entity is first created. </span><br/>
<span class="keyword">function</span> onSectorChanged()<br/>
<br/>
<span class="keyword">end</span><br/>
<br/><span class="comment">-- Executed whenever the entity id changes, after the change took place. This happens *very* rarely </span><br/>
<span class="comment">-- and only when a database corruption was detected. </span><br/>
<span class="keyword">function</span> onIndexChanged(old, id)<br/>
<br/>
<span class="keyword">end</span><br/>
<br/><span class="comment">-- Executed when a sector was loaded entirely and is ready. This function is called on the client </span><br/>
<span class="comment">-- after a new sector was received and once it has been completely created and initialized. On </span><br/>
<span class="comment">-- the server, this function is called after a sector was generated or loaded from disk and once </span><br/>
<span class="comment">-- it has been completely initialized. The function is also called on every Entity that is added </span><br/>
<span class="comment">-- to an existing, initialized sector, once it can access all other entities. Use this function </span><br/>
<span class="comment">-- if you need to access other Entity objects or the Sector object during initialization, since </span><br/>
<span class="comment">-- they may not be available in the initialize() call. </span><br/>
<span class="keyword">function</span> initializationFinished()<br/>
<br/>
<span class="keyword">end</span><br/>
</code>
</div>
</div>
</div>
<div class="sitemap">
<div class="flexheader"> <div class="headerlisting">
<span class="docheader">Overview</span>
<br> <a href="index.html">Home</a>
<a href="Functions.html">Functions</a>
<a href="Search.html">Search</a>
</div> <div class="flexheaderwhitespace"></div>
<form action="Search.html" method="get"> Search:<input name="search" class="headersearchinput" type="search"> </form></div><div class="headerlisting">
<span class="docheader">Callbacks</span>
<br><a href="Callbacks.html"> Callbacks</a>
<a href="Alliance [Client] Callbacks.html">Alliance [Client] Callbacks</a>
<a href="Alliance [Server] Callbacks.html">Alliance [Server] Callbacks</a>
<a href="Alliance [Server] Callbacks.html">Alliance [Server] Callbacks</a>
<a href="Entity Callbacks.html">Entity Callbacks</a>
<a href="Galaxy Callbacks.html">Galaxy Callbacks</a>
<a href="Player Callbacks.html">Player Callbacks</a>
<a href="Player [Client] Callbacks.html">Player [Client] Callbacks</a>
<a href="Sector Callbacks.html">Sector Callbacks</a>
<a href="Server Callbacks.html">Server Callbacks</a>
</div><div class="headerlisting">
<span class="docheader">Predefined Functions & Example Scripts</span>
<br><a href="CommandFunctions.html">Command</a>
<a href="EntityFunctions.html">Entity</a>
<a href="FactionDatabaseFunctions.html">FactionDatabase</a>
<a href="PlanGeneratorFunctions.html">PlanGenerator</a>
<a href="PlayerFunctions.html">Player</a>
<a href="SectorFunctions.html">Sector</a>
<a href="ServerFunctions.html">Server</a>
<a href="UsableInventoryItemFunctions.html">UsableInventoryItem</a>
</div><div class="headerlisting">
<span class="docheader">Common Components</span>
<br><a href="Boarding.html">Boarding</a>
<a href="BspTree.html">BspTree</a>
<a href="CargoBay.html">CargoBay</a>
<a href="CargoLoot.html">CargoLoot</a>
<a href="ControlUnit.html">ControlUnit</a>
<a href="CrewComponent.html">CrewComponent</a>
<a href="DeletionTimer.html">DeletionTimer</a>
<a href="DirectFlightPhysics.html">DirectFlightPhysics</a>
<a href="DockingClamps.html">DockingClamps</a>
<a href="DockingParent.html">DockingParent</a>
<a href="DockingPositions.html">DockingPositions</a>
<a href="Durability.html">Durability</a>
<a href="EnergySystem.html">EnergySystem</a>
<a href="Engine.html">Engine</a>
<a href="FighterAI.html">FighterAI</a>
<a href="Hangar.html">Hangar</a>
<a href="HyperspaceEngine.html">HyperspaceEngine</a>
<a href="InteractionText.html">InteractionText</a>
<a href="InventoryItemLoot.html">InventoryItemLoot</a>
<a href="Owner.html">Owner</a>
<a href="Physics.html">Physics</a>
<a href="Plan.html">Plan</a>
<a href="ReadOnlyBoarding.html">ReadOnlyBoarding</a>
<a href="ReadOnlyBspTree.html">ReadOnlyBspTree</a>
<a href="ReadOnlyCargoBay.html">ReadOnlyCargoBay</a>
<a href="ReadOnlyControlUnit.html">ReadOnlyControlUnit</a>
<a href="ReadOnlyCrew.html">ReadOnlyCrew</a>
<a href="ReadOnlyDeletionTimer.html">ReadOnlyDeletionTimer</a>
<a href="ReadOnlyEnergySystem.html">ReadOnlyEnergySystem</a>
<a href="ReadOnlyEngine.html">ReadOnlyEngine</a>
<a href="ReadOnlyFighterAI.html">ReadOnlyFighterAI</a>
<a href="ReadOnlyHangar.html">ReadOnlyHangar</a>
<a href="ReadOnlyHyperspaceEngine.html">ReadOnlyHyperspaceEngine</a>
<a href="ReadOnlyInteractionText.html">ReadOnlyInteractionText</a>
<a href="ReadOnlyOwner.html">ReadOnlyOwner</a>
<a href="ReadOnlyPhysics.html">ReadOnlyPhysics</a>
<a href="ReadOnlyPlan.html">ReadOnlyPlan</a>
<a href="ReadOnlyShipAI.html">ReadOnlyShipAI</a>
<a href="ReadOnlyShipSystem.html">ReadOnlyShipSystem</a>
<a href="ReadOnlyTorpedoAI [Server] [Client] [Server] [Client].html">ReadOnlyTorpedoAI [Server] [Client] [Server] [Client]</a>
<a href="ReadOnlyTorpedoAI [Server] [Client] [Server] [Client].html">ReadOnlyTorpedoAI [Server] [Client] [Server] [Client]</a>
<a href="ReadOnlyTorpedoLauncher.html">ReadOnlyTorpedoLauncher</a>
<a href="ReadOnlyTurretBases.html">ReadOnlyTurretBases</a>
<a href="ReadOnlyVelocity.html">ReadOnlyVelocity</a>
<a href="ReadOnlyWeapons.html">ReadOnlyWeapons</a>
<a href="ReadOnlyWormHole.html">ReadOnlyWormHole</a>
<a href="Shield.html">Shield</a>
<a href="ShipAI.html">ShipAI</a>
<a href="ShipSystem.html">ShipSystem</a>
<a href="StructuralIntegrity.html">StructuralIntegrity</a>
<a href="SystemUpgradeLoot.html">SystemUpgradeLoot</a>
<a href="Thrusters.html">Thrusters</a>
<a href="Torpedo.html">Torpedo</a>
<a href="TorpedoAI.html">TorpedoAI</a>
<a href="TorpedoLauncher.html">TorpedoLauncher</a>
<a href="Turret.html">Turret</a>
<a href="TurretAI.html">TurretAI</a>
<a href="TurretBases.html">TurretBases</a>
<a href="Velocity.html">Velocity</a>
<a href="Weapons.html">Weapons</a>
<a href="WormHole.html">WormHole</a>
</div><div class="headerlisting">
<span class="docheader">Common Objects</span>
<br><a href="AllianceMember.html">AllianceMember</a>
<a href="AllianceRank.html">AllianceRank</a>
<a href="BlockPlan.html">BlockPlan</a>
<a href="BlockPlanBlock.html">BlockPlanBlock</a>
<a href="BlockStatistics.html">BlockStatistics</a>
<a href="Box.html">Box</a>
<a href="Captain.html">Captain</a>
<a href="Color.html">Color</a>
<a href="ControlUnitSeat.html">ControlUnitSeat</a>
<a href="CraftDesign.html">CraftDesign</a>
<a href="CraftStatsOverview.html">CraftStatsOverview</a>
<a href="Crew.html">Crew</a>
<a href="CrewMan.html">CrewMan</a>
<a href="CrewProfession.html">CrewProfession</a>
<a href="DebugInfo.html">DebugInfo</a>
<a href="dvec2.html">dvec2</a>
<a href="dvec3.html">dvec3</a>
<a href="dvec4.html">dvec4</a>
<a href="Entity.html">Entity</a>
<a href="EntityDescriptor.html">EntityDescriptor</a>
<a href="FighterTemplate.html">FighterTemplate</a>
<a href="Format.html">Format</a>
<a href="GameSettings.html">GameSettings</a>
<a href="Group.html">Group</a>
<a href="HighResolutionTimer.html">HighResolutionTimer</a>
<a href="Inventory.html">Inventory</a>
<a href="InventoryTurret.html">InventoryTurret</a>
<a href="ivec2.html">ivec2</a>
<a href="ivec3.html">ivec3</a>
<a href="ivec4.html">ivec4</a>
<a href="Language.html">Language</a>
<a href="Mail.html">Mail</a>
<a href="Material.html">Material</a>
<a href="Matrix.html">Matrix</a>
<a href="ModManager.html">ModManager</a>
<a href="NamedFormat.html">NamedFormat</a>
<a href="PlanBspTree.html">PlanBspTree</a>
<a href="PlanetSpecifics.html">PlanetSpecifics</a>
<a href="PlanGenerationStage.html">PlanGenerationStage</a>
<a href="PlanPart.html">PlanPart</a>
<a href="PlanStyle.html">PlanStyle</a>
<a href="PlayerId.html">PlayerId</a>
<a href="PluralForm.html">PluralForm</a>
<a href="Profiler.html">Profiler</a>
<a href="QuadTree.html">QuadTree</a>
<a href="Random.html">Random</a>
<a href="Rarity.html">Rarity</a>
<a href="Ray.html">Ray</a>
<a href="ReadOnlyEntity.html">ReadOnlyEntity</a>
<a href="Rect.html">Rect</a>
<a href="Relation.html">Relation</a>
<a href="Scenario.html">Scenario</a>
<a href="SectorView.html">SectorView</a>
<a href="Seed.html">Seed</a>
<a href="Sphere.html">Sphere</a>
<a href="Squad.html">Squad</a>
<a href="SystemUpgradeTemplate.html">SystemUpgradeTemplate</a>
<a href="Timer.html">Timer</a>
<a href="Tooltip.html">Tooltip</a>
<a href="TooltipLine.html">TooltipLine</a>
<a href="TorpedoShaft.html">TorpedoShaft</a>
<a href="TorpedoTemplate.html">TorpedoTemplate</a>
<a href="TradingGood.html">TradingGood</a>
<a href="TurretDesign.html">TurretDesign</a>
<a href="TurretDesignPart.html">TurretDesignPart</a>
<a href="TurretTemplate.html">TurretTemplate</a>
<a href="UsableInventoryItem.html">UsableInventoryItem</a>
<a href="Uuid.html">Uuid</a>
<a href="VanillaInventoryItem.html">VanillaInventoryItem</a>
<a href="vec2.html">vec2</a>
<a href="vec3.html">vec3</a>
<a href="vec4.html">vec4</a>
<a href="Version.html">Version</a>
<a href="Weapon.html">Weapon</a>
</div><div class="headerlisting">
<span class="docheader">Client Components</span>
<br><a href="EntityIcon.html">EntityIcon</a>
<a href="EntityTooltip.html">EntityTooltip</a>
<a href="PlanMesh.html">PlanMesh</a>
<a href="ReadOnlyIcon.html">ReadOnlyIcon</a>
<a href="ReadOnlyPlanMesh.html">ReadOnlyPlanMesh</a>
<a href="ReadOnlyScriptUI.html">ReadOnlyScriptUI</a>
<a href="ReadOnlyTooltip.html">ReadOnlyTooltip</a>
<a href="ScriptUI.html">ScriptUI</a>
</div><div class="headerlisting">
<span class="docheader">Client Objects</span>
<br><a href="Achievements.html">Achievements</a>
<a href="Alliance [Client].html">Alliance [Client]</a>
<a href="CameraKeyFrame.html">CameraKeyFrame</a>
<a href="CaptainSelectionItem.html">CaptainSelectionItem</a>
<a href="Client.html">Client</a>
<a href="ClientSettings.html">ClientSettings</a>
<a href="ColorSelectionItem.html">ColorSelectionItem</a>
<a href="CraftDesignSelectionItem.html">CraftDesignSelectionItem</a>
<a href="Faction [Client].html">Faction [Client]</a>
<a href="Galaxy [Client].html">Galaxy [Client]</a>
<a href="GalaxyMap.html">GalaxyMap</a>
<a href="GameInput.html">GameInput</a>
<a href="GlowFX.html">GlowFX</a>
<a href="IconSelectionItem.html">IconSelectionItem</a>
<a href="InputWindow.html">InputWindow</a>
<a href="InventoryReferenceSelectionItem.html">InventoryReferenceSelectionItem</a>
<a href="InventorySelectionItem.html">InventorySelectionItem</a>
<a href="Keyboard.html">Keyboard</a>
<a href="LaserFX.html">LaserFX</a>
<a href="Mouse.html">Mouse</a>
<a href="Music.html">Music</a>
<a href="PixelIconSelectionItem.html">PixelIconSelectionItem</a>
<a href="Planet.html">Planet</a>
<a href="Player [Client].html">Player [Client]</a>
<a href="PlayerWindow.html">PlayerWindow</a>
<a href="RefractionFX.html">RefractionFX</a>
<a href="Sector [Client].html">Sector [Client]</a>
<a href="SelectionItem.html">SelectionItem</a>
<a href="ShipDatabaseEntry [Client].html">ShipDatabaseEntry [Client]</a>
<a href="SoundSource.html">SoundSource</a>
<a href="StrategyState.html">StrategyState</a>
<a href="TargetIndicator.html">TargetIndicator</a>
<a href="TooltipRenderer.html">TooltipRenderer</a>
<a href="TurretDesignSelectionItem.html">TurretDesignSelectionItem</a>
</div><div class="headerlisting">
<span class="docheader">Client UI Objects</span>
<br><a href="AllianceEmblem.html">AllianceEmblem</a>
<a href="AllianceTab.html">AllianceTab</a>
<a href="ArrowLine.html">ArrowLine</a>
<a href="Button [Client] [Client].html">Button [Client] [Client]</a>
<a href="Button [Client] [Client].html">Button [Client] [Client]</a>
<a href="CaptainIcon.html">CaptainIcon</a>
<a href="CaptainProfile.html">CaptainProfile</a>
<a href="CheckBox.html">CheckBox</a>
<a href="ComboBox.html">ComboBox</a>
<a href="ContextMenu.html">ContextMenu</a>
<a href="CraftPortrait.html">CraftPortrait</a>
<a href="CrewBar.html">CrewBar</a>
<a href="Frame.html">Frame</a>
<a href="Hud.html">Hud</a>
<a href="InventorySelection.html">InventorySelection</a>
<a href="Label.html">Label</a>
<a href="Line.html">Line</a>
<a href="ListBox.html">ListBox</a>
<a href="ListBoxEx.html">ListBoxEx</a>
<a href="MapArrowLine.html">MapArrowLine</a>
<a href="MapIcon.html">MapIcon</a>
<a href="MultiLineTextBox.html">MultiLineTextBox</a>
<a href="NumbersBar.html">NumbersBar</a>
<a href="Picture.html">Picture</a>
<a href="PlanDisplayer.html">PlanDisplayer</a>
<a href="ProgressBar.html">ProgressBar</a>
<a href="SavedDesignsSelection.html">SavedDesignsSelection</a>
<a href="ScrollFrame.html">ScrollFrame</a>
<a href="Selection.html">Selection</a>
<a href="ShipWindow.html">ShipWindow</a>
<a href="Slider.html">Slider</a>
<a href="StatisticsBar.html">StatisticsBar</a>
<a href="Tab.html">Tab</a>
<a href="TabbedWindow.html">TabbedWindow</a>
<a href="TextBox.html">TextBox</a>
<a href="TextField.html">TextField</a>
<a href="TooltipDisplayer.html">TooltipDisplayer</a>
<a href="Tree.html">Tree</a>
<a href="UIArbitraryHorizontalSplitter.html">UIArbitraryHorizontalSplitter</a>
<a href="UIArbitraryVerticalSplitter.html">UIArbitraryVerticalSplitter</a>
<a href="UIContainer.html">UIContainer</a>
<a href="UIElement.html">UIElement</a>
<a href="UIGridSplitter.html">UIGridSplitter</a>
<a href="UIHorizontalLister.html">UIHorizontalLister</a>
<a href="UIHorizontalMultiSplitter.html">UIHorizontalMultiSplitter</a>
<a href="UIHorizontalSplitter.html">UIHorizontalSplitter</a>
<a href="UIOrganizer.html">UIOrganizer</a>
<a href="UIRect.html">UIRect</a>
<a href="UIRenderer.html">UIRenderer</a>
<a href="UIVerticalLister.html">UIVerticalLister</a>
<a href="UIVerticalMultiSplitter.html">UIVerticalMultiSplitter</a>
<a href="UIVerticalSplitter.html">UIVerticalSplitter</a>
<a href="ValueComboBox.html">ValueComboBox</a>
<a href="Window.html">Window</a>
</div><div class="headerlisting">
<span class="docheader">Server Components</span>
<br><a href="EntityTransferrer.html">EntityTransferrer</a>
<a href="FighterController.html">FighterController</a>
<a href="Loot.html">Loot</a>
<a href="ReadOnlyEntityTransferrer.html">ReadOnlyEntityTransferrer</a>
<a href="ReadOnlyFighterController.html">ReadOnlyFighterController</a>
<a href="ReadOnlyLoot.html">ReadOnlyLoot</a>
<a href="ReadOnlyTurretController.html">ReadOnlyTurretController</a>
<a href="ReadOnlyWreckageCreator.html">ReadOnlyWreckageCreator</a>
<a href="TurretController.html">TurretController</a>
<a href="WreckageCreator.html">WreckageCreator</a>
</div><div class="headerlisting">
<span class="docheader">Server Objects</span>
<br><a href="Alliance [Server].html">Alliance [Server]</a>
<a href="Faction [Server].html">Faction [Server]</a>
<a href="Galaxy [Server].html">Galaxy [Server]</a>
<a href="Player [Server].html">Player [Server]</a>
<a href="ReadOnlySector.html">ReadOnlySector</a>
<a href="Sector [Server].html">Sector [Server]</a>
<a href="Server.html">Server</a>
<a href="ShipDatabaseEntry [Server].html">ShipDatabaseEntry [Server]</a>
</div><div class="lastheaderlisting">
<span class="docheader">Enums</span>
<br><a href="Enums.html#AIState">AIState</a>
<a href="Enums.html#AlliancePrivilege">AlliancePrivilege</a>
<a href="Enums.html#BeamShape">BeamShape</a>
<a href="Enums.html#BlockShading">BlockShading</a>
<a href="Enums.html#BlockStructure">BlockStructure</a>
<a href="Enums.html#BlockType">BlockType</a>
<a href="Enums.html#BlockType2">BlockType2</a>
<a href="Enums.html#BoxType">BoxType</a>
<a href="Enums.html#BuildError">BuildError</a>
<a href="Enums.html#CaptainGenderId">CaptainGenderId</a>
<a href="Enums.html#ChatChannel">ChatChannel</a>
<a href="Enums.html#ChatMessageType">ChatMessageType</a>
<a href="Enums.html#ComponentType">ComponentType</a>
<a href="Enums.html#ControlAction">ControlAction</a>
<a href="Enums.html#ControlActionBit">ControlActionBit</a>
<a href="Enums.html#ControlStyle">ControlStyle</a>
<a href="Enums.html#CoolingType">CoolingType</a>
<a href="Enums.html#CraftStatsOverviewStat">CraftStatsOverviewStat</a>
<a href="Enums.html#CrewProfessionType">CrewProfessionType</a>
<a href="Enums.html#CrewRank">CrewRank</a>
<a href="Enums.html#DamageSource">DamageSource</a>
<a href="Enums.html#DamageType">DamageType</a>
<a href="Enums.html#DeletionType">DeletionType</a>
<a href="Enums.html#Difficulty">Difficulty</a>
<a href="Enums.html#EntityArrivalType">EntityArrivalType</a>
<a href="Enums.html#EntityType">EntityType</a>
<a href="Enums.html#FighterOrders">FighterOrders</a>
<a href="Enums.html#FighterStartError">FighterStartError</a>
<a href="Enums.html#FighterType">FighterType</a>
<a href="Enums.html#FontType">FontType</a>
<a href="Enums.html#ImpactParticles">ImpactParticles</a>
<a href="Enums.html#InventoryItemType">InventoryItemType</a>
<a href="Enums.html#JumpError">JumpError</a>
<a href="Enums.html#KeyboardKey">KeyboardKey</a>
<a href="Enums.html#ListBoxEntryType">ListBoxEntryType</a>
<a href="Enums.html#MalusReason">MalusReason</a>
<a href="Enums.html#MaterialType">MaterialType</a>
<a href="Enums.html#MoonType">MoonType</a>
<a href="Enums.html#MouseButton">MouseButton</a>
<a href="Enums.html#PlanetType">PlanetType</a>
<a href="Enums.html#PlanTypeFilter">PlanTypeFilter</a>
<a href="Enums.html#PlayerStateType">PlayerStateType</a>
<a href="Enums.html#ProjectileShape">ProjectileShape</a>
<a href="Enums.html#RarityType">RarityType</a>
<a href="Enums.html#RelationStatus">RelationStatus</a>
<a href="Enums.html#SavedDesignType">SavedDesignType</a>
<a href="Enums.html#ScenarioType">ScenarioType</a>
<a href="Enums.html#SectorChangeType">SectorChangeType</a>
<a href="Enums.html#ShipAvailability">ShipAvailability</a>
<a href="Enums.html#SoundType">SoundType</a>
<a href="Enums.html#StatsBonuses">StatsBonuses</a>
<a href="Enums.html#TargetIndicatorVisuals">TargetIndicatorVisuals</a>
<a href="Enums.html#TransformationFeature">TransformationFeature</a>
<a href="Enums.html#TurretAutoFireMode">TurretAutoFireMode</a>
<a href="Enums.html#TurretSlotType">TurretSlotType</a>
<a href="Enums.html#WeaponAppearance">WeaponAppearance</a>
<a href="Enums.html#WeaponCategory">WeaponCategory</a>
</div></div>
<div class="disclaimer">
<p>This is the official documentation for the scripting API of Avorion. This documentation is automatically generated and <strong>not</strong> necessarily complete. Depending on the context in which functions exist, some documentation such as descriptions, return values or variable names or types may be missing.</p>
<p>Work in Progress. Documentation of Avorion Version: 2.5.8 a0d3f0b5b065</p>
</div>
<div class="footer">
<p align="center">Work in Progress.</p>
<p align="center">Copyright &copy; 2025 Boxelware GmbH. All rights reserved.</p>
</div>
</div>
</body>
</html>