Jump to content
DarkBall123

Problem with the array

Recommended Posts

Hello everyone, can someone please explain why this happens:

 

There is a trigger:

Condition - 

call {{!canMove _x}forEach [ZU_1, zu_2, ZU_3,BMP_ISIS]};

On Activation - 

vertgo=true

 ZU_1, zu_2, ZU_3,BMP_ISIS - this is a technique that we need to destroy

 

But here's the problem - After I destroy only the BMP the condition is triggered and canMove _x returns : FALSE

{canMove _x}forEach [ZU_1, zu_2, ZU_3,BMP_ISIS] // FALSE

I will be grateful for any help

Share this post


Link to post
Share on other sites
3 minutes ago, DarkBall123 said:

{canMove _x}forEach [ZU_1, zu_2, ZU_3,BMP_ISIS]

 

you need to use count instead of foreach and then check the result with something like :  "> 0"

 

Share this post


Link to post
Share on other sites

forEach returns the value of the last codeblock it runs which is why it returns true if your BMP cannot move.

Like gc8 says: use the count command so your condition looks like this:

{canMove _x} count [ZU_1,zu_2,ZU_3,BMP_ISIS] == 0

 

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

×