Avorion Script API Documentation

FactionDatabase Script Predefined Functions

Tip: Scroll down for an example script!

function initializePlayer(player, player->getIndex()))

Called when a new player was created. Use this function to initialize the players and give them their first equipment or money.

Server Function: This function is only called on the server.

Parameters

player The newly created player

function initializeAIFaction(faction, baseName, stateForm)

Called when a new AI faction was created. Use this function to initialize the factions and give them their first equipment or money.

Server Function: This function is only called on the server.

Parameters

faction The newly created faction
baseName The new base name of the faction (nil if it should be generated)
stateForm The new state form of the faction (nil if it should be generated)

function initializeAlliance(alliance, alliance->getIndex()))

Called when a new alliance was created. Use this function to initialize the alliances and give them their first equipment or money.

Server Function: This function is only called on the server.

Parameters

alliance The newly created alliance


FactionDatabase Example Script

-- Called when a new player was created. Use this function to initialize the players and give
-- them their first equipment or money.
-- Server Function: This function is only called on the server.
function initializePlayer(player, player->getIndex()))

end

-- Called when a new AI faction was created. Use this function to initialize the factions and
-- give them their first equipment or money.
-- Server Function: This function is only called on the server.
function initializeAIFaction(ScriptFaction(galaxy, faction->getIndex()), baseNameParameter, stateFormParameter)

end

-- Called when a new alliance was created. Use this function to initialize the alliances and give
-- them their first equipment or money.
-- Server Function: This function is only called on the server.
function initializeAlliance(alliance, alliance->getIndex()))

end
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