# Avorion Script API Documentation

Home Functions Search
Search:

EntityDescriptor EntityDescriptor
Properties
aiOwned
allianceOwned
canPassRifts
controlActions
crew
crewSize
damageMultiplier
desiredVelocity
dockable
dockingParent
durability
excludedPlayer
exclusionTime
factionIndex
fighterCargoPickup
firePower
freeCargoSpace
hasPilot
hyperspaceCooldown
hyperspaceJumpReach
id
idealCrew
index
invincible
isAnomaly
isArmedTurret
isAsteroid
isContainer
isDrone
isFighter
isFlyable
isLoot
isObviouslyMineable
isOther
isShieldActive
isShip
isStation
isTurning
isTurret
isUnarmedTurret
isUnknown
isWormHole
isWreckage
look
mass
maxCargoSpace
maxCrewSize
maxDurability
minCrew
mothership
name
numCargos
numDefenseWeapons
numDefenseWeaponsCurrentAttack
numDockingPositions
numTurrets
occupiedCargoSpace
orientation
playerOrAllianceOwned
playerOwned
position
radius
reservationTime
reservedPlayer
right
selectedObject
shieldDurability
shieldMaxDurability
shieldMeshIntensity
size
timeAlive
title
translatedTitle
translation
translationf
transporterRange
type
typename
up
volume
Member Functions
addComponent
addComponents
getComponent
removeComponent
addAbsoluteBias
addBaseMultiplier
addCargo
addCrew
addKeyedAbsoluteBias
addKeyedBaseMultiplier
addKeyedMultiplier
addKeyedMultiplyableBias
addMultiplier
addMultiplyableBias
addScript
addScriptOnce
addTurret
blockHyperspace
callbacksRegistered
canAddCrew
changeCrew
changeShield
clearCargoBay
clearValues
damageShield
destroy
destroyBlock
destroyCargo
disableFlightAssistFor
distortHyperspace
findCargos
getAimedPositionBySeat
getAimedPositions
getAllowedArbitraryTurrets
getAllowedArmedTurrets
getAllowedUnarmedTurrets
getAttachedBlockIndex
getBoostedValue
getBoundingBox
getBoundingSphere
getCaptain
getCargo
getCargoAmount
getCargos
getCrewMembers
getDamageContributorPlayerFactions
getDamageContributorPlayers
getDamageContributors
getDockedGroupBoundingBox
getDockedGroupBoundingSphere
getDockingPositions
getFreeArbitraryTurrets
getFreeArmedTurrets
getFreeUnarmedTurrets
getFullPlanCopy
getLowestMineableMaterial
getMalusFactor
getMineableMaterial
getMineableResources
getMoneyLootAmount
getMovePlan
getNearestDistance
getNumArmedTurrets
getNumMiningTurrets
getNumSalvagingTurrets
getNumUnarmedTurrets
getPilotIndices
getPlanMoneyValue
getPlanResourceValue
getResourceLootAmount
getScripts
getTitleArguments
getTitleFormat
getTurret
getTurretPositions
getTurretPositionsLineOfSight
getTurrets
getTurretSize
getTurretTemplateSize
getTurretTurningSpeed
getUndamagedPlanMoneyValue
getUndamagedPlanResourceValue
getValue
getValues
hasComponent
hasScript
heal
healShield
hyperspaceBlocked
inflictDamage
invokeFunction
isCollectable
isInDockingArea
isInsideShield
isJumpRouteValid
isManned
isTurretAllowed
jumpPossible
moveBy
registerCallback
registerDamage
removeBonus
removeCargo
removeCrew
removeScript
removeScriptBonuses
resolveScriptPath
sendCallback
setAccumulatingBlockHealth
setAimedPosition
setAttachedBlockIndex
setCaptain
setDamageTypeMultiplier
setDropsAttachedTurrets
setDropsLoot
setMalusFactor
setManned
setMovePlan
setPlan
setTitle
setTitleArguments
setTurretSize
setTurretTurningSpeed
setValue
singleFlyToLocationTick
unregisterCallback
updateProductionCatchingUp
waitUntilAsyncWorkFinished

