Avorion Script API Documentation

ReadOnlyShipAI

function ReadOnlyShipAI(var id)

Parameters

id The id of the entity, must be an index of an existing entity or nil for the entity in the current script context

Returns

A new instance of ReadOnlyShipAI

property uuid attackedEntity[read-only]
The currently attacked entity.
property Entity entity[read-only]
property uuid entityId[read-only]
property vec3 flyTarget[read-only]
The location the entity is currently flying to, if in state "Fly" or "FlyLinear".
property bool isAttackingSomething[read-only]
True if the entity is currently attacking another entity.
property bool isBusy[read-only]
True if the entity is currently doing something that prevents ambient chatter.
property bool isStuck[read-only]
True if the entity is currently in state "Fly" and got stuck.
property int state[read-only]
The AIStateType that the AI is currently in.

function bool enemyFightersPresent()

Returns true if there are enemy fighters present in the sector.

function bool enemyShipsPresent(var countCivilEnemies)

Returns true if there are enemy ships present in the sector.

Parameters

countCivilEnemies Set to true to also include civil ships like freighters and the like.

function Entity... getEnemies()

Returns a list of all entities that this AI considers hostile in the sector.

function uuid... getRegisteredEnemyEntities()

Returns the list of entities that are always considered enemies.

function int... getRegisteredEnemyFactions()

Returns the list of factions that are always considered enemies.

function uuid... getRegisteredFriendEntities()

Returns the list of entities that are always considered friends.

function int... getRegisteredFriendFactions()

Returns the list of factions that are always considered friends.

function bool isEnemy(Entity target)

Checks if the given entity is considered an enemy.

Parameters

target The entity to check

function bool isRegisteredEnemy(Entity target)

Checks if the given entity is registered to always be considered hostile.

Parameters

target The entity to check

function bool isRegisteredFriend(Entity target)

Checks if the given entity is registered to always be considered friendly.

Parameters

target The entity to check

Overview
Home Functions Search
Search:

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.7 c8e4beec84f7