Jump to content
rcmw

Restart AI after Team Switch

Recommended Posts

OK I want to be able to use Team Switch to swap to a number of group leaders, but when I switch away the AI has stopped and won't move.

After doing some reading/googling on this it looks like the AI needs an order to re-join formation but I can't find a command that tells a leader to re-join formation with himself.

Any idea what kind of script I could run that would get the AI leader to start moving again?

Share this post


Link to post
Share on other sites

I think this is what you need.

Place in init.sqf file or trigger on act with condition true

onTeamSwitch "selectPlayer (leader _from); {_x doFollow leader _from} foreach units _from; selectPlayer _to;"

or in a gamelogic init like this

null=[] spawn {sleep 0.5;onTeamSwitch "selectPlayer (leader _from); {_x doFollow leader _from} foreach units _from; selectPlayer _to;"}

it just needs a slight delay or it won't function.

It may only works with group so you will need to make sure they are groups, I'm not sure about that as it seems a bit hit and miss when they're not groups.

blue=group this

red =group this

ect.

Edited by F2k Sel
  • Like 1

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

×