Jump to content
Sign in to follow this  
Birkoff

How to set new leader of the group when using teamswitch?

Recommended Posts

In my team I have various units that will come and go, I can use teamswitch to switch between them but when I do the highest ranking unit is still team leader.

What I want todo is use teamswitch to swap to another character and then that character is automaticly the new group leader.

I been toying arround with >

onTeamSwitch ('_grp = units group _from; hint format ["gruppe: %1 ",_grp]; _to setLeader _grp; _from setRank "Private"; _to setrank "Sergeant"; ')

The hint part I use just for debugging, somehow changing rank or trying to setleader doesnt seem to work.

Probably bad syntax from my side, but clueless on whats wrong.

Anyone ?

Share this post


Link to post
Share on other sites

hi, I would like to bring this back on topic.

I would like to switch the leader to the guy I just switched too. I think it is the same as the OP asked.

I understand that onTeamSwitch I have to run the command:

"group _to selectLeader _to"

but where do it put this?

I would like to install that on my current single player campaign. I edited the save file with Laza editor and I see a node in the tree which says "OnTeamSwitch" with subnodes "data" and "type". Do you guys how do I place this command there?

Thanks a lot!

---------- Post added at 10:19 PM ---------- Previous post was at 09:48 PM ----------

after some testing just found the answer:

I added the following on the subnode "data":

parameter: "value"

value: "group _to selectLeader _to"

and, on the subnode "type", I changed the value from "NOTHING" to "STRING"

now whenever I switch to another team member he becomes the leader.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×