Jump to content
Sign in to follow this  
mk82

condition to be true, if specific amout of units inside an array is dead

Recommended Posts

Hello,

I want a condition to be true, if a specific number of units of an array is dead. How can I do this?

Share this post


Link to post
Share on other sites

Do not use group when creating the array because units are removed once their death is noticed ("Oh no, X is down!")

Either create it in init.sqs from unit names, or you can write the following in the Init line of a member of the group:

<array name> = units this

Then the condition is:

"!alive _x" count <array name> == <number to be dead>

Share this post


Link to post
Share on other sites

Thanks. Works well.

Which condition do I need to get an announcement if any of the arrays units die?

Share this post


Link to post
Share on other sites

"!alive _x" count <array name> >= 1

Meaning: the number of units in <array name> who are NOT alive is equal to, or greater than, one.

Or else apply a Killed EventHandler to them, but that might be difficult to make work in multi-player.

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  

×