Skip to content

Premount

Hundenal edited this page Feb 10, 2022 · 3 revisions
File location f\preMount\fn_mountGroups.sqf
Enabled by default? Yes
Enable/Disable in In-Editor, (init.sqf)
Runs on Server

The preMount component allows mission makers to easily load one or more groups of players into pre-designated vehicles before the mission is started.

Usage

You can call the component using a line of code. For example, to mount MyGroup1 and MyGroup2 into MyTruck1 you would use the line:

[[MyTruck1],["MyGroup1","MyGroup2"]] call f_fnc_mountGroups;  

Alternatively you could also have a Game Logic object, which is synchronized with MyTruck1, and has the following code in its init field:

[synchronizedObjects this,["MyGroup1","MyGroup2"]] call f_fnc_mountGroups;  

Disabling the component

In the editor, find all the Game Logic objects whose name start with F3_preMount and delete them.

Parameters/Options

# name type description
0 Vehicles Array Array of vehicle names. e.g. [MyTruck1]
1 Groups Array Array of group names as strings. e.g. ["MyGroup1","MyGroup2"]
2 Crew (optional) Boolean Mount into crew positions? (default:true)
3 Fill (optional) Boolean Ignore fireteam cohesion in favor of filling vehicles? (default:false)

Using crew seats

By default, the preMount component will attempt to place units into crew seats first. You can control this by adding a third variable that is set to either true or false:

Value Result
true The default option - all crew slots will be filled first (in order of: driver>gunner>commander>turrets)
false Crew seats will be ignored and units placed into cargo seats

For example, to mount units from MyGroup1 and MyGroup2 into only the cargo seats of MyCar1 and MyTruck1, you would use the line:

[[MyTruck1,MyCar1],["MyGroup1","MyGroup2"],false] call f_fnc_mountGroups;

Maintaining group cohesion

By default, if mounting multiple groups into multiple vehicles, the preMount component will attempt to maintain group cohesion and not split their members across multiple vehicles. You can control this by adding a fourth variable that is set to either true or false:

Value Result
true Units are loaded into every available seat and group members may be split across multiple vehicles
false The default option - groups will not be split across multiple vehicles

Note: Whether crew seats are available is determined by the third variable (see above).

For example, to mount units from MyGroup1 and MyGroup2 into only the cargo seats of MyTruck1 and MyTruck2 and accept the splitting up of groups, you would use the line:

[[MyTruck1,MyTruck2],["MyGroup1","MyGroup2"],false,false] call f_fnc_mountGroups;

Tips

  • The component does not put units into locked vehicles and positions.
  • This component will only be able to put players into vehicles before the mission has started.
  • When using synchronizedObjects, the order of the synchronisations in which they were placed in the editor is used. So the first synchronized vehicle will be the first to be filled.
Clone this wiki locally