Jump to content
Sign in to follow this  
xawery

Random starting positions

Recommended Posts

Hi all,

I'm trying to add an element of uncertainty to my MP mission, but, as per usual, I have little to no idea how to go about it.

I want to randomise the starting point of a player-controlled group. In other words, players select slots as normal, but they start the game at one of six possible starting locations.

Is this even possible? And if so, please share your wisdom with me smile_o.gif

Regards,

Xawery

Share this post


Link to post
Share on other sites

It's possible and quite simple too. First you use random to select one of the 6 positions, for example markers named pos1, pos2... and then setpos and forEach to move the group there.

I'm quite sure it's enough if you do something like this in a server side script. Like from init.sqs run the script: (server is a game logic named server, which is local only to the server)

?local server : [] exec "randomStart.sqs"

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_pos = getMarkerPos (["pos1","pos2","pos3","pos4","pos5","pos6"] select ((random 6) - 0.5))

{_x setpos _pos} forEach units groupAlpha

Where groupAlpha is the group name.

Share this post


Link to post
Share on other sites

Thanks a lot Metal Heart, I'll give it a try right now!

Share this post


Link to post
Share on other sites

I don't know about MP, but in SP its even easier than that. Create markers and Group them to the group leader. The group will appear randomly either where it is placed or at one of the marker positions.

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  

×