Aculaud 0 Posted June 15, 2002 Is there any way to write a trigger condition that tells it to go when a whole group is dead? I plan on having a TON of infantry, so it'd be really tedious if i had to write triggers for all of them. Share this post Link to post Share on other sites
Chris Death 0 Posted June 15, 2002 (count units leader_name) == 0 You might have a delay around 10 seconds, until ofp reckon's it, but it should work. ~S~ CD Share this post Link to post Share on other sites
Aculaud 0 Posted June 15, 2002 thanks, but what do i put in for leader_name? Say if my leaders name was Al, would i put leader_Al? Share this post Link to post Share on other sites
Chris Death 0 Posted June 15, 2002 leader_name is, what you used to type into the group leader's name field. This would be in your case: AI ~S~ CD Share this post Link to post Share on other sites
Aculaud 0 Posted June 15, 2002 negative on that. It didnt work Share this post Link to post Share on other sites
Chris Death 0 Posted June 15, 2002 OK, i arrived home from work, and checked an old misison.sqm (where i've been using that), and it's: !(count units AI >= 1) The thing is, you can't count the units of AI, once they are all down (they got killed). So you need to ask wether there is at least 1 or more units alive. ~S~ CD Share this post Link to post Share on other sites
Aculaud 0 Posted June 15, 2002 Negative on that as well. Sorry man, its executing the trigger before everyones been whacked. I need it to execute when EVERYONE has been taken out. Share this post Link to post Share on other sites
Chris Death 0 Posted June 15, 2002 yep, this is true I tried it, and when the leader gets killed, the trigger goes off. I'll play around with it a bit, this evening, i'll let ya know if i got a solution. ~S~ CD Share this post Link to post Share on other sites
RED 0 Posted June 15, 2002 (count units group1) == 1 Works, but it takes a while for the game to register that the group is dead. Also when the whole group is dead the amount of people in the group is 1, which does not make sense but thats the way it is. RED Share this post Link to post Share on other sites
Aculaud 0 Posted June 15, 2002 thats not working how i originally wanted it to, but i think it will work anyway. That one makes it so the trigger goes when theres only one guy left. Also, if anyone knows, a trigger that went faster would be much apreciated. Share this post Link to post Share on other sites
Lansen 0 Posted June 15, 2002 Press F2 in the editor and draw a line between the trigger and a soldier in the desired group. Choose "Whole group" in the list where it says unit. Click "Not present" to have the trigger activated when the group isnt present. You should be able to use this in scripts; //call for script [groupname] exec "check.sqs" //script _group = _this select 0 _aunits = count units _group #count ?(_aunits <1) : goto "no_one_left" #no_one_left //have your desired action here ;exit Something like that should work anyway. Share this post Link to post Share on other sites
Spinor 0 Posted June 15, 2002 You could also use the following condition:  "Alive _x" Count (Units group) == 0 I have found that using the Count command in such a way can be very useful, e.g. if you want to trigger an action when one of the groups units is unable to walk and not in a vehicle, (thus bogging the whole group down) you can use  "!(CanStand _x) AND ((Vehicle _x) == _x)" Count (Units group) > 0 Spinor Share this post Link to post Share on other sites
Aculaud 0 Posted June 15, 2002 </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (Spinor @ June 15 2002,13:32)</td></tr><tr><td id="QUOTE">You could also use the following condition: Â "Alive _x" Count (Units group) == 0<span id='postcolor'> This one worked!! Thanks man! Share this post Link to post Share on other sites
JAP 2 Posted June 15, 2002 It can be done much more simple, at least that s how i do it all the time. Make a trigger. West Not present Once Group (f2) it with the leader of the squad you want the trigger to be for And then select "any member of squad" in type. Done. No scripts what so ever. Share this post Link to post Share on other sites