Difference between revisions of "inAreaArray"

From Bohemia Interactive Community
Jump to navigation Jump to search
(Created page with "{{Command|= ____________________________________________________________________________________________ | arma3dev |= Game |1.65|= Game Version (number surrounded by NO SPA...")
 
m (Text replacement - "|= Game " to "|Game= ")
 
(15 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{Command|=
+
{{Command|Comments=
 
____________________________________________________________________________________________
 
____________________________________________________________________________________________
  
| arma3dev |= Game
+
| arma3 |Game=
  
|1.65|= Game Version (number surrounded by NO SPACES)
+
|1.66|Game Version= (number surrounded by NO SPACES)
  
|arg=  |= Multiplayer Arguments ("local" or "global")
+
|arg=  |Multiplayer Arguments= ("local" or "global")
  
|eff=  |= Multiplayer Effects ("local" or "global")
+
|eff=  |Multiplayer Effects= ("local" or "global")
  
 
|exec=  |= Multiplayer Execution ("server" or empty)
 
|exec=  |= Multiplayer Execution ("server" or empty)
 
____________________________________________________________________________________________
 
____________________________________________________________________________________________
  
| Filters given [[Array]] of [[Object]]s or [[Position]]s by given trigger area. |= Description
+
| Filters given list of [[Object]]s and/or [[Position]]s in relation to the given area, defined by a trigger, marker, location or array. Returns array of [[Object]]s and/or [[Position]]s from the list that are inside the area |DESCRIPTION=
 
____________________________________________________________________________________________
 
____________________________________________________________________________________________
  
|[input] '''inAreaArray''' trigger |= Syntax
+
|positions '''inAreaArray''' trigger |SYNTAX=
  
|p1= [[Array]] of  [[Object]]s or [[Position]]s - input|= Parameter 1
+
|p1= positions: [[Array]] - [[Object]]s and/or [[Position]]s to check|PARAMETER1=
  
|p2= Trigger  |= Parameter 2
+
|p2= trigger: [[Object]] - trigger with given area |PARAMETER2=
  
 +
| [[Array]]: [[Object]]s and/or [[Position]]s inside the trigger area|RETURNVALUE=
  
| [[Array]]: Array with objects or positions inside the trigger area |= Return Value
+
|s2=positions '''inAreaArray''' marker |SYNTAX2=
  
 +
|p21= positions: [[Array]] - [[Object]]s and/or [[Position]]s to check|PARAMETER21=
  
 +
|p22= marker: [[String]] - marker with given area |PARAMETER2=
 +
 +
|r2= [[Array]]: [[Object]]s and/or [[Position]]s inside the marker area|RETURNVALUE=
 +
 +
|s3=positions '''inAreaArray''' location |SYNTAX=
 +
 +
|p41= positions: [[Array]] - [[Object]]s and/or [[Position]]s to check|PARAMETER1=
 +
 +
|p42= location: [[Location]] - location with given area |PARAMETER2=
 +
 +
|r3= [[Array]]: [[Object]]s and/or [[Position]]s inside the location area|RETURNVALUE=
 +
 +
|s4= positions '''inAreaArray''' [center, a, b, angle, isRectangle, c]|SYNTAX=
 +
|p61= positions: [[Array]] - [[Object]]s and/or [[Position]]s to check|PARAMETER1=
 +
|p62= [center, a, b, angle, isRectangle, c]: [[Array]]|PARAMETER2=
 +
|p63= center: [[Array]] - center of the area in format [[Position3D]], [[Position2D]] |PARAMETER2=
 +
|p64= a: [[Number]] - x axis (x / 2) |PARAMETER2=
 +
|p65= b: [[Number]] - y axis (y / 2) |PARAMETER2=
 +
|p66= angle (Optional): [[Number]] - rotation angle. Default: 0  |PARAMETER2=
 +
|p67= isRectangle (Optional): [[Boolean]] - [[true]] if rectangle, [[false]] if ellipse. Default: [[false]]|PARAMETER2=
 +
|p68= c (Optional): [[Number]] - z axis (z / 2). Default: -1 (unlimited)|PARAMETER2=
 +
|r4= [[Array]]: [[Object]]s and/or [[Position]]s inside the area |RETURNVALUE=
 
____________________________________________________________________________________________
 
____________________________________________________________________________________________
  
|x1= [ [[vehicles]] ] '''inAreaArray''' trigger_1  |= Example 1
+
|x1= <code>[[vehicles]] [[inAreaArray]] trigger_1;</code> |EXAMPLE1=
 +
|x2= <code>[[allUnits]] [[inAreaArray]] marker_1;</code> |EXAMPLE2=
 +
|x3= <code>[[allPlayers]] [[inAreaArray]] location_1;</code> |EXAMPLE3=
 +
|x4= <code>[[allDead]] [[inAreaArray]] <nowiki>[</nowiki>[100, 100, 0], 20, 30, 45, [[false]], 10];</code>|=
 
____________________________________________________________________________________________
 
____________________________________________________________________________________________
  
|mp= - |= Multiplayer Behaviour
+
|mp= - |Multiplayer Behaviour=
  
| |= See Also
+
| [[inArea]], [[triggerArea]] |SEEALSO=
  
 
}}
 
}}
Line 39: Line 66:
 
