OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: StonedSoldier on 29 Oct 2002, 00:15:57
-
in my mission i got a western group "grp1" and i want a trigger to run when when all the units are dead.
is the script something like not alive grp1??
thankx for any help guys!!
------------------------------------------------------------
"You cant just eat the arms and throw away the peel, a mans not a piece of fruit"
-
Use the count command for this. Put the following code in your trigger's condition field:
"alive _x" count units grp1 < 1
THis counts how many units in grp1 are alive, and if that number is less than 1 (i.e., 0--all are dead), then the trigger will be activated.
-
Thankx very much
-
Another thing you can do is: create a trigger, then group it to the leader of the group you'll be checking whether they're alive or not. Re-open the trigger, and where the 'None' box is, you should instead get 'vehicle'. Click on this box and select 'All group members', 'Not Present'. You'll get the exact same affect, without using code. Hope this helps!
-
Another alternative is the countside command. This command is life specific (ie. it doesn't count dead dudes).
So the condition:
West countside units group == 0
Can be used when you want a trigger to go off when all members of a group are dead ;)