targetsQuery: Difference between revisions
Jump to navigation
Jump to search
m (Text replacement - "<h3 style='display:none'>Notes</h3> <dl class='command_description'> <!-- Note Section BEGIN --> <!-- Note Section END --> </dl> <h3 style='display:none'>Bottom Section</h3>" to "") |
Lou Montana (talk | contribs) m (Text replacement - " *\| *([Cc]omments|COMMENTS|Game|[Gg]ame [Nn]ame( +[0-9])?|Game [Vv]ersion( +[0-9])?|Game Version \(number surrounded by NO SPACES\)|Arguments in MP|MP[Aa]rg|Multiplayer Arguments( \("local" or "global"\))?|Effects|Execution|Effects...) |
||
Line 1: | Line 1: | ||
{{Command | {{Command | ||
| arma2 | | arma2 | ||
|1.00 | |1.00 | ||
|gr1= Object Detection | |gr1= Object Detection | ||
| 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. | | 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. | ||
| enquirer '''targetsQuery''' [targetIgnore, targetSide, targetType, targetPosition, targetMaxAge] | | enquirer '''targetsQuery''' [targetIgnore, targetSide, targetType, targetPosition, targetMaxAge] | ||
|p1= enquirer: [[Object]] - For whom the query will be made | |p1= enquirer: [[Object]] - For whom the query will be made | ||
|p2= [targetIgnore, targetSide, targetType, targetPosition, targetMaxAge]: [[Array]] - Query | |p2= [targetIgnore, targetSide, targetType, targetPosition, targetMaxAge]: [[Array]] - Query | ||
|p3= targetIgnore: [[Object]] - Target object to exclude from results. [[objNull]] - return every target | |p3= targetIgnore: [[Object]] - Target object to exclude from results. [[objNull]] - return every target | ||
|p4= targetSide: [[Side]] - Desired side of the target. [[sideUnknown]] - any side | |p4= targetSide: [[Side]] - Desired side of the target. [[sideUnknown]] - any side | ||
|p5= targetType: [[String]] - Desired target [[typeOf]]. "" - any type | |p5= targetType: [[String]] - Desired target [[typeOf]]. "" - any type | ||
|p6= targetPosition: [[Array]] - Desired target position in format of [[Position2D]] or [[Position3D]] (only [x,y] is considered). Position tolerance is 200m from the actual position of the target. [] - any position | |p6= targetPosition: [[Array]] - Desired target position in format of [[Position2D]] or [[Position3D]] (only [x,y] is considered). Position tolerance is 200m from the actual position of the target. [] - any position | ||
|p7= targetMaxAge: [[Number]] - Desired max age of the target. This will limit returned results to the targets younger than specified age. 0 - any age | |p7= targetMaxAge: [[Number]] - Desired max age of the target. This will limit returned results to the targets younger than specified age. 0 - any age | ||
| [[Array]] - '''sorted''' array of returned targets in the following format: | | [[Array]] - '''sorted''' array of returned targets in the following format: | ||
Line 29: | Line 29: | ||
* targetPosition: [[Array]] - [x,y] of the target | * targetPosition: [[Array]] - [x,y] of the target | ||
* targetAge: [[Number]] - the actual target age in seconds (can be negative) | * targetAge: [[Number]] - the actual target age in seconds (can be negative) | ||
|x1= Return all known targets for player:<code>_targets = [[player]] [[targetsQuery]] [<nowiki/>[[objNull]], [[sideUnknown]], "", [], 0];</code> | |||
|x2= Prioritise all known OPFOR targets and return targets less than 10 seconds old:<code>_targets = [[player]] [[targetsQuery]] [<nowiki/>[[objNull]], [[east]], "", [], 10];</code> | |||
| | | [[targetsAggregate]], [[targetKnowledge]], [[knowsAbout]], [[forgetTarget]] | ||
| | |||
}} | }} | ||
Revision as of 11:26, 18 January 2021
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, targetSide, targetType, targetPosition, targetMaxAge]: Array - Query
- 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: Array - Desired target position in format of Position2D or Position3D (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 - sorted array of returned targets in the following format:
[[accuracy, target, targetSide, targetType, targetPosition, targetAge],...] where:
- accuracy: Number - a coefficient, which reflects how close the returned result to the query filter. Range: 0 - 1 (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:
_targets = player targetsQuery [objNull, sideUnknown, "", [], 0];
- Example 2:
- Prioritise all known OPFOR targets and return targets less than 10 seconds old:
_targets = player targetsQuery [objNull, east, "", [], 10];
Additional Information
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