Warner 0 Posted September 8, 2015 I have a map marker in Kavala, and I want to select a random building that is around it, but the building has to be in the valid building array. validHouse = [ "Land_i_House_Big_01_V1_F", "Land_i_House_Big_02_V1_F", "Land_i_House_Small_01_V1_F", "Land_i_House_Small_01_V2_F", "Land_i_House_Small_02_V1_F", "Land_i_House_Small_03_V1_F" and so on... ]; The way I have it setup now is it will select the building that is closest to the marker with kavalaMarker nearObjects [_randomHouse, 500]; But I would prefer it to be a random house, that is in the 'validHouse' array, inside the 500 radius. Anyone have a solution? Thanks! Share this post Link to post Share on other sites
jshock 513 Posted September 9, 2015 kavalaMarker nearObjects [(validHouse call BIS_fnc_selectRandom), 500]; Nevermind, started thinking about it, not as easy as that :P. Share this post Link to post Share on other sites
Greenfist 1863 Posted September 9, 2015 yourhouse = (nearestObjects [getMarkerPos "kavalaMarker", validHouse, 500]) call BIS_fnc_selectRandom; Share this post Link to post Share on other sites