Home   Help Search Login Register  

Author Topic: Stop a truck when attacked  (Read 525 times)

0 Members and 2 Guests are viewing this topic.

Gooner861

  • Guest
Stop a truck when attacked
« on: 14 Apr 2004, 22:15:19 »
I have a scene where a convoy of trucks is attacked. The lead scout M113 gets blown up by a mine and then the enemy move in to take out the trucks. But whenever the trucks get attacked they just drive off the road which isn't what i want. I want the trucks to stay there and get blown up.

Offline rhysduk

  • Former Staff
  • ****
Re:Stop a truck when attacked
« Reply #1 on: 14 Apr 2004, 23:56:28 »
You can use the "hit" EventHandler so when one of the vehicles is "hit" you can set the fuel of the vehicles to "0"..

This way they wont be able to move :)

Rhys
Reviewed Missions Board: Please Read the User's Guide before posting!

Pride and Joy 1 (HW100-T)

Offline SilentHunter

  • Members
  • *
  • frozen leg'o'lamb (every gamers most loved weapon)
Re:Stop a truck when attacked
« Reply #2 on: 15 Apr 2004, 00:06:23 »
Rhys,

you sound like a genius

truck1 AddEventHandler ["hit", {truck1 setdammage 1}]

what the hell is wrong with this syntax, it works on units but not vehicles on version 1.96

Its the same with
truck1 AddEventHandler ["hit", {truck1 setfuel 0}]


 ???
« Last Edit: 15 Apr 2004, 00:07:56 by SilentHunter »
[size=4.5]NERDS HAVE FEELINGS TOO! [/size] [size=2.5]*adjusts glasses*[/size]

Offline rhysduk

  • Former Staff
  • ****
Re:Stop a truck when attacked
« Reply #3 on: 15 Apr 2004, 00:30:58 »
Quote
Sound like a genius

LOL   :cheers:

I have no idea whats wrong with it...

My laptop is up sh** creek at the moment.. graphics all to hell.. i can hardly see what im typing so i cant test it fully..

I tried: -

truck1 AddEventHandler ["hit", {"truck1" setdammage "1"}]

truck1 AddEventHandler ["hit", {"truck1" setdammage 1}]

truck1 AddEventHandler ["hit", {truck1 setdammage "1"}]

But to no success (remember laptop situation)..

Rhys
Reviewed Missions Board: Please Read the User's Guide before posting!

Pride and Joy 1 (HW100-T)

Offline SilentHunter

  • Members
  • *
  • frozen leg'o'lamb (every gamers most loved weapon)
Re:Stop a truck when attacked
« Reply #4 on: 15 Apr 2004, 00:48:28 »
Same with me,

But I noticed if you get a vehicle like a M1A1, add the EH
And shoot it with a law it goes down with one hit,
(baring in mind it usually takes a s*it load of laws, 1 AT round and a hell of a lot of cursing to bring down, only to be shot in the head by the last fleeing crew member)

Therefore it seems that the "hit" EH only works with heavy weapons, on vehicles.
« Last Edit: 15 Apr 2004, 00:49:39 by SilentHunter »
[size=4.5]NERDS HAVE FEELINGS TOO! [/size] [size=2.5]*adjusts glasses*[/size]

Kammak

  • Guest
Re:Stop a truck when attacked
« Reply #5 on: 15 Apr 2004, 00:57:31 »
Instead of working with hit or dammaged, try using a "Detected" trigger or a "KnowsAbout" condition.

i.e.:

Trigger condition: vTruck1 knowsabout xxx > 0
on activation: vTruck1 setfuel 0

As soon as something in vTruck1's group gets blown up, his knowsabout level will jump to 1.5...so at that point setfuel to 0 and everyone will stop when the first vehicle gets blown up.

Ditto on "Detected" - if something in the group gets blown up, Detected is fired even if nobody saw anything at all - the death / explosion turns Detected TRUE.

I believe the problem with Hit or Dammage on vehicles was addressed before, and had to do with a minimum threshold before the event is fired?

Kammak

  • Guest
Re:Stop a truck when attacked
« Reply #6 on: 15 Apr 2004, 00:59:49 »
One other thought - I've noticed that sometimes "Hit" isn't fired if the damage is overwhelming - the object is killed without a "Hit" EH firing.