Home   Help Search Login Register  

Author Topic: Help!... group gone upon leaders death... well kinda  (Read 942 times)

0 Members and 1 Guest are viewing this topic.

rgbman

  • Guest
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

Kaliyuga

  • Guest
Re:Help!... group gone upon leaders death... well kinda
« Reply #1 on: 11 Jan 2003, 22:48:22 »
I seem to be a problem with naming groups.  Can someone help?......... Is it possible to name the group something other than the name of the lead unit?

Hmm.. try placing this in the init field of that group leader instead :

 grp1 =group this


then that group should be designated as grp1 ;)




« Last Edit: 11 Jan 2003, 22:56:19 by Kaliyuga »

Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
Re:Help!... group gone upon leaders death... well kinda
« Reply #2 on: 11 Jan 2003, 22:53:53 »
aaah, you've fallen in that old trap :P

the correct way to name your group is by putting this line in one of group members' init field:

groupname=group this

try that one on for size instead ;)
the setgroupID only determins the name of the group when they're chatting (for instance: Alpha Black 1: blah blah blah)

right, g'luck! ;)

Wolfrug out.
"When 900 years YOU reach, look as good you will not!"

rgbman

  • Guest
Re:Help!... group gone upon leaders death... well kinda
« Reply #3 on: 12 Jan 2003, 03:11:25 »
Thanks Kaliyuga and Wolfrug... It worked.  Much appreciated!


Offline Vortrog

  • Members
  • *
  • Ski'in, Fish'in, Shoot'in, OFP'in
    • Vortrog's Lair
Re:Help!... group gone upon leaders death... well kinda
« Reply #4 on: 14 Jan 2003, 00:09:54 »
How about changing the status of this message to "solved" so caring people like me can shoot straight to the next unlsolved mystery...please?  :-)

rgbman

  • Guest
Re:Help!... group gone upon leaders death... well kinda
« Reply #5 on: 15 Jan 2003, 01:23:01 »
How about changing the status of this message to "solved" so caring people like me can shoot straight to the next unlsolved mystery...please?  :-)

Sorry... didn't even realize there was a "solved" status.  Done.

-noob