Home   Help Search Login Register  

Author Topic: Detecting Explosions  (Read 452 times)

0 Members and 1 Guest are viewing this topic.

Offline Pathy

  • Former Staff
  • ****
  • I'm not a F***in llama!
    • Volcbat.
Detecting Explosions
« on: 02 Jan 2004, 18:46:53 »
Is there anyway i can detect if a shell or grenade, or any explosive goes off within a certain range of the player (and doesnt kill)?

Offline Dinger

  • Contributing Member
  • **
  • where's the ultra-theoretical mega-scripting forum
Re:Detecting Explosions
« Reply #1 on: 02 Jan 2004, 20:08:09 »
you can look for a crater.
I believe it's
nearestobject [player, "Crater"]
There are limitations:

A) Craters are only created if the player or viewpoint is near them.
B) nearestobject only works within 50m
C) if there's a crater nearer, it will be detected.
D) this doesn't tell you when the crater was created.

You can fix a few of these by getting excessively fancy.  for example, you can delete every crater detected and camcreate a custom subclass (like my_crater) on the spot, hopefully without the wisp of smoke.  That way NO will only pick up undetected craters.  You can filter out craters that have been around a while by deleting and replacing craters beyond say 20m distance without triggering them (so if the dude walks into a field of craters).
the end result will probably not be ideal though.

If you have control over the munitions themselves, a trick I'm working with now is a smokeless smokeshell.  Make a subclass of the smokeshell with the smoke settings set to be invisible, and a model that's invisible, with the same properties as the shell you're tracking.  When the round is fired,track it at say .5 second intervals, recording direction, velocity and position.  When the position goes to 0,0,0, taket he last reading, camcreate the smokeless smokeshell there, setdir and kick it int he velocity vector.  It should land in approximately the same place (unfortunately, AoA has an effect on shell ballistics, so it won't be precise.  But with the proper polling interval, it otta work).,
Dinger/Cfit

Offline Pathy

  • Former Staff
  • ****
  • I'm not a F***in llama!
    • Volcbat.
Re:Detecting Explosions
« Reply #2 on: 02 Jan 2004, 22:55:49 »
Im thinking, a max of 5 meters away from the explosion. And it has to be the instant the creater is created in that case to work. Then you get blown into the prone position, whited out for a mo, and ringing and muffled sound in your ears (its not possible to directly muffle sound, but its doable by playing a sound that gives the impression), then in wears off