;placement_beta
randompos = [[[8712.51,1633.06,0],193.092],[[8695.72,1632.16,3.24218],175.425],[[8690.19,1631.55,3.09848],172.283],[[8676.48,1631.92,2.78604],183.858],[[8676.24,1635.88,2.87307],229.63],[[8686.87,1615.96,0],170.67],[[8675.81,1589.19,0],145.448],[[8690.56,1626.23,0],170.092]]
tangos = [a1,a2,a3,a4,a5,a6,a7,a8]
_ct = count tangos
_cp = count randompos
?_ct < _cp : hint "#error";exit
_i = 0
#loop
_r = random count tangos
_r = _r - _r %1
_unit = tangos select _r
tangos = tangos - [_unit]
_p = random count randompos
_p = _p - _p %1
_arr = randompos select _p
randompos = randompos - [_arr] <=== I think the problem is here
_rpos = (_arr select 0)
_dir = (_arr select 1)
_unit setpos _rpos
_unit setdir _dir
_i = _i + 1
~2
hint format ["%1\n%2",_i,count randompos]
?_i < _ct : goto "loop"
Each element in the randompos array contains a position array and a direction.
I put every unit from the tangos array in a randomly chosen position and each loop I update the randompos array by substracting the element.
But it doesn't happen... the array stays the same...
Some units are setposed on the same spot.
What am I doing wrong?