Hello all, I'm a newbie to OFP editing and scripting... but I'm hooked.
I seem to be a problem with naming groups. Can someone help?
I've created a group of eastern solders. I have a trigger setup to run a script that checks for their death. Problem is, I want the ending to happen only when ALL of them have been killed.
I've noticed that when I name the group (EastAlpha setGroupId ["Alpha", "GroupColor1"]), the group just takes the name of the lead unit. That mean that when he dies the group will reform under the name of the next unit in command. This also means my trigger is getting set off because the script is looking for a group of a particular name. This is making things hard to code since I don't really know (1 out of 9) who will be in command and thus the name of the group. Am I missing something here? Is it possible to name the group something other than the name of the lead unit?
On the groups lead unit I place this in the init field:
EastAlpha setGroupId ["Alpha", "GroupColor1"]
The unit is named: Alpha
I have a script that checks for the groups existance:
#Start
~15
_remaining = 0
_alphaAlive = EAST CountSide [Alpha]
;_bravoAlive = EAST CountSide [Bravo]
;_charlieAlive = EAST CountSide [Charlie]
;_deltaAlive = EAST CountSide [Delta]
;_echoAlive = EAST CountSide [Echo]
;_foxtrotAlive = EAST CountSide [Foxtrot]
? (_alphaAlive > 0) : _remaining = _remaining + _alphaAlive
;? (_bravoAlive > 0) : _remaining = _remaining + _bravoAlive
;? (_charlieAlive > 0) : _remaining = _remaining + _charlieAlive
;? (_deltaAlive > 0) : _remaining = _remaining + _deltaAlive
;? (_echoAlive > 0) : _remaining = _remaining + _echoAlive
;? (_foxtrotAlive > 0) : _remaining = _remaining + _foxtrotAlive
? (_remaining == 0) : Goto "Done"
Goto "Start"
#Done
~60
varComplete = True
Exit