Set formation controller's speed based on its current members.
Remove all members and destroy the formation.
Calculate the estimated rotation of the formation based on the current rotation. Return the sine and cosine of the angle.
Get the formation animation variant for a certain member of this formation.
||The entity ID to get the animation for.|
The name of the animation variant as defined in the template, e.g. "testudo_front" or undefined if does not exist.
Returns the 'primary' member of this formation (typically the most important unit type), for e.g. playing a representative sound. Returns undefined if no members. TODO: Actually implement something like that. Currently this just returns the arbitrary first one.
Get the world positions for a list of offsets in this formation.
MoveMembersIntoFormation(moveCenter, force, variant)
Set all members to form up into the formation shape.
||boolean||The formation center will be reinitialized to the center of the units.|
||boolean||All individual orders of the formation units are replaced, otherwise the order to walk into formation is just pushed to the front.|
||string | undefined||Variant to be passed as order parameter.|
Remove the given list of entities. The entities must already be members of this formation.
||boolean||Whether the removal was part of an entity rename (prevents disbanding of the formation when under the member limit).|
Set the value from which two twin formations will become one.
Initialize the members of this formation. Must only be called once. All members must implement UnitAI.
Set whether we are allowed to rearrange formation members.
Set formation position. If formation is not in world at time this is called, set new rotation and flag for range manager.
TakeClosestOffset(entPos, realPositions, offsets)
Search the closest position in the realPositions list to the given entity.
||Object with entity position and entity ID.|
||The world coordinates of the available offsets.|
The index of the closest offset position.