Jump to content
Sign in to follow this  
Guest

Two waypoints 50% chance each one?

Recommended Posts

Guest

I usually use upsmon and let the groups do their own thing but I would like to use waypoints in this case. Is it possible to have two different waypoints with a 50% chance of the group using either one?

Share this post


Link to post
Share on other sites

G'day Acelondoner,

So what you want to do is.

- create two positions (the two possible positions of the wp's)

- assign them to an array

- get a random number and get the element from the array with index of the random number

- create a wp at that position

_wp1Pos = ["first position"];
_wp2Pos = ["second position"];

_wpArray = [_wp1Pos, wp2Pos];

_rndNum = round(random 2);
while {_rndNum = 0} do {
_rndNum = round(random 2);
};

_wpPos = _wpArray this select _rndNum;

_wp1 = grp addWaypoint [_wpPos, 0];

Hope this helps,

undercoverbrother

Share this post


Link to post
Share on other sites

If you don't want to create WPs with a script, then add both of them in the editor and randomly delete one of them.

Share this post


Link to post
Share on other sites
Guest

Thanks guys:thumb:

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  

×