targetsAggregate: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(added more specific info)
(Updated SEE ALSO)
 
(25 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Command|Comments=
{{RV|type=command
____________________________________________________________________________________________


| arma2 |Game name=
|game1= arma2
|version1= 1.00


|1.00|Game version=
|game2= arma2oa
____________________________________________________________________________________________
|version2= 1.50


| Aggregate candidates. |DESCRIPTION=
|game3= tkoh
____________________________________________________________________________________________
|version3= 1.00


| [speaker, side, unit, place, time] '''targetsAggregate''' candidates |SYNTAX=
|game4= arma3
|version4= 0.50


|p1= [speaker, side, unit, place, time]: [[Array]] |PARAMETER1=  
|descr= Aggregate candidates.


|p2= candidates: [[Array]] -  array of targets in the following format:
|gr1= Object Manipulation
<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)|PARAMETER2=


| [[Array]] |RETURNVALUE=
|s1= [speaker, side, classname, position, timeMax] [[targetsAggregate]] candidates


|x1 = <pre>_aggregation = [player, sideEnemy, "", [], 0] targetsAggregate (player targetsQuery [objNull, sideUnknown, "", [], 0])</pre>could return something like this: <br>
|p1= speaker: [[Object]]
<nowiki>[[["COUNT0",1],["SIDE0",WEST],["UNIT0","B_Soldier_F"],["PLACE0",[[<null>,<null>],0,<null>]],["TIME0",[-0.9,-0.9]],["UCOUNT0",1],["UTYPE0","...</nowiki>|EXAMPLE1=


____________________________________________________________________________________________
|p2= side: [[Side]] - if provided, a target with a side matching ''side'' will see it replaced by {{hl|"$"}}


| [[targetsQuery]], [[forgetTarget]] |SEEALSO=
|p3= classname: [[String]] - {{hl|CfgVehicles}} classname - if provided, a target with a type matching ''classname'' will see it replaced by {{hl|"$"}}


| |MPBEHAVIOUR=  
|p4= position: [[Array]] format [[Position]] (Z-value is ignored) - centre of a hardcoded 200m radius
____________________________________________________________________________________________
}}


<h3 style='display:none'>Notes</h3>
|p5= timeMax: [[Number]] - max age of the target
<dl class='command_description'>
<!-- Note Section BEGIN -->


<!-- Note Section END -->
|p6= candidates: [[Array]] -  array of targets in format [<nowiki/>[accuracy, target, targetSide, targetType, targetPosition, targetAge], ...] where:
</dl>
* accuracy: [[Number]] - a coefficient, which reflects how close the returned result to the query filter. Range: 0..1, 1 being the best match
* target: [[Object]] - the actual target object
* targetSide: [[Side]] - side of the target
* targetType: [[String]] - target [[typeOf]]
* targetPosition: [[Array]] format [[Position#Introduction|Position2D]] - [x,y] of the target
* targetAge: [[Number]] - the actual target age in seconds (can be negative)
{{Feature|informative|See [[targetsQuery]] format.}}
 
|r1= [[Array]] format [countInfo, sideInfo, unitInfo, placeInfo, timeInfo, uCountInfo, uTypeInfo]:
* countInfo: [[Array]] - [<nowiki/>[[format]] ["COUNT%1", index], count on index]
* sideInfo: [[Array]] - [<nowiki/>[[format]] ["SIDE%1", index], side or string] if string then $ == "equal to queried"
* unitInfo: [[Array]] - [<nowiki/>[[format]] ["UNIT%1", index], string]  $ == "equal to queried", otherwise the "type" of the unit? Should be CfgVehicles config type I think
* placeInfo: [[Array]] - [<nowiki/>[[format]] ["PLACE%1", index], [[centerX, centerY], radius]]
* timeInfo: [[Array]] - [<nowiki/>[[format]] ["TIME%1", index], string or array] if string then $ == "equal to queried", otherwise [timeMin, timeMax]
* uCountInfo: [[Array]] - [<nowiki/>[[format]] ["UCOUNT%1", index], scalar count]
* uTypeInfo: [[Array]] - [<nowiki/>[[format]] ["UTYPE%1", index], string name] a classname? Will be format ["*%1", classname] if count &gt; 1


<h3 style='display:none'>Bottom Section</h3>
|x1= <sqf>_aggregation = [player, sideEnemy, "", [], 0] targetsAggregate (player targetsQuery [objNull, sideUnknown, "", [], 0]);
/*
returns e.g
[
[
["COUNT0", 1],
["SIDE0", WEST],
["UNIT0", "B_Soldier_F"],
["PLACE0", [[<null>,<null>], 0, <null>]],
["TIME0", [-0.9, -0.9]],
["UCOUNT0", 1],
["UTYPE0", ...
]
]
*/
</sqf>
with e.g
* one Orca Helicopter
* one T-100 Varsuk tank
* one T-140K Angara tank
* one MBT-52 Kuma tank (independent, set as enemy to blufor)
<sqf>
/*
[
[["COUNT0",1],["SIDE0",EAST],["UNIT0","O_Heli_Light_02_dynamicLoadout_F"],["PLACE0",[[<null>,<null>],0,<null>]],["TIME0",[-0.982,-0.982]],["UCOUNT0",1],["UTYPE0","O_Heli_Light_02_dynamicLoadout_F"]],
[["COUNT1",1],["SIDE1",GUER],["UNIT1","I_MBT_03_cannon_F"],["PLACE1",[[<null>,<null>],0,<null>]],["TIME1",[-0.982,-0.982]],["UCOUNT1",1],["UTYPE1","I_MBT_03_cannon_F"]],
[["COUNT2",2],["SIDE2",EAST],["UNIT2","*Tank_F"],["PLACE2",[[<null>,<null>],4.34554,<null>]],["TIME2",[-0.982,-0.982]],["UCOUNT2",2],["UTYPE2","*O_MBT_02_cannon_F"]]]
[
[["COUNT0",1],["SIDE0",EAST],["UNIT0","O_Heli_Light_02_dynamicLoadout_F"],["PLACE0",[[<null>,<null>],0,<null>]],["TIME0",[-1,-1]],["UCOUNT0",1],["UTYPE0","O_Heli_Light_02_dynamicLoadout_F"]],
[["COUNT1",1],["SIDE1",GUER],["UNIT1","I_MBT_03_cannon_F"],["PLACE1",[[<null>,<null>],0,<null>]],["TIME1",[-1,-1]],["UCOUNT1",1],["UTYPE1","I_MBT_03_cannon_F"]],
[["COUNT2",2],["SIDE2",EAST],["UNIT2","*Tank_F"],["PLACE2",[[<null>,<null>],4.34565,<null>]],["TIME2",[-1,-1]],["UCOUNT2",2],["UTYPE2","*O_MBT_02_cannon_F"]]
]
*/
</sqf>


[[Category:Scripting Commands Arma 2|{{uc:{{PAGENAME}}}}]]
|seealso= [[targets]] [[targetsQuery]] [[nearTargets]] [[targetKnowledge]] [[knowsAbout]] [[reveal]] [[forgetTarget]] [[setTargetAge]] [[getHideFrom]]
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
}}
[[Category:Scripting_Commands_Take_On_Helicopters|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]

Latest revision as of 12:37, 7 September 2022

Hover & click on the images for description

Description

Description:
Aggregate candidates.
Groups:
Object Manipulation

Syntax

Syntax:
[speaker, side, classname, position, timeMax] targetsAggregate candidates
Parameters:
speaker: Object
side: Side - if provided, a target with a side matching side will see it replaced by "$"
classname: String - CfgVehicles classname - if provided, a target with a type matching classname will see it replaced by "$"
position: Array format Position (Z-value is ignored) - centre of a hardcoded 200m radius
timeMax: Number - max age of the target
candidates: Array - array of targets in 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 being the best match
  • target: Object - the actual target object
  • targetSide: Side - side of the target
  • targetType: String - target typeOf
  • targetPosition: Array format Position2D - [x,y] of the target
  • targetAge: Number - the actual target age in seconds (can be negative)
See targetsQuery format.
Return Value:
Array format [countInfo, sideInfo, unitInfo, placeInfo, timeInfo, uCountInfo, uTypeInfo]:
  • countInfo: Array - [format ["COUNT%1", index], count on index]
  • sideInfo: Array - [format ["SIDE%1", index], side or string] if string then $ == "equal to queried"
  • unitInfo: Array - [format ["UNIT%1", index], string] $ == "equal to queried", otherwise the "type" of the unit? Should be CfgVehicles config type I think
  • placeInfo: Array - [format ["PLACE%1", index], [[centerX, centerY], radius]]
  • timeInfo: Array - [format ["TIME%1", index], string or array] if string then $ == "equal to queried", otherwise [timeMin, timeMax]
  • uCountInfo: Array - [format ["UCOUNT%1", index], scalar count]
  • uTypeInfo: Array - [format ["UTYPE%1", index], string name] a classname? Will be format ["*%1", classname] if count > 1

Examples

Example 1:
_aggregation = [player, sideEnemy, "", [], 0] targetsAggregate (player targetsQuery [objNull, sideUnknown, "", [], 0]); /* returns e.g [ [ ["COUNT0", 1], ["SIDE0", WEST], ["UNIT0", "B_Soldier_F"], ["PLACE0", [[<null>,<null>], 0, <null>]], ["TIME0", [-0.9, -0.9]], ["UCOUNT0", 1], ["UTYPE0", ... ] ] */
with e.g
  • one Orca Helicopter
  • one T-100 Varsuk tank
  • one T-140K Angara tank
  • one MBT-52 Kuma tank (independent, set as enemy to blufor)
/* [ [["COUNT0",1],["SIDE0",EAST],["UNIT0","O_Heli_Light_02_dynamicLoadout_F"],["PLACE0",[[<null>,<null>],0,<null>]],["TIME0",[-0.982,-0.982]],["UCOUNT0",1],["UTYPE0","O_Heli_Light_02_dynamicLoadout_F"]], [["COUNT1",1],["SIDE1",GUER],["UNIT1","I_MBT_03_cannon_F"],["PLACE1",[[<null>,<null>],0,<null>]],["TIME1",[-0.982,-0.982]],["UCOUNT1",1],["UTYPE1","I_MBT_03_cannon_F"]], [["COUNT2",2],["SIDE2",EAST],["UNIT2","*Tank_F"],["PLACE2",[[<null>,<null>],4.34554,<null>]],["TIME2",[-0.982,-0.982]],["UCOUNT2",2],["UTYPE2","*O_MBT_02_cannon_F"]]] [ [["COUNT0",1],["SIDE0",EAST],["UNIT0","O_Heli_Light_02_dynamicLoadout_F"],["PLACE0",[[<null>,<null>],0,<null>]],["TIME0",[-1,-1]],["UCOUNT0",1],["UTYPE0","O_Heli_Light_02_dynamicLoadout_F"]], [["COUNT1",1],["SIDE1",GUER],["UNIT1","I_MBT_03_cannon_F"],["PLACE1",[[<null>,<null>],0,<null>]],["TIME1",[-1,-1]],["UCOUNT1",1],["UTYPE1","I_MBT_03_cannon_F"]], [["COUNT2",2],["SIDE2",EAST],["UNIT2","*Tank_F"],["PLACE2",[[<null>,<null>],4.34565,<null>]],["TIME2",[-1,-1]],["UCOUNT2",2],["UTYPE2","*O_MBT_02_cannon_F"]] ] */

Additional Information

See also:
targets targetsQuery nearTargets targetKnowledge knowsAbout reveal forgetTarget setTargetAge getHideFrom

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