OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: bedges on 22 Apr 2005, 08:18:57

Title: check all of group in trigger...
Post by: bedges on 22 Apr 2005, 08:18:57
scenario - i have a patrol group of about 12 loons. once they're dealt with i want some text to appear. i could do this with a script no problem, but i was wondering if there's a one-line piece of code which i could put in the condition field of a trigger to check the whole group, without having to resort to a separate script.

foreach doesn't seem to work, that or i'm getting the brackets wrong.

any ideas?
Title: Re:check all of group in trigger...
Post by: Blanco on 22 Apr 2005, 08:27:03
Why don't you use a simple "east/west... not present" trigger?

Or name the group (eg : egrp = group this)
and in the condition of the trigger :
Code: [Select]
"alive _x" count units egrp == 0
 
Title: Re:check all of group in trigger...
Post by: 456820 on 22 Apr 2005, 08:29:50
i thought you dont use " " i use { } around alive _x instead
like this
{alive _x} count units egrp == 0
Title: Re:check all of group in trigger...
Post by: Blanco on 22 Apr 2005, 08:39:23
Both will work.
Title: Re:check all of group in trigger...
Post by: bedges on 22 Apr 2005, 17:09:20
that's what i was after - i could have done the trigger thing, but the patrol moves, so i'd need either a huge trigger, or one that moved with the group - but the

Code: [Select]
{alive _x} count units grp_name == 0
seems the very thing - cheers indeed. :)