Home   Help Search Login Register  

Author Topic: Formation leader  (Read 1001 times)

0 Members and 1 Guest are viewing this topic.

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Formation leader
« on: 05 Jan 2008, 03:58:32 »
Is there any way to change on purpose the default formation leader of an existing group without FSM or making a unit to get into a vehicle?

Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
Re: Formation leader
« Reply #1 on: 05 Jan 2008, 11:25:18 »
Edit: I probably need to read your post better. What exactly do you mean? If you mean -leader- (i.e., squad leader) then it's just a matter of reorganizing who's joining who (units group1 Join grpMember2), but if you're wondering about the new ArmA command formationLeader then the below is pertinent. Note however they won't be permanent formationleaders since they generally won't have an AI of their own, but you -can- use it to activate other scripts and such. In my RUG DSAI I use the formationLeader command to activate one kind of voice. :)

2,3,4 go to THAT BUSH at 6 o'clock!

-> Makes 2 the FormationLeader of 2, 3 & 4.

4, Attack that TANK at 12 o'clock!

-> Makes 4 his own formation leader. Also works for AI-engage.

Etc etc. Basically any action in which the squad leader orders the units to break off from the formation will cause the formationLeader to change. :) Including getting into a vehicle, using the "Take cover" option and many more. Flanking, advancing and staying back does not AFAIK change formationleader.

How so?

Wolfrug out.
« Last Edit: 05 Jan 2008, 11:28:32 by Wolfrug »
"When 900 years YOU reach, look as good you will not!"

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Formation leader
« Reply #2 on: 05 Jan 2008, 12:08:37 »
This is how I try to change it, and it fails:
Code: [Select]
[] spawn
{
   while {true} do
   {
      if (!isNull new_leader) then
      {     
         grp1 selectLeader new_leader;
         new_leader setFormationTask "LEADER";
         {if (_x != new_leader) then {_x doFollow new_leader}} forEach units grp1;
         new_leader = objNull;
      };
      sleep 2;
   };
};

The leader is changed correctly, but the "old" formation leader remains the same. The resulting formation once the new leader commands the men to return to formation is quite weird, for example, a column where the leader is the last one in the row  ???

EDIT:
attached is a small example mission, everything is done in the init.sqf
« Last Edit: 10 Jan 2008, 20:21:18 by Mandoble »