# EntityDescriptor : Entity

function EntityDescriptor()

Returns

A new instance of EntityDescriptor

property bool aiOwned | [read-only]

property bool allianceOwned | [read-only]

property bool canPassRifts | [read-only]

property int controlActions |

property Crew crew |

property var crewSize | [read-only]

property float damageMultiplier |

property float desiredVelocity |

property bool dockable |

property Uuid dockingParent | [read-only]

property double durability |

property int excludedPlayer |

property int exclusionTime |

property int factionIndex |

property bool fighterCargoPickup | [read-only]

property double firePower | [read-only]

property var freeCargoSpace | [read-only]

property bool hasPilot | [read-only]

property float hyperspaceCooldown |

property float hyperspaceJumpReach |

property Uuid id | [read-only]

property Crew idealCrew | [read-only]

property Uuid index | [read-only]

property bool invincible |

property bool isAnomaly | [read-only]

property var isArmedTurret | [read-only]

property bool isAsteroid | [read-only]

property bool isContainer | [read-only]

property bool isDrone | [read-only]

property bool isFighter | [read-only]

property bool isFlyable | [read-only]

property bool isLoot | [read-only]

property bool isObviouslyMineable |

property bool isOther | [read-only]

property var isShieldActive | [read-only]

property bool isShip | [read-only]

property bool isStation | [read-only]

property var isTurning | [read-only]

property bool isTurret | [read-only]

property var isUnarmedTurret | [read-only]

property bool isUnknown | [read-only]

property bool isWormHole | [read-only]

property bool isWreckage | [read-only]

property vec3 look | [read-only]

property var mass | [read-only]

property var maxCargoSpace | [read-only]

property var maxCrewSize | [read-only]

property var maxDurability | [read-only]

property Crew minCrew | [read-only]

property Entity mothership |

property string name |

property int numCargos | [read-only]

property int numDefenseWeapons | [read-only]

property int numDefenseWeaponsCurrentAttack | [read-only]

property var numDockingPositions | [read-only]

property var numTurrets | [read-only]

property var occupiedCargoSpace | [read-only]

property Matrix orientation |

property bool playerOrAllianceOwned | [read-only]

property bool playerOwned | [read-only]

property Matrix position |

property var radius | [read-only]

property float reservationTime |

property int reservedPlayer |

property vec3 right | [read-only]

property var selectedObject |

property double shieldDurability |

property double shieldMaxDurability |

property float shieldMeshIntensity | [read-only]

property vec3 size | [read-only]

property var timeAlive | [read-only]

property string title |

property var translatedTitle | [read-only]

property dvec3 translation |

property vec3 translationf | [read-only]

property double transporterRange | [read-only]

property int type |

property string typename | [read-only]

property vec3 up | [read-only]

property var volume | [read-only]

function var addComponent(Type type)

Returns

nothing

function var addComponents()

Returns

nothing

function UserObject getComponent(Type type)

function var removeComponent(Type type)

Returns

nothing

function var addAbsoluteBias(int type, float value)

Adds a flat bias for stat of type type. This bias will be added to stat after multipliers are considered. Inherited from Entity

Parameters

type Type of Bonus, e.g. acceleration, higher level crew
value Bias added to base stats.

Returns

key that can be used to access the multiplier

function var addBaseMultiplier(int type, float factor)

Adds a multiplyer for stat of type type. This is to increase a stat, so a factor of 0.3 will become 1.3. Inherited from Entity

Parameters

type Type of Bonus, e.g. acceleration, higher level crew
factor Factor that is used as Multiplier

Returns

key that can be used to access the multiplier

function unsigned int addCargo(TradingGood good, int amount)

Adds cargo to the entity. If the amount specified exceeds the maximum capacity of the cargo bay, as much cargo as still fits in will be added. Inherited from Entity

Parameters

good TradingGood that is to be added.
amount The amount of cargo that should be added.

Returns

How much was actually added (can be less than amount when cargo bay is full)

function var addCrew(int number, CrewMan crewman)

Inherited from Entity

Returns

nothing

function var addKeyedAbsoluteBias(int type, int key, float value)

