OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Funky Spingers on 04 Apr 2003, 23:21:58

Title: detecting if a group/ groups are dead
Post by: Funky Spingers on 04 Apr 2003, 23:21:58
Could someone  please help me solve this problem, it's driving me nuts! how can I detect if a group/ groups are dead?
I'm trying to set up a trigger that is set off when three groups of ruskies have bitten the dust. The really annoying part about it is the fact that I did know how to do this but scrubbed the mission I had made with it in, and I can't find the info on how to do this anywhere.
(yes, I am a dumbass!  :-\)
Title: Re:detecting if a group/ groups are dead
Post by: CrashnBurn on 04 Apr 2003, 23:43:46
dudes = (units Alpha) + (units Bravo) + (units charlie)
#loop
?(("Alive _x" count dudes) == 0): whatever=true; exit
~random(5) + 3
goto "loop"



get the idea ?
Title: Re:detecting if a group/ groups are dead
Post by: Funky Spingers on 05 Apr 2003, 00:23:43
thanks but It's a little too complex for me  ??? The way I did it last time was somthing along the lines of writing in the condition field "not alive blah de blah" and "not alive blah de blah" but I just can' t remember how?
Title: Re:detecting if a group/ groups are dead
Post by: Artak on 05 Apr 2003, 10:26:50
not (alive dudename) and not (alive dudename) and not (alive dudename) and not (alive dudename) and not (alive dudename) ...

That's how you do it with the 'bad editing' way, but yeah, you can do it like that too  ;)
Title: Re:detecting if a group/ groups are dead
Post by: Sui on 05 Apr 2003, 11:39:22
The easiest way is to put this in the Condition line of your trigger:

"east countside units _x == 0" count [ group1,group2,group3 ] == 3

That will activate the trigger when all the units in groups 1-3 are dead ;)

Remember to put:

group1 = group this

in your group leader's init field for each group (obviously change the 1 to a 2 or 3 :))

That'll work if you just plain cut and paste it in there, but if you'd like it explained I'm happy to post an explaination for you...
Title: Re:detecting if a group/ groups are dead
Post by: Funky Spingers on 07 Apr 2003, 01:38:18
 :thumbsup:Thanks Sui, thats a better way to do it than my original way of doing it, which was (("Alive _x" count units groupname) == 0) and ((.... .
I actually found the answer to my own question on the same night I posted my question (Doh!). I had written it down for future reference some time ago, backed up the document, formatted my hard drive and then convieniently forgot about it! Anyway, many thanks to everyone who replied, its helped me learn a lot more than I did before :D.