Class: TurretHolder

TurretHolder()

This class holds the functions regarding entities being visible on another entity, but tied to their parents location.

Constructor

new TurretHolder()

Source:

Methods

AllowedToOccupyTurretPoint(entity, turretPoint) → {boolean}

Parameters:
Name Type Description
entity number The entity to check for.
turretPoint Object The turret point to use.
Source:
Returns:
- Whether the entity is allowed to occupy the specified turret point.
Type
boolean

CanOccupy(entity) → {boolean}

Parameters:
Name Type Description
entity number The entity to check for.
Source:
Returns:
- Whether the entity is allowed to occupy any turret point.
Type
boolean

CanPickup(ent) → {boolean}

Parameters:
Name Type Description
ent number The entity ID of the turret to be potentially picked up.
Source:
Returns:
- Whether this entity can pick the specified entity up.
Type
boolean

CreateSubunit(turretPoint) → {boolean}

Add a subunit as specified in the template. This function creates an entity and places it on the turret point.
Parameters:
Name Type Description
turretPoint Object A turret point to (re)create the predefined subunit for.
Source:
Returns:
- Whether the turret creation has succeeded.
Type
boolean

EjectOrKill(entities)

Parameters:
Name Type Description
entities Array.<number> The entities to ask to leave or to kill.
Source:

GetEntities() → {Array.<number>}

Source:
Returns:
- The turretted entityIDs.
Type
Array.<number>

GetOccupiedTurretPoint(entity) → {Object}

Parameters:
Name Type Description
entity number The entity's id.
Source:
Returns:
- The turret this entity is positioned on, if applicable.
Type
Object

GetOccupiedTurretPointName(entity) → {Object}

Parameters:
Name Type Description
entity number The entity's id.
Source:
Returns:
- The turret this entity is positioned on, if applicable.
Type
Object

GetTurretPoints() → {Array.<Object>}

Source:
Returns:
- An array of the turret points this entity has.
Type
Array.<Object>

IsFull() → {boolean}

Source:
Returns:
- Whether all the turret points are occupied.
Type
boolean

LeaveTurretPoint(entity, forced, turret) → {boolean}

Remove the entity from a turret.
Parameters:
Name Type Description
entity number The specific entity to eject.
forced boolean Whether ejection is forced (e.g. due to death or renaming).
turret Object Optionally the turret to abandon.
Source:
Returns:
- Whether the entity succesfully left us.
Type
boolean

LoadingRange() → {Object}

Source:
Returns:
- Max and min ranges at which entities can occupy any turret.
Type
Object

OccupiesTurretPoint(entity, turret) → {boolean}

Parameters:
Name Type Description
entity number The entity's id.
turret Object Optionally the turret to check.
Source:
Returns:
- Whether the entity is positioned on a turret of this entity.
Type
boolean

OccupyNamedTurretPoint(entity, turretName) → {boolean}

Parameters:
Name Type Description
entity number The entityID of the entity.
turretName String The name of the turret point to occupy.
Source:
Returns:
- Whether the occupation has succeeded.
Type
boolean

OccupyTurretPoint(entity, requestedTurretPoint) → {boolean}

Occupy a turret point with the given entity.
Parameters:
Name Type Description
entity number The entity to use.
requestedTurretPoint Object Optionally the specific turret point to occupy.
Source:
Returns:
- Whether the occupation was successful.
Type
boolean

OnEntityRenamed(msg)

Parameters:
Name Type Description
msg Object { "entity": number, "newentity": number }.
Source:

OnGlobalInitGame()

Initialise turreted units.
Source:

OnGlobalSkirmishReplacerReplaced()

Update list of turreted entities when a game inits.
Source:

OnOwnershipChanged(msg)

Parameters:
Name Type Description
msg Object { "entity": number, "from": number, "to": number }.
Source:

SetInitEntity(turretName, entity)

Sets an init turret, present from game start. (E.g. set in Atlas.)
Parameters:
Name Type Description
turretName String The name of the turret point to be used.
entity number The entity-ID to be placed.
Source:

SetReservedTurretPoint(name)

Parameters:
Name Type Description
name string The name of a turret point to reserve, e.g. for promotion.
Source:

TurretPointByName(turretPointName) → {Object}

Parameters:
Name Type Description
turretPointName string The name of the requested turret point.
Source:
Returns:
- The requested turret point.
Type
Object