Exchanges flat bias at key with new value Inherited from Entity

Parameters

type Bonus type
key Location of the bonus that will be changed
value New value

Returns

key that can be used to access the multiplier

function var addKeyedBaseMultiplier(int type, int key, float value)

Exchanges multiplier at key with new value Inherited from Entity

Parameters

type Bonus type
key Location of the bonus that will be changed
value New value

Returns

key that can be used to access the multiplier

function var addKeyedMultiplier(int type, int key, float value)

Exchanges multiplier at key with new value Inherited from Entity

Parameters

type Bonus type
key Location of the bonus that will be changed
value New value

Returns

key that can be used to access the multiplier

function var addKeyedMultiplyableBias(int type, int key, float value)

Exchanges bias at key with new value Inherited from Entity

Parameters

type Bonus type
key Location of the bonus that will be changed
value New value

Returns

key that can be used to access the multiplier

function var addMultiplier(int type, float factor)

Adds a multiplyer for stat of type type. The factor will be used unchanged. Inherited from Entity

Parameters

type Type of Bonus, e.g. acceleration, higher level crew
factor Factor that is used as Multiplier

Returns

key that can be used to access the multiplier

function var addMultiplyableBias(int type, float value)

Adds a bias for stat of type type. This bias will be added to stat before multipliers are considered. Inherited from Entity

Parameters

type Type of Bonus, e.g. acceleration, higher level crew
value Bias added to base stats.

Returns

key that can be used to access the multiplier

function var addScript(string scriptPath, var... arguments)

Adds a new script to an entity Inherited from Entity

Parameters

scriptPath The path of the script that should be added
arguments An arbitrary number of arguments that will be given to the 'initialize' function of the added script

Returns

0 on success, 1 if the entity could not be found

function var addScriptOnce()

Inherited from Entity

function Uuid addTurret(TurretTemplate turret, Matrix position, int part)

Inherited from Entity

function var blockHyperspace(float time)

Inherited from Entity

Returns

nothing

function int callbacksRegistered(string callbackName, var functionName)

Check how many functions are registered to a callback from the current script VM. Inherited from Entity

Parameters

callbackName The name of the callback
functionName The name of the function for which to check. If nil, will count all functions that are registered to this callback.

Returns

The amount of functions registered to the callback

function var, var, table<int, string> canAddCrew(int number, int profession, bool change)

Inherited from Entity

function var changeCrew(int number, int profession)

Inherited from Entity

Returns

nothing

function var changeShield(double delta)

Adds delta to shield durability Inherited from Entity

Parameters

delta

Returns

nothing

function var clearCargoBay()

Inherited from Entity

Returns

nothing

function var clearValues()

Removes all custom values of the object Inherited from Entity

Returns

nothing

function var damageShield(double amount, vec3 location, Uuid inflictorId, var damageSource, var damageType)

Damages shield by delta amount, location and inflictorId are not necessary, but can be added if it is needed, e.g. you want to do effects on hitpoint. Inherited from Entity

Parameters

delta
location
inflictorId

Returns

nothing

function var destroy(Uuid inflictorId, var damageSource, var damageType)

Destroy entity by inflicting more damage than durability of entity Inherited from Entity

Parameters

inflictorId Index of the entity that destroys the block
damageSource Source of damage. Can be Weaponry, Collision, Decay, Torpedo or Arbitrary. *
damageType Type of damage received. Damage can be of type Physical, Energy, Electric, Plasma, AntiMatter or Fragments.

Returns

nothing

function var destroyBlock(int index, Uuid inflictorId, var damageSource)

Destroy one block Inherited from Entity

Parameters

index Index of the block that is destroyed
inflictorId Index of the entity that destroys the block
damageSource Source of damage. Can be Weaponry, Collision, Decay, Torpedo or Arbitrary.

Returns

nothing

function var destroyCargo(float volume)

Destroys cargo. The destruction distribution is generally equal over all goods. Inherited from Entity

Parameters

volume The amount of volume that should be destroyed.

Returns

nothing

function var disableFlightAssistFor(float time)

Inherited from Entity

Returns

nothing

