targetsQuery: Difference between revisions
BrettMayson (talk | contribs) mNo edit summary |
BrettMayson (talk | contribs) mNo edit summary |
||
| Line 27: | Line 27: | ||
|p4= targetType: [[String]] - desired target [[typeOf]]. "" - any type | |p4= targetType: [[String]] - desired target [[typeOf]]. "" - any type | ||
|p5= targetPosition: | |p5= targetPosition: [[Position#Introduction|Position2D]] or [[Position#Introduction|Position3D]] - desired target position (only [x,y] is considered). Position tolerance is 200m from the actual position of the target. [] - any position | ||
|p6= targetMaxAge: [[Number]] - desired max age of the target. This will limit returned results to the targets younger than specified age. 0 - any age | |p6= targetMaxAge: [[Number]] - desired max age of the target. This will limit returned results to the targets younger than specified age. 0 - any age | ||
Revision as of 07:55, 2 January 2026
Description
- Description:
- Returns sorted array of targets, known to the enquirer (including own troops), where the accuracy coefficient reflects how close the result matches the query. This command could be CPU intensive.
- Groups:
- Object Detection
Syntax
- Syntax:
- enquirer targetsQuery [targetIgnore, targetSide, targetType, targetPosition, targetMaxAge]
- Parameters:
- enquirer: Object - for whom the query will be made
- targetIgnore: Object - target object to exclude from results. objNull - return every target
- targetSide: Side - desired side of the target. sideUnknown - any side
- targetType: String - desired target typeOf. "" - any type
- targetPosition: Position2D or Position3D - desired target position (only [x,y] is considered). Position tolerance is 200m from the actual position of the target. [] - any position
- targetMaxAge: Number - desired max age of the target. This will limit returned results to the targets younger than specified age. 0 - any age
- Return Value:
- Array of Arrays with [accuracy, target, targetSide, targetType, targetPosition, targetAge]:
- accuracy: Number in range 0..1 - a coefficient, which reflects how close the returned result to the query filter. (1 - best match)
- target: Object - the actual target object
- targetSide: Side - side of the target
- targetType: String - target typeOf
- targetPosition: Array - [x,y] of the target
- targetAge: Number - the actual target age in seconds (can be negative)
Examples
- Example 1:
- Return all known targets for player:
- Example 2:
- Prioritise all known OPFOR targets and return targets less than 10 seconds old:
Additional Information
- See also:
- targets nearTargets targetsAggregate targetKnowledge knowsAbout reveal forgetTarget setTargetAge getHideFrom
Notes
-
Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord.
Only post proven facts here! Add Note