Description
Sets the target priority (weight) of a unit, vehicle, group or side for the weapons of the alien drone. The weight is stored in the object variable "#bTargetPrio" (default 1 when not set) and is later read by:
- BIN_fnc_findTargetWeight, which picks the drone's target among nearby entities with selectRandomWeighted; entities with weight 0 are excluded
- BIN_fnc_missileSwarm, which picks missile targets among allUnits within 200 m; units with weight 0 or lower are excluded
The higher the weight, the more likely the target is to be selected. Objects initialised with BIN_fnc_behaviorInit and the drone module (BIN_fnc_initDroneModule) get weight 0.
Nothing in the Contact functions calls this function; it is meant to be used in mission scripts.
Important
- A vehicle passed as target gets the weight on the vehicle object only, not on its crew. BIN_fnc_findTargetWeight uses this value for the vehicle, but BIN_fnc_missileSwarm reads the weight of the units.
- For a unit that is inside a vehicle, the code runs
crew _xwhere_xis not defined by the function, so the weight is not set on that unit.- A Side only affects units that exist at the moment of the call.
Note
This content is exclusive to the Arma 3 Contact Expansion.
Syntax
[target, weight] call BIN_fnc_setTargetWeight
Parameters:
-
weight: Number - (Optional, default 1) target weight; 0 excludes the target from selection
Returns: Nothing
Examples
Example 1
[west, 0] call BIN_fnc_setTargetWeight; // all current BLUFOR units are ignored by the drone's weapons
Example 2
[player, 10] call BIN_fnc_setTargetWeight; // the player is much more likely to be targeted
Example 3
[group player, 0] call BIN_fnc_setTargetWeight; // the player's group is ignored