Jump to content
Warner

Select random building from multiple near a map marker.

Recommended Posts

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
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


yourhouse = (nearestObjects [getMarkerPos "kavalaMarker", validHouse, 500]) call BIS_fnc_selectRandom;

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×