Home   Help Search Login Register  

Author Topic: trigger - activate when unit dead  (Read 969 times)

0 Members and 2 Guests are viewing this topic.

titan

  • Guest
trigger - activate when unit dead
« on: 18 Jan 2005, 02:09:41 »
How would you go about activating a trigger when a unit/empty object is destroyed. I want this so for instances when you destroy a target, you get the message "TARGET # WAS DESTROYED" or for at the end of a mission, where you can only end the mission once the objective target has been destroyed.

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:trigger - activate when unit dead
« Reply #1 on: 18 Jan 2005, 02:50:40 »
in the condition put:
not alive nameofunit

or:
!(alive nameofunit)

either will work

Offline AirCav

  • Members
  • *
  • I'm a llama!
Re:trigger - activate when unit dead
« Reply #2 on: 18 Jan 2005, 05:58:23 »
Hi Trig,

I just tried using that line.  Not working.  Could you tell me what i'm doing wrong?

Here's the trigger:

Condition: (bomber distance SL1 < 20) or !(Alive bomber)
On Activation: [bomber] exec "ëxplosion.sqs"

The trigger worked fine before I added the !(Alive Bomber) piece.  The intent is to have the car explode either when the bomber does, or is within lethal range (20m) of the target.  


Also, i'm using 1.46 if that makes a difference.

-Air

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:trigger - activate when unit dead
« Reply #3 on: 18 Jan 2005, 12:53:43 »
Odd.   Does this

Condition:  !(Alive bomber)
On Activation: [bomber] exec "ëxplosion.sqs"

work?

Check that you have only one unit called bomber and the name is spelled correctly.   Is bomber a soldier?
Plenty of reviewed ArmA missions for you to play

titan

  • Guest
Re:trigger - activate when unit dead
« Reply #4 on: 18 Jan 2005, 13:15:46 »
Thank you.  

not alive nameofunit  works fine. The problem now of course, is that is what activates the trigger. Is there a way you can activate a trigger with the presence of a unit. Which when gets activated, it checks to see if a unit is dead, and if it is... then activate the text or what ever.

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:trigger - activate when unit dead
« Reply #5 on: 18 Jan 2005, 22:32:20 »
make the trigger grouped to whoever you want to be in it to activate it
*note that your options will change when you do that
set those options to the one you want, and in condition put:
this &&(or AND) !(alive unitname)

titan

  • Guest
Re:trigger - activate when unit dead
« Reply #6 on: 19 Jan 2005, 12:09:10 »
ok, all works well and fine. Yet another question.... is it possible to activate the trigger when        "not alive target1  AND   not alive target2"  or something like that. You know, so when 2 units are dead, and not just one of them.

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:trigger - activate when unit dead
« Reply #7 on: 19 Jan 2005, 12:46:09 »
Yes.
Plenty of reviewed ArmA missions for you to play

Lean Bear

  • Guest
Re:trigger - activate when unit dead
« Reply #8 on: 19 Jan 2005, 12:53:27 »
Yeah. Of course, the syntax would look more like this:

!(alive unit1) && !(alive unit2)

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:trigger - activate when unit dead
« Reply #9 on: 19 Jan 2005, 21:57:57 »
actually, lean bear, you CAN write it as:
not alive unit1 and not alive unit2

in fact, thats how BIS did it in the official missions/campaign (at least the original ones, i don't know about res)

Lean Bear

  • Guest
Re:trigger - activate when unit dead
« Reply #10 on: 20 Jan 2005, 18:12:54 »
Really? Never knew that :P

I think the other way looks nicer anyway :D

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:trigger - activate when unit dead
« Reply #11 on: 21 Jan 2005, 00:12:54 »
lol yeah thats how i first did it (i learned by opening up the bis stuff and looking around)