<dl class="command_description">
 
<dl class="command_description">
 
<!-- BEGIN Note Section -->
 
<!-- BEGIN Note Section -->
<!-- For example:
 
<dd class="notedate">Posted on Month Day, Year - Time (UTC)</dd>
 
<dt class="note">'''[[User:User Name|User Name]]'''</dt>
 
<dd class="note">This is an example note. It is true and verifiable, and contains a little code snippet.
 
<code>[[if]] ([[_this]] == anExample) [[then]] { [[hint]] "Leave it here for others to read"; };</code></dd>
 
-->
 
 
<!-- END Note Section -->
 
<!-- END Note Section -->
 
</dl>
 
</dl>
Line 53: Line 74:
 
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
 
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
 
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]
 
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]
 +
 +
<!-- CONTINUE Notes -->
 +
<dl class="command_description">
 +
<dd class="notedate">Posted on June 11, 2017 - 21:33 (UTC)</dd>
 +
<dt class="note">[[User:Tankbuster|Tankbuster]]</dt>
 +
<dd class="note">
 +
The array you send the command can be filtered. For example:
 +
<code>[[vehicles]] [[inAreaArray]] "mymarker" [[select]] {_x [[isKindOf]] "StaticWeapon"}</code>
 +
Will return only the statics inside the given marker
 +
</dd>
 +
</dl>
 +
<!-- DISCONTINUE Notes -->

Latest revision as of 16:46, 29 September 2019

Introduced with Arma 3 version 1.66
  

Click on the images for descriptions

Introduced in

Game:
Arma 3
Version:
1.66

Description

Description:
Filters given list of Objects and/or Positions in relation to the given area, defined by a trigger, marker, location or array. Returns array of Objects and/or Positions from the list that are inside the area

Syntax

Syntax:
positions inAreaArray trigger
Parameters:
positions: Array - Objects and/or Positions to check
trigger: Object - trigger with given area
Return Value:
Array: Objects and/or Positions inside the trigger area

Alternative Syntax

Syntax:
positions inAreaArray marker
Parameters:
positions: Array - Objects and/or Positions to check
marker: String - marker with given area
Return Value:
Array: Objects and/or Positions inside the marker area

Alternative Syntax 2

Syntax:
positions inAreaArray location
Parameters:
positions: Array - Objects and/or Positions to check
location: Location - location with given area
Return Value:
Array: Objects and/or Positions inside the location area

Alternative Syntax 3

Syntax:
positions inAreaArray [center, a, b, angle, isRectangle, c]
Parameters:
positions: Array - Objects and/or Positions to check
[center, a, b, angle, isRectangle, c]: Array
center: Array - center of the area in format Position3D, Position2D
a: Number - x axis (x / 2)
b: Number - y axis (y / 2)
angle (Optional): Number - rotation angle. Default: 0
isRectangle (Optional): Boolean - true if rectangle, false if ellipse. Default: false
c (Optional): Number - z axis (z / 2). Default: -1 (unlimited)
Return Value:
Array: Objects and/or Positions inside the area

Examples

Example 1:
vehicles inAreaArray trigger_1;
Example 2:
allUnits inAreaArray marker_1;
Example 3:
allPlayers inAreaArray location_1;
Example 4:
allDead inAreaArray [[100, 100, 0], 20, 30, 45, false, 10];

Additional Information

Multiplayer:
-
See also:
inAreatriggerArea

Notes

Only post proven facts here. Report bugs on the feedback tracker. Use the talk page or the forums for discussions.
Add New Note | How To

Bottom Section

Posted on June 11, 2017 - 21:33 (UTC)
Tankbuster
The array you send the command can be filtered. For example: vehicles inAreaArray "mymarker" select {_x isKindOf "StaticWeapon"} Will return only the statics inside the given marker