Home   Help Search Login Register  

Author Topic: 2 guys left  (Read 616 times)

0 Members and 1 Guest are viewing this topic.

Offline greg147

  • Contributing Member
  • **
    • Royal Air Assault Battalion
2 guys left
« on: 23 Dec 2004, 23:16:25 »
Hi all.

I have been making a survival mission, but I need something to happen in a trigger. Is there any way to activate a trigger when there is only 2 units (from different groups), including the player, left alive?

Thanks  ;)
Royal Air Assault Battalion - [L/Cpl] Greg
RAAB

StonedSoldier

  • Guest
Re:2 guys left
« Reply #1 on: 23 Dec 2004, 23:18:11 »
condition : count units groupname < 3
activation : hint "Only Two Guys Left"

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:2 guys left
« Reply #2 on: 23 Dec 2004, 23:35:30 »
That works if there is only one group.

If you have a trigger that fires once at the start of the mission (set condition to true) and detects all the loons you want (eg east present) and if you give the trigger a name (say trig) then put the following in the condition field of a trigger I think it will do what you want.

{alive _x} count (list trig) <= 2

I am not confident I got the syntax correct.
« Last Edit: 23 Dec 2004, 23:36:16 by THobson »

StonedSoldier

  • Guest
Re:2 guys left
« Reply #3 on: 24 Dec 2004, 11:52:17 »
sorry, didnt realise they were different groups,

1st trigger :
deadteam = thislist

2nd trigger :
condition : count deadteam < 3
activation : hint "guys dead"

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:2 guys left
« Reply #4 on: 24 Dec 2004, 13:36:16 »
The problem with just doing a count on a group is that it can take some time for dead units to be removed - sometimes several minutes.  

So count grpname will not always refect the number of living loons in the group.  You need to have the additional check on whether they are alive or not.
« Last Edit: 24 Dec 2004, 14:11:47 by THobson »