Avorion Script API Documentation

DockingClamps

function DockingClamps(var id)

Parameters

id The id of the entity this component belongs to, or the entity itself, must be an id of an existing entity or nil for the entity in the current script context

Returns

A new instance of DockingClamps

property int numDocks[read-only]

function bool dock(Entity dockee, var dockIndex)

Docks an Entity (dockee) to this Entity (parent), if the given dock is free. Note: This function doesn't dock the entity immediately, but during the upcoming update tick. If during the same tick another parent wants to dock the same dockee, the result which of the parents will actually dock the dockee is random. The dockee must be in position to be docked, otherwise this won't work.

Parameters

dockee The entity that is to be docked
dockIndex The index of the dock that is to be used. Use nil to use the first free dock.

Returns

true if the given dock is free (or a free dock was found), false otherwise.

function bool forceDock(Entity dockee, var dockIndex, var blockIndex, var look, var up)

Docks an Entity (dockee) to this Entity (parent), if the given dock is free. Note: This function doesn't dock the entity immediately, but during the upcoming update tick. If during the same tick another parent wants to dock the same dockee, the result which of the parents will actually dock the dockee is random.

Parameters

dockee The entity that is to be docked
dockIndex The index of the dock that is to be used. Use nil to use the first free dock.
blockIndex The index of the block on the other ship that is to be docked. If nil, uses the outermost block on the side that will be docked.
look The look direction of the object to dock. If nil, will use the parent's direction. This direction must be in local space of the parent object. You can either use a vec3, an ivec3, or a string indicating the direction, such as "x" or "-y".
up The up direction of the object to dock. If nil, will use the parent's direction. This direction must be in local space of the parent object. You can either use a vec3, an ivec3, or a string indicating the direction, such as "x" or "-y".

Returns

true if the given dock is free (or a free dock was found), false otherwise.

function Uuid... getDockedEntities()

function table_t getDocks()

function bool isDocked(var entity)

Checks if another entity is physically docked.

Parameters

entity The entity to check. Can be a Uuid, (uuid-)string or Entity.

Returns

true if physically docked, false otherwise.

function bool undock(Entity dockee)

Undocks an Entity (dockee) from this Entity (parent), if docked. Note: This function doesn't undock the entity immediately, but during the upcoming update tick.

Parameters

dockee The entity that is to be undocked

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