Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×
Sign in to follow this  
redmotion

Checking to see if a dynamically spawned group is all dead

Recommended Posts

I'm creating a Group of enemies called _defendgrp1. Then I'm trying to create a trigger that will be alerted when all members of the _defendgrp1 are dead. I've got this far from reading some other threads dotted around:-

_trig = createTrigger["EmptyDetector",_locationPosition];

_trig setTriggerStatements ["{alive _x} count units _defendgrp1 == 0", "hint 'Dead'" ,"hint 'Alive'"];

also tried:

_trig setTriggerStatements ["({alive _x} count units _defendgrp1) < 1, "hint 'Dead'" ,"hint 'Alive'"]

as TriggerStatements/condition.

Is this the right approach? Or Am I missing something?

Thanks in advance.

Share this post


Link to post
Share on other sites

I doubt you'll get far with using local variable for the group. Either use global var, name the group or pass the group to the trigger with format command.

Share this post


Link to post
Share on other sites
Sign in to follow this  

×