Greets,
You could do this in a variety of ways.
If the group leader is the commander, then the second in the group will be the gunner, the third the driver, correct? Then:
_gunner = (units groupName) select 1
_gunner moveInGunner tankName
_driver = (units groupName) select 2
_driver moveInDriver tankName.
[EDIT: Added 'Units' command. You may or may not need the brackets, I can never get those right... ]Would select the second and third members of the group, and make them the gunner/ driver.
-or-
An alternative method is this: One problem with the createUnit command is that it does not return anything. So you cannot put
_gunner = "SoldierWB" createUnit [
blah, blah, blah]
However there is a workaround: This is MacGuba's example:
"SoldierWB" createUnit [getMarkerPos "marker_1", groupAlpha, "loon1 = this; this addweapon {binocular}", 0.6, "corporal"]
Where it says "loon1 = this; this addWeapon {binocular}", is the init line. This does exactly the same thing as the init field in the 'edit unit' dialog, in the editor. You could put "gunnerTank1 = this" in this area, and then use the code
gunnerTank1 assignAsGunner tank1
in your script.
A couple of workarounds for you... ;D
-Supreme Commander PsyWarrior
-Psychic Productions Command