OFPEC Forum

Editors Depot - Mission Editing and Scripting => Arma2 - Editing/Scripting General => Topic started by: Trexian on 03 Jul 2009, 05:14:07

Title: Groups not moving after teamswitching possible solution
Post by: Trexian on 03 Jul 2009, 05:14:07
Ok, I *think* I've sorted the ArmA1 issue with teamswitch and moving groups.  To recap: if you were the leader of a group and teamswitched out, the group would simply stop and freeze.

The real solution was here, by Wolfrug:
http://www.ofpec.com/forum/index.php?topic=30086.0

But there was no effective (or at least easy) way of catching when the player teamswitched, until A2, with onTeamSwitch.
http://community.bistudio.com/wiki/onTeamSwitch

Anyway, I put this into the init of a SIMPLE simple mission.
Code: [Select]
onTeamSwitch "selectPlayer (leader _from); {_x doFollow leader _from} foreach units _from; selectPlayer _to;";

It looks like it works, at least with pre-set (in editor) waypoints.  Haven't played with it in terms of scripted waypoints or sending orders then teamswitching out.

(Also, I don't think the semicolon inside the quotes is necessary.)

This may not be the "real" solution, but it is a step, methinks. :)