i made another version to have your units form a 180 degree arc in front of the group leader.
;formation_arc.sqs
_group = _this select 0
_dis = _this select 1
_units = units(_group)
?"alive _x" count _units >0:_units=_units-[leader _group]
_count = count(_units)
?_count<=1:goto "end"
_spokespacing=180/(_count-1)
_dir=(getdir player)-90
_i=0
_center=getpos leader (_this select 0)
#fanout
_unit = (_units select _i)
_ux = _center select 0
_uy = _center select 1
_vx = _ux+(_dis * sin(_dir))
_vy = _uy+(_dis * cos(_dir))
[_unit,_vx,_vy,_dir] exec "radialmove.sqs"
_dir=_dir+_spokespacing
#next
_i=_i+1
?_i<count(units _group):goto "fanout"
exit
And then renamed the first one:
;formation_circle.sqs
_group = _this select 0
_dis = _this select 1
_units = units(_group)
?"alive _x" count _units >0:_units=_units-[leader _group]
_count = count(_units)
?_count<=1:goto "end"
_spokespacing=360/_count
_dir=getdir player
_i=0
_center=getpos leader (_this select 0)
#fanout
_unit = (_units select _i)
_ux = _center select 0
_uy = _center select 1
_vx = _ux+(_dis * sin(_dir))
_vy = _uy+(_dis * cos(_dir))
[_unit,_vx,_vy,_dir] exec "radialmove.sqs"
_dir=_dir+_spokespacing
#next
_i=_i+1
?_i<count(units _group):goto "fanout"
exit
In my test mission I called these from the action menu
player addaction ["Defense - Arc","defarc.sqs"]
player addaction ["Defense - Circle","defcir.sqs"]
;defcir.sqs
[group player,10] exec "formation_circle.sqs"
exit
;defarc.sqs
[group player,10] exec "formation_arc.sqs"
exit
You could also call these from the radio menu just as easily.
I'm glad you brought this up. I'm going to use these in a mission