function var distortHyperspace(float time)

Inherited from Entity

Returns

nothing

function table<TradingGood, int> findCargos(string name)

Finds all cargos with the given name. Inherited from Entity

Parameters

name A string that will be matched with the 'name' property of the cargos.

Returns

A map containing all matching goods, with the good as key and amount as value.

function vec3 getAimedPositionBySeat(int seat)

Inherited from Entity

function vec3... getAimedPositions()

Inherited from Entity

function var getAllowedArbitraryTurrets()

Inherited from Entity

function var getAllowedArmedTurrets()

Inherited from Entity

function var getAllowedUnarmedTurrets()

Inherited from Entity

function var getAttachedBlockIndex()

Returns the Index of the block that the turret is build on Inherited from Entity

function var getBoostedValue(int type, float value)

Returns value with included bonus, in case a bonus exists. Returns Nil if no bonuses at all, returns value if no bonuses for this stat exist. Inherited from Entity

Parameters

type type of bonus stat, e.g. acceleration, higher level crew
value the value, that might be changed by bonuses

function Box getBoundingBox()

Returns Bounding Box for entity, use this if you need exact Bounding Box, e.g. for collision detection when entities are close to each other. Inherited from Entity

function Sphere getBoundingSphere()

Returns Bounding Sphere for entity. Much faster than Bounding Box, but not as accurate. Use this if you need to check often. Inherited from Entity

function Captain getCaptain()

Inherited from Entity

function TradingGood, int... getCargo(unsigned int n)

Inherited from Entity

function int getCargoAmount(var name)

Counts all goods of the given type. When given a string, it will match the 'name' property of the goods. When given a TradingGood it will match the exact good. Inherited from Entity

Parameters

name Either a TradingGood or a string containing the name of a trading good.

Returns

The number of goods

function table<TradingGood, int> getCargos()

Inherited from Entity

function var getCrewMembers(int profession)

Inherited from Entity

function int... getDamageContributorPlayerFactions()

Lists all players and alliances that contributed damage to the entity Inherited from Entity

Returns

Indices of all players and alliances that contributed damage to the entity

function int... getDamageContributorPlayers()

Lists all players that contributed damage to the entity Inherited from Entity

Returns

Indices of all players that contributed damage to the entity

function int... getDamageContributors()

Lists all factions that contributed damage to the entity Inherited from Entity

Returns

Indices of all factions that contributed damage to the entity

function Box getDockedGroupBoundingBox()

Returns Bounding Box for entity, but enlarged to also fit around all docked objects. Use this if you need exact Bounding Box, e.g. for collision detection when entities are close to each other. Inherited from Entity

function Sphere getDockedGroupBoundingSphere()

Returns Bounding Box for entity, but enlarged to also fit around all docked objects. Use this if you need exact Bounding Box, e.g. for collision detection when entities are close to each other. Inherited from Entity

function var getDockingPositions()

Lists all docking positions that the entity has Inherited from Entity

Returns

A table that contains a key-value pair (id, table) for each dock: <id, {position, direction, id}>

function var getFreeArbitraryTurrets()

Inherited from Entity

function var getFreeArmedTurrets()

Inherited from Entity

function var getFreeUnarmedTurrets()

Inherited from Entity

function BlockPlan getFullPlanCopy()

Returns the plan of the entity. This copies the entire plan, keep that in mind when using plans with large block counts. Inherited from Entity

Returns

A copy of the plan of the entity

function Material getLowestMineableMaterial()

Inherited from Entity

function var, var getMalusFactor()

Inherited from Entity

function Material getMineableMaterial()

Inherited from Entity

function int... getMineableResources()

Inherited from Entity

function int getMoneyLootAmount()

Inherited from Entity

function BlockPlan getMovePlan()

Returns the plan of the entity. This function will move the plan out of the entity, and replace the entity's plan with a single block. This operation is independent of the size of the plan, use it when you have to get large plans with lots of blocks. Inherited from Entity

Returns

The plan of the entity

function var getNearestDistance(Entity other)

Inherited from Entity

function var getNumArmedTurrets()

Inherited from Entity

