targets: Difference between revisions
Lou Montana (talk | contribs) m (Text replacement - " *\|= * " to " ") |
Lou Montana (talk | contribs) m (Fix return value) |
||
| (26 intermediate revisions by 3 users not shown) | |||
| Line 1: | Line 1: | ||
{{ | {{RV|type=command | ||
| arma3 | | |game1= arma3 | ||
|version1= 1.70 | |||
| | |arg= global | ||
| | |gr1= Object Detection | ||
| | |descr= Retrieves list of given unit targets matching specified filter. If the filter is not specified, all targets are returned. | ||
{{Feature|informative|If a unit is provided, the unit itself will be excluded from results. If a group is provided, its units will be excluded (even if renegades).}} | |||
| | |s1= unitOrGroup [[targets]] [enemyOnly, maxDistance, sides, maxAge, alternateCenter] | ||
| | |p1= unitOrGroup: [[Object]] or {{GVI|arma3|2.12}} [[Group]] - unit or group which target knowledge is retrieved | ||
| | |p2= enemyOnly: [[Boolean]] - (Optional) [[true]] to include only enemy targets, [[false]] to include all targets | ||
|p3= | |p3= maxDistance: [[Number]] - (Optional) max. distance based on target's expected position ''(distance is measured in 2D)''; use 0 to ignore the maxDistance filter | ||
|p4= | |p4= sides: [[Array]] - (Optional) array of accepted sides; use [] to ignore the side filter | ||
|p5= | |p5= maxAge: [[Number]] - (Optional) max. target age, targets that are known to unit for longer then maxAge are ignored; use 0 to ignore the maxAge filter | ||
|p6= | |p6= alternateCenter: [[Array]] - (Optional) alternate (2D or 3D) position used for distance check ''(distance is measured in 2D)''; if not specified unit position is being used | ||
| | |r1= [[Array]] - ''unitOrGroup''<nowiki/>'s targets matching the criteria | ||
| [[ | |x1= <sqf>private _targets = _unit targets [false, 300, [east, sideEnemy]]; // all targets of east or renegade side in 300m</sqf> | ||
|x2= <sqf>private _targets = _unit targets [true, 300]; // enemy targets in 300m</sqf> | |||
|x3= <sqf>private _targets = _unit targets []; // all targets</sqf> | |||
|x3= < | |||
|seealso= [[targetsQuery]] [[nearTargets]] [[targetsAggregate]] [[targetKnowledge]] [[knowsAbout]] [[reveal]] [[forgetTarget]] [[setTargetAge]] [[getHideFrom]] [[side]] | |||
}} | }} | ||
Revision as of 10:23, 15 November 2022
Description
- Description:
- Retrieves list of given unit targets matching specified filter. If the filter is not specified, all targets are returned.
- Groups:
- Object Detection
Syntax
- Syntax:
- unitOrGroup targets [enemyOnly, maxDistance, sides, maxAge, alternateCenter]
- Parameters:
- unitOrGroup: Object or
2.12 Group - unit or group which target knowledge is retrieved - enemyOnly: Boolean - (Optional) true to include only enemy targets, false to include all targets
- maxDistance: Number - (Optional) max. distance based on target's expected position (distance is measured in 2D); use 0 to ignore the maxDistance filter
- sides: Array - (Optional) array of accepted sides; use [] to ignore the side filter
- maxAge: Number - (Optional) max. target age, targets that are known to unit for longer then maxAge are ignored; use 0 to ignore the maxAge filter
- alternateCenter: Array - (Optional) 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 - unitOrGroup's targets matching the criteria
Examples
- Example 1:
- Example 2:
- Example 3:
Additional Information
- See also:
- targetsQuery nearTargets targetsAggregate targetKnowledge knowsAbout reveal forgetTarget setTargetAge getHideFrom side
Notes
-
Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord.
Only post proven facts here! Add Note