targets: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
(syntax format)
Line 12: Line 12:
____________________________________________________________________________________________
____________________________________________________________________________________________


|  unit '''targets''' [enemyOnly,maxDistance,sides,maxAge,alternateCenter] |= Syntax
|  unit '''targets''' [enemyOnly, maxDistance, sides, maxAge, alternateCenter] |= Syntax


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


| [[Array]] - unit's targets matching the criteria |=  
| [[Array]] - unit's targets matching the criteria |=  
Line 30: Line 31:
____________________________________________________________________________________________
____________________________________________________________________________________________


| [[nearTargets]], [[targetsQuery]], [[reveal]], [[Side]] |= See also
| [[nearTargets]], [[targetsQuery]], [[reveal]], [[side]] |= See also


}}
}}

Revision as of 14:46, 22 February 2017

-wrong parameter ("arma3dev") defined!-[[:Category:Introduced with arma3dev version 1.69|1.69]]
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: 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); use 0 to ignore the maxDistance filter
sides: Array - array of accepted sides; use [] to ignore the side filter
maxAge: Number - max. target age, targets that are known to unit for longer then maxAge are ignored; use 0 to ignore the maxAge filter
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]]

Notes

Bottom Section