Home   Help Search Login Register  

Author Topic: Group Leaders  (Read 428 times)

0 Members and 2 Guests are viewing this topic.

Kammak

  • Guest
Group Leaders
« on: 25 Apr 2004, 06:05:53 »
I *assumed* that as a group took casualties, the Leader billet would pass to the next senior member of the group...even down through the privates...?

Is this incorrect?  Are privates incapable of leading a group of other privates?

I've got a situation where one AI group, once the two corporals are killed, stops reacting to waypoints, and the line -

leader group hGroup3 sidechat "blah blah blah..."

is just ignored - no one says anything if the two corporals are both dead (leaving just privates in the group).

As the waypoints are synched with a player controlled group, this is truly messing up the mission flow if the corporals are killed!

So...is that the deal - privates can't be "Leaders"?  Or is something else going on here that I've not discovered yet?

Thanks,

Kevin

Kammak

  • Guest
Re:Group Leaders
« Reply #1 on: 25 Apr 2004, 06:13:10 »
Can someone elaborate on how names work in a group?

Ex: I have a Corporal, named "hSquad3", and he is the leader of 6 men.  If he gets killed, does the line

group hSquad3

evaluate to grpNull because the individual is dead, or does hSquad3 *the name* pass on to the new leader in that group?

In short, How do you refer to a group in script once the group leader has been killed?

Edit - the above question is ONLY in reference to all-ai groups
« Last Edit: 25 Apr 2004, 06:18:07 by Kammak »

Kammak

  • Guest
Re:Group Leaders
« Reply #2 on: 25 Apr 2004, 06:57:50 »
Sorry for the monologue! :)

Figured out the issue, which was the above example (the group leader name stays with the individual, NOT the group).  My solution was to place the following:

gSquad3=group this

in the init field of each group leader (changing the variable name of course) so that I have a "handle" to the group no matter the casualties.

Though it works, it seems less than elegant that a user defined variable must be assigned for each group in order to work with the group...if someone knows a better way (not using variables) please let me know.

Offline Sui

  • Former Staff
  • ****
    • OFPEC
Re:Group Leaders
« Reply #3 on: 25 Apr 2004, 08:57:49 »
Heya Kammak...

You're on the right track mate ;)

Your assumptions about the leader dying and referring the the group by:

group hSquad3

are right on the money.

However, if you have your second line:

hSquad3 = group this

in the init field of any unit in that group, you will always be able to refer the that group with that handle.
Even if all of it's units are dead.

There's no need to have that line in every single unit's init line, you only need it once ;)

Also, if you're after a way to specify the leader of the group (maybe you want them to make a radio call or something) you can use:

(leader groupname)

This way you don't have to worry about which units are still alive, as it will automatically select the current leader.

Hope that clarifies a few things :)