Home   Help Search Login Register  

Author Topic: How can I make a trigger only activate when certain units are dead?  (Read 696 times)

0 Members and 1 Guest are viewing this topic.

shrubbery

  • Guest
I'm a bit of a noob when it comes to scripting and what I want to do is have a trigger that will only work when my team has destroyed some BMPs and SU25s and another trigger that will make a hint pop up if all the BMPs and SU25s have not been destroyed. I tried putting
Code: [Select]
not(alive b1);not(alive b2)into the condition field but didn't seem to work.

Offline nominesine

  • Former Staff
  • ****
  • I'm NOT back!
    • The IKB Forum
You are almost there... just a little syntax problem. This is what your condition field should look like...

!(alive b1) and !(alive b2)

If you write...

!(alive b1) or !(alive b2)

...the trigger will fire when b1 or b2 is dead.

The ; is only used to separate different commands in the activation field. ! means not (you can use either one)
OFPEC | Intel Depot
RETARDED Ooops... Retired!

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
nominesine is of course absolutely right.    However, there is a subtlety here.

Vehicles, armoured vehicles in particular, can look destroyed after you have plugged the appropriate number of LAWs into them.   However, sometimes they do not register as "not alive".    This can cause the mission not to finish - the player thinks he has zapped all the BMPs, and indeed he has, but not quite enough to make the trigger fire.

For this reason it is better to use

(not canFire b1 and not canMove b1) and (not canFire b2 and not canMove b2)

The trigger will fire when the two vehicles can neither move nor fire, and a vehicle which can't do either of these is functionally destroyed anyway.   You don't actually need the brackets, they just make the line easier to read.    You can add as many vehicles as you like.
Plenty of reviewed ArmA missions for you to play

shrubbery

  • Guest
Nice one guys but I've just run into a bit of a problem on this one. I want the trigger to activate when the west is present but it just activates as soon as the condition field is met.
this is what I have

Activated by west

Condition: (canFire b1 or canMove b1)or(canFire b2 or canMove b2)or(canFire b3 or canMove b3)or(canFire a1 or canMove a1)or(canFire a2 or canMove a2)or(canFire a3 or canMove a3)or(canFire a4 or canMove a4)or(canFire a5 or canMove a5)or(canFire a6 or canMove a6)

On activation: theres a hint in here

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
condition: this and (!(canFire b1) and !(canMove b1)) and (canFire b2 or canMove b2)or(canFire b3 or canMove b3)or(canFire a1 or canMove a1)or(canFire a2 or canMove a2)or(canFire a3 or canMove a3)or(canFire a4 or canMove a4)or(canFire a5 or canMove a5)or(canFire a6 or canMove a6)

ugh, too many ands and such to change

the main problem is the bold
but also you need to change everything to not canmove/canfire, like mac said

and you should make your "or"s into "and"s otherwise you only need one of those true, as in, if one of them can't move, but can still fire, and all the rest are fine, that part of it will show true

Offline Fragorl

  • Coding Team
  • Former Staff
  • ****
Instead of all that repetition, perhaps try:

"(!canmove _x and !canfire _x)" count [a1,a2,a3,a4,a5,a6,b1,b2,b3] == 9

as your condition?