Forum Jump :

Author Message


Posts: 14
Rank:


Level: Member

Country: es
Location:
Occupation:
Age:
In-game name:

 
#1 Posted at 2016-05-20 12:43        
     
So basically a i am looking for an script to do this, and do not come with one.

Let´s assume that my team´s variable name is T1,
pilot´s A and gunner´s B.

I want B to be the leader of T1.

I have tried this:

1º:
A1 =teamMember A; B1 = teamMember B; A1 setLeader B1;

2º:
A1 =teamMember A; B1 = teamMember B; T1 setLeader B1;

3º:
A1 =teamMember A; B1 = teamMember B; TA = teamMember T1 ; T1 setLeader B1;

But none of them worked. Any idea on how to do this? Thanks.


Author Message


Posts: 1189
Rank:


Level: Member

Country: tr
Location:
Occupation: Computer Science student
Age: 20
In-game name: Wak

 
#2 Posted at 2016-05-20 19:55        
     
Think it might be simpler than you think:

Assuming A1 and B1 aren't in any groups, this should make A1 join B1, making B1 the leader of the new group:
[A1] join B1;

Sometimes I like to think as I started the whole "earplugs" thing.

W0lle: The only advice I can give you is: Do not try to understand BI. You will not succeed and it only makes your brain go boom. I would even go so far and say that not even they understand their own actions :-D.

#define getDamage getDammage

Advertisement


Author Message


Posts: 14
Rank:


Level: Member

Country: es
Location:
Occupation:
Age:
In-game name:

 
#3 Posted at 2016-05-20 20:24        
     
Thanks! Did not tought about putting them in separate teams, as they both start flying in the same chopper, but that works. Anyway, what would be the way to do it if they were in the same team?


Author Message


Posts: 1189
Rank:


Level: Member

Country: tr
Location:
Occupation: Computer Science student
Age: 20
In-game name: Wak

 
#4 Posted at 2016-05-21 07:25        
     
This code should work:

if (isServer) then {
    [group B1, B1] remoteExec ["selectLeader", groupOwner B1];
};

Sometimes I like to think as I started the whole "earplugs" thing.

W0lle: The only advice I can give you is: Do not try to understand BI. You will not succeed and it only makes your brain go boom. I would even go so far and say that not even they understand their own actions :-D.

#define getDamage getDammage

Author Message


Posts: 1589
Rank:


Level: Member

Country: pf
Location: Tahiti
Occupation: too many Arma
Age: 57
In-game name: Kobayashi Maru

 
#5 Posted at 2016-05-21 18:45        
     
Arma, sometimes..., is more complicated than it appears.
On my mind A1 is declared as a teamMember, who is an agent, not a person.
I don't know if A1 already exists as a unit in editor. If yes, don't try to make him a teamMember and apply what Wak wrote.

Your script seems to manage teams, and it's probably the reason why the command setLeader is used instead of selectLeader.

Teams, groups... leader, formLeader... Don't ask me why so much differences with their parameters.
Just one thing: if you really want to manage team, then agents, each time you want to refer to the person (unit), write (agent X) instead of X.
For example: [agent A1] join (agent B1); if A1 and B1 are not units but only team members. I hope it's clear!

PLEASE CONTACT ME ON BI FORUMS FOR ANY SCRIPT / MOD QUESTION. TKS