Jump to content
Casseburne

Random spawn script on defined point

Recommended Posts

Hi All !

 

I am pretty bad in script and even less on that of arma!

So for a specific mission I have to randomly spawn 1 ammoBox on one of 5 possible positions.

I think for example put traffic cones and replace randomly by a ammoBox but I can not do it.

 

Any Ideas?

Share this post


Link to post
Share on other sites
18 minutes ago, Casseburne said:

Hi All !

 

I am pretty bad in script and even less on that of arma!

So for a specific mission I have to randomly spawn 1 ammoBox on one of 5 possible positions.

I think for example put traffic cones and replace randomly by a ammoBox but I can not do it.

 

Any Ideas?

 

You can simply place traffic cones and name them (cone1,cone2, etc.) then use the following to spawn an ammocrate on a random cones position:

 

//init.sqf for SP

_cones = [cone1,cone2,cone3,cone4,cone5];
_pos = getPosATL selectRandom _cones;
{deleteVehicle _x} forEach _cones;
_crate = "B_CargoNet_01_ammo_F" createVehicle _pos;
_crate setPosATL _pos;//just in case createVehicle doesn't place it properly

Cheers

  • Like 2

Share this post


Link to post
Share on other sites

Or other script

 

Quote

_cache = "Box_East_Wps_F"; 

_cachePos = (selectRandom [cachePos01, cachePos02, cachePos03]);

cacheArme01 = createVehicle [_cache , _cachePos modelToWorld [0, 0, 0], [], 0, "CAN_COLLIDE"];    

sleep 0.5;

{deleteVehicle _x} forEach [cachePos01, cachePos02, cachePos03];

 

Thank 🙂

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

×