Jump to content
Sign in to follow this  
thetrooper

&& and || statements in same code

Recommended Posts

Hi all, got a couple of questions around && and || .Basically who do I get this code to work?

 

(ff1 distance civ1 < 5 || ff2 distance civ1 < 5 || ff3 distance civ1 < 5 || ff4 distance civ1 < 5) && !alive murder1 && !alive en12;

I'm trying to say if these units are less then 5m away from a unit but also two other units have to be dead?

Trying to add it into a condition field. Also how would I write it if in a SQF file?

Share this post


Link to post
Share on other sites

Should work for a triggers condition field:

{_x distance civ1 < 5} count [ff1,ff2,ff3] > 0 AND {!alive murder1} AND {!alive en12}

Should work inside execVMed .sqf:

waitUntil {{_x distance civ1 < 5} count [ff1,ff2,ff3] > 0 AND {!alive murder1} AND {!alive en12}};

Cheers

Share this post


Link to post
Share on other sites

Should work for a triggers condition field:

{_x distance civ1 < 5} count [ff1,ff2,ff3] > 0 AND {!alive murder1} AND {!alive en12}

Should work inside execVMed .sqf:

waitUntil {{_x distance civ1 < 5} count [ff1,ff2,ff3] > 0 AND {!alive murder1} AND {!alive en12}};

Cheers

 

hmmm, unit is still joining group when murder1 and en12 are still alive.

They though only be joining if both of these are dead. Any ideas?

Share this post


Link to post
Share on other sites

hmmm, unit is still joining group when murder1 and en12 are still alive.

They though only be joining if both of these are dead. Any ideas?

 

The snippet is working just fine.

Only returns true if both murder1 and en12 are dead and at least one of the ffn is closer to civ1 than 5 meters.

{_x distance civ1 < 5} count [ff1,ff2,ff3,ff4] > 0 AND {!alive murder1} AND {!alive en12}

Post the rest of the code that isn't working, anything else is just a guess out of the blue.

 

Cheers

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  

×