nul = [_base, _offset, _total, _facing, _stagger] execVM "targetarray.sqf";
_base = 2d or 3d position array
_offset = 2d offset array
_total = 2d total array
_facing = direction for targets to face
_stagger = TRUE or FALSE
e.g.
nul = [[2000,3000,0],[10,20],[4,8],90,TRUE] execVM "targetarray.sqf";
will place target array centered at 2000,3000, with 4 targets spaced 10m apart in east-west direction, and 8 targets spaced 20m apart in north-south direction, targets will be facing _dir degrees i.e. 90=east, _stagger set to TRUE will stagger the targets, FALSE will not.
edit:
targetarray.sqf
_x = (_this select 0) select 0;
_y = (_this select 0) select 1;
_dx = (_this select 1) select 0;
_dy = (_this select 1) select 1;
_nx = (_this select 2) select 0;
_ny = (_this select 2) select 1;
_dir = _this select 3;
_stagger = _this select 4;
_x = _x - _dx*_nx/2;
_y = _y - _dy*_ny/2;
for [{_j = 0},{_j < _ny},{_j = _j + 1}] do
{
if _stagger then {_x = _x + _dx/2 - (_j mod 2)*_dx;};
for [{_i = 0},{_i < _nx},{_i = _i + 1}] do
{
_pos = [_i*_dx + _x, _j*_dy + _y, 0];
_targ = CreateVehicle ["TargetEPopup", _pos,[],0, "NONE"];
_targ setDir _dir;
};
};