function var getNumMiningTurrets()

Inherited from Entity

function var getNumSalvagingTurrets()

Inherited from Entity

function var getNumUnarmedTurrets()

Inherited from Entity

function int... getPilotIndices()

Returns Indices of piloting players Inherited from Entity

Returns

multiple return values: indices of players

function var getPlanMoneyValue()

Inherited from Entity

function double... getPlanResourceValue()

Inherited from Entity

function int getResourceLootAmount()

Inherited from Entity

function table<int, string> getScripts()

Inherited from Entity

function table<string, string> getTitleArguments()

Retrieves the arguments to a title Inherited from Entity

function NamedFormat getTitleFormat()

Retrieves the title as NamedFormat Inherited from Entity

function Entity getTurret(int index)

Inherited from Entity

function Matrix, int... getTurretPositions(TurretTemplate turret, int number)

Inherited from Entity

function Matrix, int... getTurretPositionsLineOfSight(TurretTemplate turret, int number)

Inherited from Entity

function Entity... getTurrets()

Inherited from Entity

function var getTurretSize()

Inherited from Entity

function var getTurretTemplateSize()

Inherited from Entity

function var getTurretTurningSpeed()

Inherited from Entity

function var getUndamagedPlanMoneyValue()

Inherited from Entity

function double... getUndamagedPlanResourceValue()

Inherited from Entity

function var getValue(string key)

Retrieves a custom value saved in the entity with the given key Inherited from Entity

Parameters

key A string that serves as the name of the value

Returns

The value if the key exists, otherwise nil

function table<string, var> getValues()

Retrieves all key-value pairs of custom values of the entity Inherited from Entity

Returns

A table containing all custom key-value pairs

function bool hasComponent(int type)

Inherited from Entity

function var hasScript(string name)

Inherited from Entity

function var heal(float damage, int index, vec3 location, Uuid inflictorID)

Increases durability of the plan of the Entity Inherited from Entity

Parameters

damage The amount of durability that will be restored
index Index of the block that will be restored
location vector containing the hit point, if unknown/unnecessary use empty vector
inflictorID Index of the entity that heals

Returns

nothing

function var healShield(double delta)

Increases shield durability by delta Inherited from Entity

Parameters

delta

Returns

nothing

function var hyperspaceBlocked()

Inherited from Entity

function var inflictDamage(float damage, var damageSource, var damageType, int index, vec3 location, Uuid inflictorId)

Inflicts damage to the plan of the Entity Inherited from Entity

Parameters

damage The amount of damage that will be dealt
damageSource The source of the damage. Can be Weaponry, Collision, Decay, Torpedo or Arbitrary.
damageType Type of damage received. Damage can be of type Physical, Energy, Electric, Plasma, AntiMatter or Fragments
index Index of the block that will receive the damage
location vector containing the hit point, if unknown / unnecessary use empty vector
inflictorId Index of the entity that caused the damage

Returns

nothing

function var... invokeFunction(var scriptName, string functionName, var... arguments)

Invokes a function in a script of the entity. Use this function to invoke functions from one script in another script. The first return value of the function is an integer indicating whether or not the call was successful. When it was, this integer is followed by the return values of the invoked function. Inherited from Entity

Parameters

scriptName The name or index of the script containing the function
functionName The name of the function that will be executed
arguments An arbitrary list of arguments that will be given to the invoked function

Returns

Returns at least 1 value indicating if the call succeeded:
0 The call was successful. In this case, the return values of the script are returned in addition to the call result, following the call result
1 The call failed because the entity with the specified index does not exist or has no Scripts component
2 The call failed because it came from another sector than the entity is in
3 The call failed because the given script was not found in the entity
4 The call failed because the given function was not found in the script
5 The call failed because the script's state has errors and is invalid

function var isCollectable(Entity entity)

Inherited from Entity

function bool isInDockingArea(Entity other)

Inherited from Entity

function var isInsideShield(vec3 point)

Inherited from Entity

function bool, var isJumpRouteValid(int fromX, int fromY, int toX, int toY)

Inherited from Entity

function var isManned()

Inherited from Entity

