Luckyas 2 Posted August 15, 2017 I am making a scenario where I need to have all the groups on the EAST side to change their behaviour. I tried to use foreach on multiple different ways but nothing seems to work. This is what I tried: { if (side _x == EAST) then { _x allowFleeing 0; _x setCombatMode "RED"; }; } forEach allgroups; { if (side _x == EAST) then { group _x allowFleeing 0; group _x setCombatMode "RED"; }; } forEach allUnits; Can someone help me? Thanks Share this post Link to post Share on other sites
killzone_kid 1330 Posted August 15, 2017 Maybe you should try setBehaviour if you want change behaviour https://community.bistudio.com/wiki/setBehaviour Share this post Link to post Share on other sites
tirpitz 15 Posted August 15, 2017 Where is the problem? Does the loop not work or the behavior?Sent from my WAS-LX1A using Tapatalk Share this post Link to post Share on other sites
scottb613 284 Posted August 15, 2017 Hi Folks, Does this help ??? You can change the "then" to whatever you need... _opfor = []; {if ((side _x) == east) then {_opfor pushBack _x}} forEach allUnits; Regards, Scott Share this post Link to post Share on other sites
Luckyas 2 Posted August 16, 2017 23 hours ago, killzone_kid said: Maybe you should try setBehaviour if you want change behaviour https://community.bistudio.com/wiki/setBehaviour How did I not see that... I thought the combat mode effected the behaviour aswell. Thanks allot! Share this post Link to post Share on other sites
Grumpy Old Man 3545 Posted August 16, 2017 16 minutes ago, Luckyas said: How did I not see that... I thought the combat mode effected the behaviour aswell. Thanks allot! To put it in kks words: You should try setCombatMode if you want to change the combat mode. Cheers Share this post Link to post Share on other sites