Squad

Members

Member

Description

attackTarget

Squadmates will always prioritize firing at their squad’s attackTarget if they are able to.

hasLanded

Returns true if the squad has landed their helicopter.

hasPlayerLeader

isPerformingLanding

Returns true if the squad is performing a landing or has landed a helicopter.

leader

The current leader of this squad.

members

The current members of this squad.

order

The current order assigned to this squad.

squadVehicle

Get the vehicle claimed by this squad.

Methods

Method

Description

AddMember(newMember)

Assign a new member to this squad.

AssignOrder(order)

Assigns a new order to this squad.

CancelLanding()

Cancels a landing.

LandHelicopterAtPosition(position)

Lands at position.

LandHelicopterAtPosition(position, onLandFunctionName)

Lands at position and calls function when landing completes.

LandHelicopterAtPosition(position, onLandFunctionName, eventData)

Lands at position and calls function when landing completes.

RemoveMember(member)

Removes a member from this squad.

SetCustomFormation(formation)

Set the formation to a specified custom formation.

SetFormation(formation)

SetFormationSize(formationWidth, formationDepth)

SetRandomFormation()

Set a random formation, excluding custom formation.

SplitSquad(count)

Removes a number of actors from this squad.

SplitSquad(membersToDrop)

Removes the specified actors from this squad.

TakeOff()

Cancels a landing and takes off.

ToString()

Static methods

Method

Description

Create(actors)

Creates a new squad with the specified actors.

Details

class Squad
Actor attackTarget

Squadmates will always prioritize firing at their squad’s attackTarget if they are able to. Attack targets always override the current rules-of-engagement. If the attack target dies, this value will automatically be set to nil.

const bool hasLanded

Returns true if the squad has landed their helicopter.

const bool hasPlayerLeader
const bool isPerformingLanding

Returns true if the squad is performing a landing or has landed a helicopter. Also see hasLanded.

const Actor leader

The current leader of this squad.

const array<Actor> members

The current members of this squad.

const Order order

The current order assigned to this squad.

const Vehicle squadVehicle

Get the vehicle claimed by this squad.

void AddMember(Actor newMember)

Assign a new member to this squad.

void AssignOrder(Order order)

Assigns a new order to this squad.

void CancelLanding()

Cancels a landing.

void LandHelicopterAtPosition(Vector3 position)

Lands at position.

void LandHelicopterAtPosition(Vector3 position, string onLandFunctionName)

Lands at position and calls function when landing completes. Callback function signature: OnLand(squad, eventData)

void LandHelicopterAtPosition(Vector3 position, string onLandFunctionName, DynValue eventData)

Lands at position and calls function when landing completes. Callback function signature: OnLand(squad, eventData)

void RemoveMember(Actor member)

Removes a member from this squad.

void SetCustomFormation(array<Vector2> formation)

Set the formation to a specified custom formation. The formation data contains the location of each squad member, which is rotated according to the squad movement direction and scaled by the formationWidth and formationHeight values. You can safely provide a greater number of locations than the current member count, which will be automatically used if more soldiers join the squad.

void SetFormation(FormationType formation)
void SetFormationSize(float formationWidth, float formationDepth)
void SetRandomFormation()

Set a random formation, excluding custom formation.

Squad SplitSquad(int count)

Removes a number of actors from this squad. The removed actors will form their own squad. Returns the new squad.

Squad SplitSquad(array<Actor> membersToDrop)

Removes the specified actors from this squad. The removed actors will form their own squad. Returns the new squad.

void TakeOff()

Cancels a landing and takes off.

string ToString()
static Squad Create(array<Actor> actors)

Creates a new squad with the specified actors. NOTE: The Player actor will be ignored, you can populate the player squad by adding members to Player.squad