nearEntities: Difference between revisions
SilentKiller (talk | contribs) (Added suggestion for code optimization) |
m (see also & example formating) |
||
Line 33: | Line 33: | ||
|r2= [[Array]] of [[Object|Objects]] |= RETURNVALUE | |r2= [[Array]] of [[Object|Objects]] |= RETURNVALUE | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
|x1= < | |x1= <code> | ||
_list = player nearEntities 20; | _list = [[player]] [[nearEntities]] 20; | ||
_list = (position player) nearEntities 50; | _list = ([[position]] [[player]]) [[nearEntities]] 50; | ||
_list = (position player) nearEntities ["Land", 1000]; | _list = ([[position]] [[player]]) [[nearEntities]] ["Land", 1000]; | ||
_list = (position player) nearEntities ["LaserTarget", 3000]; | _list = ([[position]] [[player]]) [[nearEntities]] ["LaserTarget", 3000]; | ||
_list = (position player) nearEntities [["All"], 50]; | _list = ([[position]] [[player]]) [[nearEntities]] [["All"], 50]; | ||
_list = (position player) nearEntities [["Man", "Air", "Car", "Motorcycle", "Tank"], 200]; | _list = ([[position]] [[player]]) [[nearEntities]] [["Man", "Air", "Car", "Motorcycle", "Tank"], 200]; | ||
</ | </code>|= EXAMPLE1 | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
| [[ | | [[findNearestEnemy]], [[nearestBuilding]], [[nearestObject]], [[nearestObjects]], [[nearObjects]], [[nearestLocation]], [[nearTargets]], [[nearSupplies]], [[nearestLocationWithDubbing]], [[nearObjectsReady]], [[nearRoads]] |= SEEALSO | ||
| |= MPBEHAVIOUR | | |= MPBEHAVIOUR |
Revision as of 02:16, 30 July 2014
{{Command|= Comments ____________________________________________________________________________________________
| arma2 |= Game name
|1.00|= Game version ____________________________________________________________________________________________
| Find entities in the circle with given radius. If typeName(s) is (are) given, only entities of given type (or its subtype) are listed.
This command returns only alive entities. If you need to return dead entities as well use entities command. |= Description ____________________________________________________________________________________________
| position nearEntities radius |= Syntax
|p1= position: Object or Array (format Position) - center of the circle |= PARAMETER1
|p2= radius: Number - radius of the circle |= PARAMETER2
| Array of Objects|= RETURNVALUE ____________________________________________________________________________________________
|s2= position nearEntities [typeName, radius] |=
|p21= position: Object or Array (format Position) - center of the circle |= PARAMETER1
|p22= [typeName, radius]: Array |= PARAMETER2
|p23= typeName: String or Array of Strings - typeName(s) to search for |= PARAMETER3
|p24= radius: Number - radius of the circle |= PARAMETER4
|r2= Array of Objects |= RETURNVALUE
____________________________________________________________________________________________
|x1=
_list = player nearEntities 20;
_list = (position player) nearEntities 50;
_list = (position player) nearEntities ["Land", 1000];
_list = (position player) nearEntities ["LaserTarget", 3000];
_list = (position player) nearEntities [["All"], 50];
_list = (position player) nearEntities [["Man", "Air", "Car", "Motorcycle", "Tank"], 200];
|= EXAMPLE1
____________________________________________________________________________________________
| findNearestEnemy, nearestBuilding, nearestObject, nearestObjects, nearObjects, nearestLocation, nearTargets, nearSupplies, nearestLocationWithDubbing, nearObjectsReady, nearRoads |= SEEALSO
| |= MPBEHAVIOUR ____________________________________________________________________________________________ }}
Notes
- Posted on 27 Mar, 2014
- Floriangeyer
- According to Code Optimisation, this function is the fastest and should be used instead of nearestObjects.