Jump to content
Sign in to follow this  
eXpouk

Random way to select spawn point using SetPos?

Recommended Posts

Hey guys,

This is probably a really noob question but I can't seem to find the answer anywhere. Basically I want to spawn a unit at the start of the mission at a random location that I've chosen using SetPosATL and not markers (so I can get a precise location inside buildings etc) For example a mission where you've got to find and kill the HVT but he could be in a few different buildings just for some replayability.

I know how to get a PosATL for a certain position (I use it to place units) I just dont know how to make it so it selects one at the start of the mission.

Thanks

Share this post


Link to post
Share on other sites

If you put all possible start positions into an array it could look like this:

_mystartpositions = [[0,0,0],[5234,7345,0]];
_rndstartposition = _mystartpositions call BIS_fnc_selectRandom;
player setpos _rndstartposition;

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  

×