There's a
"" missing in your creatunit line.
The basic command is:
"SoldierWB" createUnit [getMarkerPos "barracks", groupAlpha]The last 3 values are optional:
["", 0.5, "PRIVATE"]However, if you choose to use one of the last 3 values, you write all 3 values into the command:
"SoldierWB" createUnit [getMarkerPos "barracks", groupAlpha,"", 0.5, "PRIVATE"]More infos:
The group you want to spawn your 1st soldier into, has to exist from the start. What you need is to place a soldier in the editor with "alpha = group this" in its init-line. You may pull the dammage slider all to the left, so he's dead at mission start. The group alpha still exists however.
In my case, i use a group named 'eastdummygroup', because 'groupAlpha' is used by OpF automaticly when making new groups - could lead to problems when respawning again and again.
For example, this is how i spawn my officer:
"OfficerE" createUnit [getPos _mybase, eastdummygroup,"this exec {dead.sqs}"]
Dead.sqs checks if he's alive every 30 sek, and if he's not, his body will disappear from the battlefield (reduces lag).
The eastdummygroup is only used for spawning the 1st member of a new group. Therefore i move the officer into a new group that is automaticly named by OpF itself (Bravo, Charly, etc):
_member = (units eastdummygroup) select 1
[_member] join grpNull
_grp = group _member
_grp is now the new group of the Officer (he's the leader). You can fill up the new group with more soldiers:
#spawn_patrolrest
~(random 1)
"SoldierEB" createUnit [getPos _mybase, _grp,"this exec {dead.sqs}"]
?(count units _grp == 12):goto "patrolteamfull"
goto "spawn_patrolrest"
#patrolteamfull
bla
bla
...
You'll end up with an Officer and 11 Soldiers in a new group, named Bravo for example.
eastdummygroup still exists, so you can respawn more groups over and over, until you hit the group barrier of OpF, which is 64 i believe.
Any more questions? try my spawn patrols script here:
http://www.ofpec.com/editors/resource_view.php?id=526