targetsQuery: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(description overhall)
Line 7: Line 7:
____________________________________________________________________________________________
____________________________________________________________________________________________


| Find all targets known to sender matching given query. |= Description
| Returns sorted array of targets, '''known''' to the querier (including own troops), where the accuracy coefficient reflects how close the result matches the query. This command could be CPU intensive. |= Description
____________________________________________________________________________________________
____________________________________________________________________________________________


| speaker '''targetsQuery''' [receiver,side,unit,place,time] |= Syntax
| querier '''targetsQuery''' [targetIgnore, targetSide, targetType, targetPosition, targetMaxAge] |= Syntax


|p1= speaker: [[Object]] - |= PARAMETER1  
|p1= querier: [[Object]] - For whom the query will be made |= PARAMETER1  


|p2= [receiver,side,unit,place,time]: [[Array]] - |= PARAMETER2  
|p2= [targetIgnore, targetSide, targetType, targetPosition, targetAgeLimit]: [[Array]] - Query |= PARAMETER2  


|p3= |= PARAMETER3  
|p3= targetIgnore: [[Object]] - Target object to exclude from results. [[objNull]] - return every target |= PARAMETER3
|p4= targetSide: [[Side]] - Desired side of the target. [[sideUnknown]] - any side |= PARAMETER3
|p5= targetType; [[String]] - Desired target [[typeOf]]. "" - any type |= PARAMETER3
|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|= PARAMETER3
|p7= targetMaxAge: [[Number]] - Desired max age of the target. This will limit returned results to the targets younger than specified age. 0 - any age|= PARAMETER3


| [[Array]] |= RETURNVALUE  
| [[Array]] - '''sorted''' array of returned targets in the following format:
<nowiki>[</nowiki>[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)
|= RETURNVALUE  




|x1= <pre>_candidates = _this targetsQuery [_from,_enemySide,"","",""];//ca\characters\scripts\reactCore_Full.fsm</pre>|= EXAMPLE1
|x1= Return all known targets for player:<code>_targets = [[player]] [[targetsQuery]] <nowiki>[</nowiki>[[objNull]], [[sideUnknown]], "", [], 0];</code>|= EXAMPLE1
|x2= Return all known OPFOR targets less than 10 seconds old:<code>_targets = [[player]] [[targetsQuery]] <nowiki>[</nowiki>[[objNull]], [[east]], "", [], 10];</code>|= EXAMPLE2


____________________________________________________________________________________________
____________________________________________________________________________________________


| [[targetsAggregate]] |= SEEALSO  
| [[targetsAggregate]], [[targetKnowledge]], [[knowsAbout]] |= SEEALSO  


|  |= MPBEHAVIOUR  
|  |= MPBEHAVIOUR  

Revision as of 00:33, 22 September 2015

Hover & click on the images for description

Description

Description:
Returns sorted array of targets, known to the querier (including own troops), where the accuracy coefficient reflects how close the result matches the query. This command could be CPU intensive.
Groups:
Uncategorised

Syntax

Syntax:
querier targetsQuery [targetIgnore, targetSide, targetType, targetPosition, targetMaxAge]
Parameters:
querier: Object - For whom the query will be made
[targetIgnore, targetSide, targetType, targetPosition, targetAgeLimit]: 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:
Return all known OPFOR targets less than 10 seconds old:_targets = player targetsQuery [objNull, east, "", [], 10];

Additional Information

See also:
targetsAggregatetargetKnowledgeknowsAbout

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

Notes

Bottom Section