targets: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 25: | Line 25: | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
|x1= <code>_targets = _unit [[targets]] [false, <nowiki>[east,sideEnemy]</nowiki>, 300]; //all east or renegade | |x1= <code>_targets = _unit [[targets]] [false, <nowiki>[east,sideEnemy]</nowiki>, 300]; //all targets of east or renegade side in 300m</code> |= | ||
|x2= <code>_targets = _unit [[targets]] [ | |x2= <code>_targets = _unit [[targets]] [true, <nowiki>[]</nowiki>, 300]; //enemy targets in 300m</code> |= | ||
|x3= <code>_targets = _unit [[targets]] []; //all targets</code> |= | |x3= <code>_targets = _unit [[targets]] []; //all targets</code> |= | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ |
Revision as of 12:44, 22 February 2017
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: Boolean - true to include only enemy targets, false to include all targets
- maxDistance: Number - max. distance based on target's expected position (distance is measured in 2D)
- sides: Array - array of accepted sides; if [] then this filter is ignored and all sides are considered
- maxAge: Number - max. target age; targets that are known to unit for longer then maxAge are ignored
- alternateCenter: 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, [east,sideEnemy], 300]; //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
[[Category:Introduced with arma3dev version 1.69]][[ Category: arma3dev: New Scripting Commands | TARGETS]][[ Category: arma3dev: Scripting Commands | TARGETS]]