function var isTurretAllowed(TurretTemplate ScriptTurretTemplate)

Tests if the maximum number of turrets of this kind is not reached Inherited from Entity

Parameters

ScriptTurretTemplate the template of the turret to be placed

function int jumpPossible(int x, int y)

Tests if the entity can jump to the specified coordinates Inherited from Entity

Parameters

x The x-coordinates of the target sector
y The y-coordinates of the target sector

Returns

Returns an error code:
-1 The entity doesn't have a hyperspace drive.
0 The entity can jump.
1 The hyperspace drive needs to recharge.
2 The target sector is too far away.
3 The entity is facing the wrong direction.
4 The hyperspace drive is being jammed.

function var moveBy(vec3 delta)

Teleports entity by vector Inherited from Entity

Returns

nothing

function int registerCallback(string callbackName, string functionName)

Register a callback in the entity. The callback receiver has to be inside the same sector for the registration to succeed. The callback will be removed if either the entity or the receiver leaves the sector or gets destroyed. Double registration of callbacks doesn't work. When the same callback to the same callback of the same script instance is registered twice, it will still only be called once. Inherited from Entity

Parameters

callbackName The name of the callback
functionName The name of the function that will be executed in the script when the callback happens

Returns

0 on success, 1 if the registration failed

function var registerDamage(Uuid shooterId, double damage, DamageSource DamageSource)

Registers artificial damage as if the entity was damaged by the shooter Inherited from Entity

Parameters

shooterId The id of the entity that inflicted the damage
damage The amount of damage inflicted
DamageSource The kind of source for the damage

Returns

nothing

function var removeBonus(int key)

Deletes bonus Inherited from Entity

Parameters

key Location of the bonus

Returns

nothing

function var removeCargo(var good, int amount)

Removes cargo from the entity. When given a TradingGood, an exact check for that good will be performed. When given a string, only a name check will be performed, and which cargo will be removed first is undefined if there are multiple goods with the same name. An example would be Energy Cells vs. Stolen Energy Cells. The 'name' property is the same, but the 'stolen' property is different. Inherited from Entity

Parameters

good Either a TradingGood or a string with the name of a good.
amount The amount of cargo that should be removed. If this is more than there is on the ship, all specified cargo will be removed.

Returns

nothing

function var removeCrew(int number, CrewMan crewman)

Inherited from Entity

function var removeScript(var script)

Inherited from Entity

Returns

nothing

function var removeScriptBonuses()

Deletes all bonuses added by the current script Inherited from Entity

Returns

nothing

function var resolveScriptPath(string path)

Inherited from Entity

function bool sendCallback()

Inherited from Entity

function var setAccumulatingBlockHealth(bool bool)

If AccumulatingBlockHealth is true, a block needs to take as much damage as would be necessary to destroy all its children before it itself is destroyed. If it is set to false, the entity's blocks will have only their own durability. Set it to false if you want your entity to easily break apart, e.g. for wreckages. Inherited from Entity

Parameters

bool

Returns

nothing

function var setAimedPosition(int seat, vec3 in)

Inherited from Entity

Returns

nothing

function var setAttachedBlockIndex(int in)

Inherited from Entity

Returns

nothing

function var setCaptain(Captain [or nil] captain)

Inherited from Entity

Returns

nothing

function var setDamageTypeMultiplier(DamageType type, float factor)

Inherited from Entity

Returns

nothing

function var setDropsAttachedTurrets(bool bool)

Sets the entities' ability to drop its attached turrets. If set to true (default) the ship has a chance to drop a turret that's attached to it when it's destroyed. This is only enabled for NPC entities. Inherited from Entity

Parameters

bool value if the dropping is enabled

Returns

nothing

function var setDropsLoot(bool bool)

Sets the entities' ability to drop normal loot. Affects dropping of money, resources, cargo, turrets and upgrades. 'Loot' component is not affected by this. Inherited from Entity

Parameters

bool value if the entity should drop loot or not

Returns

nothing

function var setMalusFactor(float in, int reason)

Inherited from Entity

Returns

nothing

function var setManned(bool in)

Inherited from Entity

Returns

nothing

