Arma 3 Scripting

BIS_fnc_moduleFriendlyFire

  • Arma 3 v1.00

Function · Markdown · JSON · original wiki page

Description

Handles friendly fire. This is the function of the Friendly Fire module (ModuleFriendlyFire_F): when the module is placed in the editor, it is called with the module logic and the units synchronised to the module are checked. It can also be called by scripts with one of the modes below. "Init" creates the global logic BIS_FriendlyFire and checks once per second whether the player committed friendly fire, which happens when:

The mission then ends for everyone with the failed ending "FriendlyFire" (see BIS_fnc_endMission). Every mode except "Init" returns false while the module is not initialised.

Syntax

Syntax 1

["Init", [units, activated]] call BIS_fnc_moduleFriendlyFire

Parameters:

Returns: Boolean - false if the module was already initialised, otherwise true

Syntax 2

["Destroy"] call BIS_fnc_moduleFriendlyFire

Parameters:

Returns: Boolean - true

Syntax 3

["AddUnits", [units]] call BIS_fnc_moduleFriendlyFire

Parameters:

Returns: Boolean - true

Syntax 4

["RemoveUnits", [units]] call BIS_fnc_moduleFriendlyFire

Parameters:

Returns: Boolean - true

Syntax 5

["ChangePriority", [vehicle, priority]] call BIS_fnc_moduleFriendlyFire

Parameters:

Returns: Boolean - true

Examples

Example 1

["Init", [[BIS_vip1, BIS_vip2, BIS_vipCar]]] call BIS_fnc_moduleFriendlyFire;    // BIS_vip1, BIS_vip2, BIS_vipCar and its crew are checked
["AddUnits", [[BIS_vip3]]] call BIS_fnc_moduleFriendlyFire;                        // BIS_vip3 is checked too
["ChangePriority", [BIS_vipCar, 1]] call BIS_fnc_moduleFriendlyFire;            // one hit on BIS_vipCar is friendly fire
["RemoveUnits", [[BIS_vip1]]] call BIS_fnc_moduleFriendlyFire;                    // BIS_vip1 is no longer checked

Example 2

["Init", []] call BIS_fnc_moduleFriendlyFire; // only the renegade state is checked

See also

BIS_fnc_endMission · rating · addRating