Bit more than a hint, but still needs a lot of work to be worthwhile:
// Find config on a specific group.
_westInfGroupsCfg = configFile >> "CfgGroups" >> "West" >> "Infantry";
// Compile a list of group classes.
_westInfGroupInfo = [];
for "_i" from 0 to ((count _westInfGroupsCfg) - 1) do
{
_groupCfg = _westInfGroupsCfg select _i;
if (isClass _groupCfg) then
{
_westInfGroupInfo = _westInfGroupInfo +
[[getText (_groupCfg >> "name"), configName _groupCfg]];
// Or just fill up a listbox directly with this info.
};
};
hint str _westInfGroupInfo;
// based on a class name picked from _westInfGroupsCfg.
_westInfGroupsCfg = configFile >> "CfgGroups" >> "West" >> "Infantry";
_groupClass = westInfGroupsCfg >> "BasicInfantry";
// Create 25m North of the player.
_groupPos = getPos player;
_groupPos set [1, (_groupPos select 1) + 25];
_groupCfg = _westInfGroupsCfg >> _groupClass;
// Create a group to put them in.
_group = createGroup west;
for "_i" from 0 to ((count _groupCfg) - 1) do
{
_manCfg = _groupCfg select _i;
if (isClass _manCfg) then
{
_class = getText (_manCfg >> "vehicle");
_rank = getText (_manCfg >> "rank");
// Place at relative position, as they would be when placed in the
// editor. They will get into formation immediately.
_pos = getArray (_manCfg >> "position");
_pos set [0, (_pos select 0) + (_groupPos select 0)];
_pos set [1, (_pos select 1) + (_groupPos select 1)];
_pos set [2, (_pos select 2) + (_groupPos select 2)];
// (_manCfg >> "side") doesn't seem too important, since you are already
// looking at WEST units based on which config path you chose originally.
_unit = _group createUnit [_class, _pos, [], 0, "NONE"];
};
};
// Ensure that tracked vehicles PBO is loaded, just in case it isn't used in the
// mission.pbo already.
activateAddons ["catracked"];
_M1GroupCfg = configFile >> "CfgGroups" >> "West" >> "Armored" >> "M1Platoon";
// Create 50m South of the player.
_groupPos = getPos player;
_groupPos set [1, (_groupPos select 1) - 50];
_group = createGroup west;
for "_i" from 0 to ((count _M1GroupCfg) - 1) do
{
_vehCfg = _M1GroupCfg select _i;
if (isClass _vehCfg) then
{
// Create the vehicle.
_class = getText (_vehCfg >> "vehicle");
_rank = getText (_vehCfg >> "rank");
_pos = getArray (_vehCfg >> "position");
_pos set [0, (_pos select 0) + (_groupPos select 0)];
_pos set [1, (_pos select 1) + (_groupPos select 1)];
_pos set [2, (_pos select 2) + (_groupPos select 2)];
_vehicle = _class createVehicle _pos;
// Create the crew.
_vehicleConfig = configFile >> "CfgVehicles" >> _class;
_crewClass = getText (_vehicleConfig >> "crew");
// Driver.
for "_i" from 0 to ((_vehicle emptyPositions "driver") - 1) do
{
_unit = _group createUnit [_crewClass, _pos, [], 0, "NONE"];
_unit setRank _rank;
_unit assignAsDriver _vehicle;
_unit moveInDriver _vehicle;
};
// Gunner or gunners, if any.
for "_i" from 0 to ((_vehicle emptyPositions "gunner") - 1) do
{
_unit = _group createUnit [_crewClass, _pos, [], 0, "NONE"];
_unit setRank _rank;
_unit assignAsGunner _vehicle;
_unit moveInGunner _vehicle;
};
// Commander if any.
for "_i" from 0 to ((_vehicle emptyPositions "commander") - 1) do
{
_unit = _group createUnit [_crewClass, _pos, [], 0, "NONE"];
_unit assignAsCommander _vehicle;
_unit moveInCommander _vehicle;
};
};
};
EDIT: You'll notice I haven't bothered with directions of formation, soldiers or vehicles. Doesn't matter too much, since they will just get into formation as soon as they can anyway. If you are mad for rotating all the relative formation positions around the group position at creation, you might use something like SPON_mapRotatePoint2D which is in SPON Map (SPON\Map\initMaths.sqf). Alternatively, just use FormationDirection to point them in a specific direction, since, as I said, they'll run about getting into their formation when created anyway.