nearObjects: Difference between revisions
Jump to navigation
Jump to search
Tankbuster (talk | contribs) No edit summary |
Tankbuster (talk | contribs) No edit summary |
||
Line 45: | Line 45: | ||
<dd class="notedate">Posted on December 15, 2011 - 23:17 | <dd class="notedate">Posted on December 15, 2011 - 23:17 | ||
<dt class="note">'''[[User:Tankbuster|Tankbuster]]'''<dd class="note"> | <dt class="note">'''[[User:Tankbuster|Tankbuster]]'''<dd class="note"> | ||
In the second example, you can't omit the typeName parameter. It's required and you'll get an error if you don't supply it. Use "All" as an alternative to leaving it out. (CO 1.59) | |||
<dd class="notedate">Posted on November 29, 2012 - 19:59 | <dd class="notedate">Posted on November 29, 2012 - 19:59 | ||
<dt class="note">'''[[User:Tankbuster|Tankbuster]]'''<dd class="note"> | <dt class="note">'''[[User:Tankbuster|Tankbuster]]'''<dd class="note"> | ||
nearObjects can find triggers if you supply typename "emptydetector". | nearObjects can find triggers if you supply typename "emptydetector". | ||
<dd class="notedate">Posted on January 3 2013 - 22:23 | |||
If you use the first example, it will return objects many more objects such as pollen, honeybees and crucially, triggers. Triggers will show in the returned array as 'no shape' but you can use typeOf to get the classname, which will give 'EmptyDetector'. | |||
<dt class="note">'''[[User:Tankbuster|Tankbuster]]'''<dd class="note"> | |||
nearObjects can find triggers if you supply typename "emptydetector". | |||
<!-- Note Section END --> | <!-- Note Section END --> | ||
</dl> | </dl> |
Revision as of 23:34, 2 January 2013
Description
- Description:
- Find objects in the circle with given radius.
If typeName is given, only objects of given type (or its subtype) are listed.
The first object in the returned array is not necessarily the closest one (like it is in nearestObjects for example). - Groups:
- Uncategorised
Syntax
- Syntax:
- position nearObjects radius or [typeName, radius]
- Parameters:
- position: Array - format Position
- [typeName, radius]: Array
- typeName: String
- radius: Number
- Return Value:
- Array
Examples
- Example 1:
_list = position player nearObjects 50
- Example 2:
_list= [_xpos,_ypos] nearObjects ["House",20]
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
Notes
- Posted on June 30, 2007 - 08:21
- Kronzky
- Units in vehicles are not detected via this command.
- Posted on December 15, 2011 - 23:17
- Tankbuster
- In the second example, you can't omit the typeName parameter. It's required and you'll get an error if you don't supply it. Use "All" as an alternative to leaving it out. (CO 1.59)
- Posted on November 29, 2012 - 19:59
- Tankbuster
- nearObjects can find triggers if you supply typename "emptydetector".
- Posted on January 3 2013 - 22:23 If you use the first example, it will return objects many more objects such as pollen, honeybees and crucially, triggers. Triggers will show in the returned array as 'no shape' but you can use typeOf to get the classname, which will give 'EmptyDetector'.
- Tankbuster
- nearObjects can find triggers if you supply typename "emptydetector".