Hi RB
Okay, this is messy and it might not work but here goes . . .
Set up 12 playable units, all single unit groups. Make all units SoldierWB (if West, otherwise make all units SoldierEB
). Put a Gamelogic on the map called server. Create a script that runs from each playable units Init field as follows.
[this] exec "setPlayers.sqs"; setPlayers.sqs
; if unit is not a player unit then delete it, exit script
_player = this select 0
? _player != player : deleteVehicle _player, exit
; pause to make sure all players in game then record player in an array
; shout it to the network so all players are added to count
~ random 1
playerCount = playerCount + [_player]
publicVariable playerCount
; stop all versions of script running except host version
? !(local server) : exit
; if number of players is less than 2 then end mission
? count playerCount < 2 : hint "Not enough players, at least two required !", ~5, forceEnd
; make first player the helicopter pilot
(playerCount select 0) moveInDriver helo1
; make the second player the squad leader
; make all remaining players members of his group
_ x = count playerCount
#enlistPlayers
_x = _x - 1
[playerCount select _x] join (playerCount select 1)
? _x >1 : goto "enlistPlayers"
; fill squad leader's group with AI units up to 12 members
_y = count units (playerCount select 1)
# enlistAI
_y = _y + 1
"SoldierWB" createUnit [getPos (playerCount select 1), group (playerCount select 1)]
? _y < 12 : goto "enlistAI"
exitYou should be able to just cut and paste the above code straight in to a script (fingers crossed). :thumbsup:
What it SHOULD do is delete all non-player playable units, assign the first player as the helo pilot, the second as the squad leader and the rest as members of the squad leader's group. Here's hoping !
Note that one problem that I can see with the script is that all player units must start as the same type, no matter who is boss. Please feel free to thrash the script to see if you can get around this.
Hope that it works for you !
Roni