function var setMovePlan(BlockPlan plan)

Set the new plan of the entity. The entity will get deleted if the plan is empty. This moves all the data out of the plan that is used as the first argument. The content of the plan given as argument is then undefined, but still valid. It might be empty, it might contain the previous plan. This operation is independent of the size of the plan, use it when you have to set large plans with lots of blocks. Inherited from Entity

Parameters

plan The new BlockPlan of the entity

Returns

nothing

function var setPlan(BlockPlan plan)

Set the new plan of the entity. The entity will get deleted if the plan is empty. This copies the entire plan that is given as argument, keep that in mind when setting plans with large block counts. Inherited from Entity

Parameters

plan The new BlockPlan of the entity

Returns

nothing

function var setTitle(string title, string_pair... arguments)

Sets the title that can be used as title in menus Inherited from Entity

Parameters

title a string that will be used as title, can be a format string for easier translation.
arguments Set the string arguments (if format string is used) as vector of string_pair.

Returns

nothing

function var setTitleArguments(string_pair... arguments)

Sets the arguments to a title Inherited from Entity

Parameters

arguments Set the string arguments as vector of string_pair.

Returns

nothing

function var setTurretSize(float in)

Inherited from Entity

Returns

nothing

function var setTurretTurningSpeed(float in)

Inherited from Entity

Returns

nothing

function var setValue(string key, var value)

Sets a custom value Inherited from Entity

Parameters

key A string that serves as the name of the value
value The value to save. Must be bool, number, string or nil. If nil is given, the value will be deleted.

function var singleFlyToLocationTick(vec3 location)

Tells the ship to fly to given location, directly and without pathfinding. Inherited from Entity

Parameters

location the location to fly to (in global coordinates) Paired with setting desiredVelocity to 0, this can be used to rotate the ship to a given direction.

Returns

nothing

function int unregisterCallback(string callbackName, string functionName)

Inherited from Entity

function var updateProductionCatchingUp(float float)

Simulates production catching up. This is used when ships return from the background simulation. Updates fighter production, academy and cloning. Inherited from Entity

Parameters

float timePassed The amount of time that should be simulated

Returns

nothing

function var waitUntilAsyncWorkFinished(var time)

Inherited from Entity

Returns

nothing

