Arma 3 Scripting

BIN_fnc_setTargetWeight

  • Local effect
  • Arma 3 v1.94

Function · Markdown · JSON · original wiki page

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:

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 _x where _x is 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:

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

See also

BIN_fnc_findTargetWeight · selectRandomWeighted