Home   Help Search Login Register  

Author Topic: Checking if a bunch of units are dead...  (Read 639 times)

0 Members and 1 Guest are viewing this topic.

Offline SEAL84

  • Members
  • *
  • Always lurking
Checking if a bunch of units are dead...
« on: 26 Jan 2004, 04:47:15 »
This one is driving me nuts  >:(

I have five enemy groups that will attack a town held by my grunts, and I need a trigger that will fire when the attack has been defeated - i.e. when all of them are dead.

My troops first take the town from the enemy, then there is a counterattack, so a massive "not present" trigger won't work.

I've tried a bunch of stuff and nothing seems to work...

This is really driving me up the wall because the answer is probably pretty easy to figure out...help me, somebody :noo:

Offline dmakatra

  • Members
  • *
  • Better known as Armsty
Re:Checking if a bunch of units are dead...
« Reply #1 on: 26 Jan 2004, 08:19:33 »
try a west present trigger in town, if the player's slow the reinforcements will show up before the player has defeated the enemy. Makes it kinda tricky.

:beat: *Gets Shot* :beat:

Offline Skumball

  • Members
  • *
Re:Checking if a bunch of units are dead...
« Reply #2 on: 26 Jan 2004, 10:35:14 »
You'll need a giant trigger that is activated by east & detected by east (or whatever the exact wording is, and change the side to whatever is required).

Then create a script like so:

#reset
_enemies = list TriggerName
_size = count _enemies
_i = 0
_count = 0

#check
? !(alive (_enemies select _i)) : _count = _count + 1
_i = _i + 1
~0.1
? _i < _size : goto {check}

? _count < _size : goto {reset}

[] exec {nextScript}


I don't have access to OFP here so test it out and let me know if it works.

gundernak

  • Guest
Re:Checking if a bunch of units are dead...
« Reply #3 on: 26 Jan 2004, 11:16:59 »
Simply you can count the groups holding the town and after the groups of the counter attack...

make a condition in a trigger or in a script:
 
@ count units group01 + count units group02 + count units group03 (+ count uni....) <  1


Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Checking if a bunch of units are dead...
« Reply #4 on: 26 Jan 2004, 13:44:00 »
No, no, no these are all wonderful answers but they are all far too complicated.  ;D ;D ;D

All you need is two triggers over the town area, you might need to experiment a little to get exactly the right areas.

Trigger1
Synro with last enemy attack group
Activation Box:  Group leader present
On activation:   baddiesHere=true

Trigger2
Activation Box:   Enemy not present
Condition:   this and baddiesHere
On activation:   end mission stuff


The first trigger fires when the final enemy group reaches the town.   It sets the variable baddiesHere to true.    The second trigger will only fire when this variable is true (i.e. after the attack has started) AND when the area is clear of the enemy (i.e. the attack has been defeated).

You can use variables to "turn" triggers "on" and "off" in all kinds of situations.  It's a very powerful mission editing tool.

« Last Edit: 26 Jan 2004, 13:44:23 by macguba »
Plenty of reviewed ArmA missions for you to play

Offline Skumball

  • Members
  • *
Re:Checking if a bunch of units are dead...
« Reply #5 on: 26 Jan 2004, 14:37:54 »
Use mine, use mine! It, er, it gets you chicks!

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:Checking if a bunch of units are dead...
« Reply #6 on: 26 Jan 2004, 17:47:17 »
Use mine, use mine! It, er, it gets you chicks!
Hmph... Just used it didn't get any  >:(



 ;D
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline Skumball

  • Members
  • *
Re:Checking if a bunch of units are dead...
« Reply #7 on: 27 Jan 2004, 05:30:32 »
 ;D ;D