Jump to content
Sign in to follow this  
super-truite

random location - vehicle spawn

Recommended Posts

I need for one of my projects to spawn vehicles randomly at some locations. Since I want this to be completely unpredictable, I need hundreds if not thousands of possible positions... I was going to do this with markers and ask my army of minions to place them correctly so that the vehicles don't explode when spawned :).

But I was wondering if this https://community.bistudio.com/wiki/nearestLocations is useful? Is there some locations that are reliable for spawning vehicles? If not, did you come up with a less boring (for my minions :)) solution?

Share this post


Link to post
Share on other sites

excellent! I will try

edit: It is quite unreliable in the end, and a lot of vehicles spawn on objects and explode (even though the primary goal of this command seems to be to avoid that). I guess I will do it the hard way.

In the end it shouldn't be too long and it could come in handy for mission creators.

Edited by super-truite

Share this post


Link to post
Share on other sites

Have you used the command like that?:

{
       _position = (getPosATL centerPosition) findEmptyPosition[ 1 , 100 , _x];
       _actualSpawnPos = _x createVehicle _position;
}foreach _myVehicles;

where _myVehicles is a list of classNames.

centerPosition can be a gamelogic with that name.

Share this post


Link to post
Share on other sites
Have you used the command like that?:

{
       _position = (getPosATL centerPosition) findEmptyPosition[ 1 , 100 , _x];
       _actualSpawnPos = _x createVehicle _position;
}foreach _myVehicles;

where _myVehicles is a list of classNames.

centerPosition can be a gamelogic with that name.

yes, except that I used a setpos after creating the vehicle at [0,0,0], as createvehicle is not so precise. I already started to place my markers anyway, and in the end, with help from others, it shouldn't be too long. It has also the advantage of making me able to select "interesting" areas and avoids spawning stuffs in illogical places.

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
Sign in to follow this  

×