Jump to content
Sign in to follow this  
kocrachon

Foreach side not working

Recommended Posts

Hey All,

 

Super simple I am hoping, I am trying to make it so that all units on side EAST are captive and passive. Once an event triggers, they go not captive and COMBAT. But my string does not seem to work.

 

{if (side _x == EAST) then {_x setcaptive true; (group _x) setBehaviour "CARELESS"}} foreach allunits

 

I get no errors, but if I walk infront of a redfor, they shoot at me. So not sure where I am wrong on this. I assume its somewhere around the group part but I havent been able to resolve it so far. 

Share this post


Link to post
Share on other sites
2 hours ago, pierremgi said:

setBehaviour

So my original version had it spelled right, and corrected it, but issue persists. 

 

{if (side _x == EAST) then {_x setcaptive true; (group _x) setBehaviour "CARELESS"}} foreach allunits

 

EDIT:

 

If I do just this, it works for all units, so the if part of the statement might not be working right? Am I not declaring side properly?

 

{_x setcaptive true; (group _x) setBehaviour "CARELESS"} foreach allunits

Share this post


Link to post
Share on other sites

No, your code is OK. Careless units are still throwing hand grenades on enemies but it's a known problem for ages.

Check if this code is updated when you need this code. Spawned units could be not concerned by this line.

  • 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
Sign in to follow this  

×