[evo] dan 79 Posted April 8, 2014 (edited) I have been trying to write a script that would detect any naval mines placed within a certain area and then put the names and position of each mine into an array, so I can store it for later use (persistency purposes). However, I tried to use the "nearObjects" command and it came up with an empty array. I thought it was something wrong with the code, so I tried a speedboat, and it picked it up fine (I was using the classname given in the editor on the popup to drop the unit down). However, when I tried my mine again, it still gave me an empty array. Am I missing something or is this a bug? So, to test here is what I am trying to do: -Place a Naval Mine (Moored) in the editor. (classname used - UnderwaterMine) -Place yourself near it in the water (less than 50m). -Then get the name and pos of the mine and put it into an array. It will do this for multiple mines within the area, but I haven't gotten it to work for even 1 yet. Can anybody help me out with this? Edited April 8, 2014 by [EVO] Dan Share this post Link to post Share on other sites
Larrow 2779 Posted April 8, 2014 _mines = (getpos player) nearobjects ["UnderwaterMine_Range_Ammo",50] _mines will be an array of all found. Share this post Link to post Share on other sites
[evo] dan 79 Posted April 8, 2014 Yep, that worked, thanks for that Larrow Share this post Link to post Share on other sites