CBA_fnc_taskDefend

Description

A function for a group to defend a parsed location.  Should be ran locally.

Units will mount nearby static machine guns and garrison in nearby buildings.  10% chance to patrol the radius unless specified differently (100% when no available building positions).  0% chance to hold defensive positions in combat unless specified differently.

Parameters

_groupthe group <GROUP, OBJECT>
_positioncentre of area to defend <ARRAY, OBJECT, LOCATION, GROUP> (Default: _group)
_radiusradius of area to defend <NUMBER> (Default: 50)
_thresholdminimum building positions required to be considered for garrison <NUMBER> (Default: 3)
_patrolchance for each unit to patrol instead of garrison, true for default, false for 0% <NUMBER, BOOLEAN> (Default: 0.1)
_holdchance for each unit to hold their garrison in combat, true for 100%, false for 0% <NUMBER, BOOLEAN> (Default: 0)

Returns

None

Examples

[this] call CBA_fnc_taskDefend

Author

Rommel, SilentSpike

Close