Home   Help Search Login Register  

Author Topic: Detecting disabled vehicles  (Read 1296 times)

0 Members and 1 Guest are viewing this topic.

2nd Ranger

  • Guest
Detecting disabled vehicles
« on: 10 Jan 2005, 18:22:13 »
Hello,

I'm trying to work out how to make a trigger detect when several individual vehicles (tanks) are disabled.

I can't simply use the NOT(Alive ) line because these tanks are engaged by Cobras and are therefore left alone if the crew gets out, which means they are still active and do not set off the trigger.

I tried the 'not canmove' condition on the tanks, but again, that does not set off the trigger unless they actually can't move (ie tracks are disabled) or the tanks are actually destroyed.

In that case, is there a way I can detect when these vehicles are EMPTY rather than disabled? Or something else that would have the same effect? Perhaps when the damage of each tank is so great that the crew gets out?

I'd greatly appreciate any help anyone can give me.

Fl4ut4

  • Guest
Re:Detecting disabled vehicles
« Reply #1 on: 10 Jan 2005, 19:05:47 »
Yes!! there is a command for knowing if the veihcle is empty, but i dont remember now... try this: put the empty thank and name it "Whatever1", and put the 3 crewmen somewhere and add this line to the init field:
Crew 1:this moveincommander whatever1
Crew 2:this moveindriver whatever1
Crew 3:this moveingunner whatever1

and i think it will workthis : ? ! (alive whatever1) : hint "Tank is dead"

BUT WACH OUT! Disblaiding a Tank it is NOT the same as Destroyng it!

Make Sure It BURNS!

see yah

2nd Ranger

  • Guest
Re:Detecting disabled vehicles
« Reply #2 on: 10 Jan 2005, 19:29:42 »
It doesn't matter if it's dead or not, I just need to make the trigger detect when it is down, either dead or without a crew.

When the choppers attack the tanks, some of them will blow up, but others will just be badly damaged, and the crew gets out, making the tank neutral and therefore the choppers leave it alone. I would like the trigger to know when the tank is no longer a threat.

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:Detecting disabled vehicles
« Reply #3 on: 10 Jan 2005, 19:45:53 »
The crew usually exits the vehicle once it's immobilized, so in the triggers condition field you can use:
!canMove tankName

This activates the trigger once the tank is immobilized...


You could also extend that line like this:
!canMove tankName || !canFire tankName

This would activate the trigger once that tank is immobilized or it's turret is damaged so it can't fire anymore...
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

2nd Ranger

  • Guest
Re:Detecting disabled vehicles
« Reply #4 on: 10 Jan 2005, 21:18:35 »
Aha, thanks alot, that sounds like it would suit my purposes just finely.

And while I'm here;

does ! denote 'not' and || denote 'and'?

Just that I'm not exactly a scripting wizard, and that info would prove useful.

EDIT

Okay that does work, but it doesn't seem to work when I have all the other tanks with it in the condition line. There are five tanks I want to be in this trigger, and I had it set up like this

!canMove t1 or !canFire t1 and !canMove t2 or !canFire t2.... and so on for t3, t4 and t5. The problem is that the trigger activates after the t1 tank is disabled and ignores the rest. I suppose that's rather easy to get around, but I wouldn't know.
« Last Edit: 10 Jan 2005, 21:48:34 by 2nd Ranger »

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:Detecting disabled vehicles
« Reply #5 on: 10 Jan 2005, 22:13:20 »
! = not
? = if
|| = or
&& = and

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:Detecting disabled vehicles
« Reply #6 on: 10 Jan 2005, 22:19:55 »
OFP doesn't really seem to understand those multipe or/ands...

You could try
Code: [Select]
!(canMove t1 || canFire t1) && !(canMove t2 || canFire t2) && .....
But I doubt that would work...

Then you could also try
Code: [Select]
"!canMove _x" count [t1,t2,t3,t4,t5] == count [t1,t2,t3,t4,t5] || "!canFire _x" count [t1,t2,t3,t4,t5] == count [t1,t2,t3,t4,t5]But that I doubt even more ::)

One way to go would also be
Code: [Select]
!canMove t1 && !canMove t2 && !canMove t3 && !canMove t4 && !canMove t5 || !canFire t1 && !canFire t2 && !canFire t3 && !canFire t4 && !canFire t5
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:Detecting disabled vehicles
« Reply #7 on: 10 Jan 2005, 22:31:08 »
but what happens when one can't move and the rest can't fire... all disabled, no triggering

2nd Ranger

  • Guest
Re:Detecting disabled vehicles
« Reply #8 on: 10 Jan 2005, 22:40:26 »
There's the rub.

That first one works when I take them all out, but I take it it won't work for being immobilized. I will try the others now.

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:Detecting disabled vehicles
« Reply #9 on: 10 Jan 2005, 23:23:51 »
i believe this should work, but the way OFP treats its conditions who knows....

(!canmove t1 || !canfire t1) && (!canmove t2 || !canfire t2) && (!canmove t3 || !canfire t3) &&  etc...

2nd Ranger

  • Guest
Re:Detecting disabled vehicles
« Reply #10 on: 11 Jan 2005, 00:36:14 »
That works!

Thanks very much for your help, folks.

Offline Sui

  • Former Staff
  • ****
    • OFPEC
Re:Detecting disabled vehicles
« Reply #11 on: 11 Jan 2005, 09:29:14 »
Hmm... I would tend towards:

Quote
"not (canmove _x) or not (canfire _x) or (count (crew _x) == 0)" count [ tank1, tank2, tank3... etc. ] == ?

As then all you need to do is add your tanks to the array at the end, and put the total number of tanks in place of the ?
« Last Edit: 11 Jan 2005, 09:30:32 by Sui »

2nd Ranger

  • Guest
Re:Detecting disabled vehicles
« Reply #12 on: 11 Jan 2005, 12:39:20 »
Would that have any effect at all on how the trigger works, or do you just prefer the syntax?

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:Detecting disabled vehicles
« Reply #13 on: 11 Jan 2005, 13:00:22 »
Actually Sui's example would be quite foolproof...
That is, if it works,...
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

2nd Ranger

  • Guest
Re:Detecting disabled vehicles
« Reply #14 on: 11 Jan 2005, 13:07:49 »
Well, I'll certainly give it a try.

Thanks again guys.

Offline Sui

  • Former Staff
  • ****
    • OFPEC
Re:Detecting disabled vehicles
« Reply #15 on: 11 Jan 2005, 13:36:28 »
Actually Sui's example would be quite foolproof...
That is, if it works,...

I think that was the condition I used to detect if the armour was neutralised in Facile Ground ;D
Either that or something very similar...

Try it and see if it works for your situation ;)

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:Detecting disabled vehicles
« Reply #16 on: 11 Jan 2005, 19:32:26 »
::)
[offtopic]
Well, I never played Facile to the end because I tried it like 30 times and it always got stuck on the minefield hasle in the beginning... ;)
Once even waited several hours on that spot and nobody moved anywhere...
[/offtopic]

But if you've used that syntax then it should work... :P
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.