Page tree
Skip to end of metadata
Go to start of metadata


Introduced in

Version:1.65

Description

Description:

Creates or arranges a group of units in a formation. The formation parameters are read from the configuration files.

Note: Since formations require at least AWARE behavior, this function sets the behavior on units to AWARE by default.

Syntax

Syntax:[vehicles, position, dir, formation, showText, freezeSim] call fn_vbs_spawnFormation
Parameters:
  • vehicles: Array - Vehicles / units to arrange in formation.
  • position: Position-2 - Position of first formation member (leader).
  • dir: Number - Azimuth of formation.
  • formation: String - Name of formation (see setFormation).
  • showText: Boolean - If true, the function displays a text with the formation position number above each vehicle (optional, default false).
  • freezeSim: Boolean - If true, the vehicles have their setSimulationMode set to 1 (frozen) after they are arranged (optional, default false).
Return Value:vehicles: Array - The arranged vehicles.

Alternative Syntax

Syntax:[count, class, position, dir, formation, showText, freezeSim, arrows] call fn_vbs_spawnFormation
Parameters:
  • count: Number - Number of vehicles / units to create.
  • class: String - Type of vehicles / units to create.
  • position: Position-2 - Position of the first formation member (leader).
  • dir: Number - Azimuth of formation.
  • formation: String - Name of formation (see setFormation).
  • showText: Boolean - If true, the function displays a text with the formation position number above each vehicle (optional, default false).
  • freezeSim: Boolean - If true, the vehicles have their simulation mode set to 1 (frozen) after they are arranged (optional, default false).
  • arrows: Boolean - If true, the function ignores the class parameter, and creates red 3D arrows instead.
    Note: The unit / vehicle class name is still needed, as the function reads the formation spacing from CfgVehicles (optional, default false).
Return Value:vehicles: Array - The created vehicles.

Examples

Examples:
// Creates 5 AH-64 gunships in wedge formation 50m above the player, and displays their positions:
_pos = player modelToWorld [0,0,50];
helis = [5, "VBS2_US_AH64D_X", _pos, 0, "Wedge", true, true] call fn_vbs_spawnFormation
// Rearranges the helicopters from previous example to a line formation 30m above player:
_pos = player modelToWorld [0,0,30];
[helis, _pos, 0, "Line", false, true]  call fn_vbs_spawnFormation 

Additional Information

See also: setCustomFormation
Multiplayer: 
Problems: 

Notes