Overview
Home Functions Search
Search:
Callbacks
Callbacks Alliance [Client] Callbacks Alliance [Server] Callbacks Alliance [Server] Callbacks Entity Callbacks Galaxy Callbacks Player Callbacks Player [Client] Callbacks Sector Callbacks Server Callbacks
Predefined Functions & Example Scripts
Command Entity FactionDatabase PlanGenerator Player Sector Server UsableInventoryItem
Common Components
Boarding BspTree CargoBay CargoLoot ControlUnit CrewComponent DeletionTimer DirectFlightPhysics DockingClamps DockingParent DockingPositions Durability EnergySystem Engine FighterAI Hangar HyperspaceEngine InteractionText InventoryItemLoot Owner Physics Plan ReadOnlyBoarding ReadOnlyBspTree ReadOnlyCargoBay ReadOnlyControlUnit ReadOnlyCrew ReadOnlyDeletionTimer ReadOnlyEnergySystem ReadOnlyEngine ReadOnlyFighterAI ReadOnlyHangar ReadOnlyHyperspaceEngine ReadOnlyInteractionText ReadOnlyOwner ReadOnlyPhysics ReadOnlyPlan ReadOnlyShipAI ReadOnlyShipSystem ReadOnlyTorpedoAI [Server] [Client] [Server] [Client] ReadOnlyTorpedoAI [Server] [Client] [Server] [Client] ReadOnlyTorpedoLauncher ReadOnlyTurretBases ReadOnlyVelocity ReadOnlyWeapons ReadOnlyWormHole Shield ShipAI ShipSystem StructuralIntegrity SystemUpgradeLoot Thrusters Torpedo TorpedoAI TorpedoLauncher Turret TurretAI TurretBases Velocity Weapons WormHole
Common Objects
AllianceMember AllianceRank BlockPlan BlockPlanBlock BlockStatistics Box Captain Color ControlUnitSeat CraftDesign CraftStatsOverview Crew CrewMan CrewProfession DebugInfo dvec2 dvec3 dvec4 Entity EntityDescriptor FighterTemplate Format GameSettings Group HighResolutionTimer Inventory InventoryTurret ivec2 ivec3 ivec4 Language Mail Material Matrix ModManager NamedFormat PlanBspTree PlanetSpecifics PlanGenerationStage PlanPart PlanStyle PlayerId PluralForm Profiler QuadTree Random Rarity Ray ReadOnlyEntity Rect Relation Scenario SectorView Seed Sphere Squad SystemUpgradeTemplate Timer Tooltip TooltipLine TorpedoShaft TorpedoTemplate TradingGood TurretDesign TurretDesignPart TurretTemplate UsableInventoryItem Uuid VanillaInventoryItem vec2 vec3 vec4 Version Weapon
Client Components
EntityIcon EntityTooltip PlanMesh ReadOnlyIcon ReadOnlyPlanMesh ReadOnlyScriptUI ReadOnlyTooltip ScriptUI
Client Objects
Achievements Alliance [Client] CameraKeyFrame CaptainSelectionItem Client ClientSettings ColorSelectionItem CraftDesignSelectionItem Faction [Client] Galaxy [Client] GalaxyMap GameInput GlowFX IconSelectionItem InputWindow InventoryReferenceSelectionItem InventorySelectionItem Keyboard LaserFX Mouse Music PixelIconSelectionItem Planet Player [Client] PlayerWindow RefractionFX Sector [Client] SelectionItem ShipDatabaseEntry [Client] SoundSource StrategyState TargetIndicator TooltipRenderer TurretDesignSelectionItem
Client UI Objects
AllianceEmblem AllianceTab ArrowLine Button [Client] [Client] Button [Client] [Client] CaptainIcon CaptainProfile CheckBox ComboBox ContextMenu CraftPortrait CrewBar Frame Hud InventorySelection Label Line ListBox ListBoxEx MapArrowLine MapIcon MultiLineTextBox NumbersBar Picture PlanDisplayer ProgressBar SavedDesignsSelection ScrollFrame Selection ShipWindow Slider StatisticsBar Tab TabbedWindow TextBox TextField TooltipDisplayer Tree UIArbitraryHorizontalSplitter UIArbitraryVerticalSplitter UIContainer UIElement UIGridSplitter UIHorizontalLister UIHorizontalMultiSplitter UIHorizontalSplitter UIOrganizer UIRect UIRenderer UIVerticalLister UIVerticalMultiSplitter UIVerticalSplitter ValueComboBox Window
Server Components
EntityTransferrer FighterController Loot ReadOnlyEntityTransferrer ReadOnlyFighterController ReadOnlyLoot ReadOnlyTurretController ReadOnlyWreckageCreator TurretController WreckageCreator
Server Objects
Alliance [Server] Faction [Server] Galaxy [Server] Player [Server] ReadOnlySector Sector [Server] Server ShipDatabaseEntry [Server]
Enums
AIState AlliancePrivilege BeamShape BlockShading BlockStructure BlockType BlockType2 BoxType BuildError CaptainGenderId ChatChannel ChatMessageType ComponentType ControlAction ControlActionBit ControlStyle CoolingType CraftStatsOverviewStat CrewProfessionType CrewRank DamageSource DamageType DeletionType Difficulty EntityArrivalType EntityType FighterOrders FighterStartError FighterType FontType ImpactParticles InventoryItemType JumpError KeyboardKey ListBoxEntryType MalusReason MaterialType MoonType MouseButton PlanetType PlanTypeFilter PlayerStateType ProjectileShape RarityType RelationStatus SavedDesignType ScenarioType SectorChangeType ShipAvailability SoundType StatsBonuses TargetIndicatorVisuals TransformationFeature TurretAutoFireMode TurretSlotType WeaponAppearance WeaponCategory

This is the official documentation for the scripting API of Avorion. This documentation is automatically generated and not 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.

Work in Progress. Documentation of Avorion Version: 2.5.8 a0d3f0b5b065