Jump to content
hellstorm77

Spawning Vehicles on markers

Recommended Posts

Hello i was wondering if someone could help me. I trying to spawn Vehicles on markers. I would like to be able to set how may markers to use. So if i wanted 3 markers there would be 3 hunters on the map

 

_veh = createVehicle ["B_MRAP_01_F", getMarkerPos "car1", ["car2","car3"], 0, "CAN_COLLIDE"];

Share this post


Link to post
Share on other sites
Guest

Hello.

I'm not really sure you can do this. And i can't check the wiki / function right now but I think you could use a forEach instead.

_markerList = ["car_1","car_2"];
{
    "B_MRAP_01_F" createVehicle (getMarkerPos _x);
} forEach _markerList;
I will take a look into it later.

Share this post


Link to post
Share on other sites

Correct you would need to loop through an array of markers and spawn each vehicle. The markers array in the createVehicle command is to have that vehicle spawn at a random marker.

Share this post


Link to post
Share on other sites
Guest

If the array is in a list you can randomly choose one this way.

_index = round(random((count _myArray)-1));

Share this post


Link to post
Share on other sites

If the array is in a list you can randomly choose one this way.

 

_index = round(random((count _myArray)-1));

Or....

_index = _myArray 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

×