targets: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "|= |p5=" to "|PARAMETER4= |p5=")
m (Text replacement - "|= |p7=" to "|PARAMETER6= |p7=")
Line 22: Line 22:
|p5= sides (Optional): [[Array]] - array of accepted sides; use [] to ignore the side filter |PARAMETER5=
|p5= sides (Optional): [[Array]] - array of accepted sides; use [] to ignore the side filter |PARAMETER5=


|p6= maxAge (Optional): [[Number]] - max. target age, targets that are known to unit for longer then maxAge are ignored; use 0 to ignore the maxAge filter |=
|p6= maxAge (Optional): [[Number]] - max. target age, targets that are known to unit for longer then maxAge are ignored; use 0 to ignore the maxAge filter |PARAMETER6=
 
|p7= alternateCenter (Optional): [[Array]] - alternate (2D or 3D) position used for distance check ''(distance is measured in 2D)''; if not specified unit position is being used |=
|p7= alternateCenter (Optional): [[Array]] - alternate (2D or 3D) position used for distance check ''(distance is measured in 2D)''; if not specified unit position is being used |=



Revision as of 00:14, 21 December 2019

Hover & click on the images for description

Description

Description:
Retrives list of given unit targets matching specified filter. If the filter is not specified, all targets are returned.
Groups:
Uncategorised

Syntax

Syntax:
unit targets [enemyOnly, maxDistance, sides, maxAge, alternateCenter]
Parameters:
unit: Object - unit which target knowledge is retrieved
[enemyOnly, maxDistance, sides, maxAge, alternateCenter]: Array
enemyOnly (Optional): Boolean - true to include only enemy targets, false to include all targets
maxDistance (Optional): Number - max. distance based on target's expected position (distance is measured in 2D); use 0 to ignore the maxDistance filter
sides (Optional): Array - array of accepted sides; use [] to ignore the side filter
maxAge (Optional): Number - max. target age, targets that are known to unit for longer then maxAge are ignored; use 0 to ignore the maxAge filter
alternateCenter (Optional): Array - alternate (2D or 3D) position used for distance check (distance is measured in 2D); if not specified unit position is being used
Return Value:
Array - unit's targets matching the criteria

Examples

Example 1:
_targets = _unit targets [false, 300, [east,sideEnemy]]; //all targets of east or renegade side in 300m
Example 2:
_targets = _unit targets [true, 300]; //enemy targets in 300m
Example 3:
_targets = _unit targets []; //all targets

Additional Information

See also:
nearTargetstargetsQueryrevealside

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note

Notes

Bottom Section