Home   Help Search Login Register  

Author Topic: PipeBombs and the Fired Event Handler  (Read 741 times)

0 Members and 1 Guest are viewing this topic.

Strango

  • Guest
PipeBombs and the Fired Event Handler
« on: 10 Mar 2005, 21:13:02 »
I'm creating a base assault mission with an alarm system.  I've got everything done and working except for the detection of when a PipeBomb is detonated.  I'm using the Fired Event handler for all playable characters.  The problems is that the event handler goes off when the player sets the pipe bomb and not when it is detonated.

My first idea on how to get this working right is to find a way to detect when the Pipebomb being placed on the ground has a setdamage of 1.  I do a NearestObject command for PipeBomb with a starting location of the player the event handler is being called from, but it doesn't return any objects.  Does anyone know the name of the object placed on the ground when you set a PipeBomb? or does anyone have any ideas on a better way to go about detecting the detonation?




Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:PipeBombs and the Fired Event Handler
« Reply #1 on: 10 Mar 2005, 21:39:24 »
Just a guess, but if you can detect the placing of the bomb maybe you could put a small object underneath it, just underground.  When the object is destroyed the bomb must have done off.
Plenty of reviewed ArmA missions for you to play

Strango

  • Guest
Re:PipeBombs and the Fired Event Handler
« Reply #2 on: 10 Mar 2005, 21:57:52 »
Great idea, Thanks!

Merc

  • Guest
Re:PipeBombs and the Fired Event Handler
« Reply #3 on: 10 Mar 2005, 23:18:22 »
I have an idea that might be easyer.

Code: [Select]
Put:
this addeventhandler ["fired",{_this exec "yourscript.sqs"}]

In the units init. field.

and put:

_whatever = _this select 2

?(_whatever == "detonate") : goto "loop1"

goto "exit"

#loop1

blah blah blah

#exit

exit

in your script somewhere

That should make the script work only when you detonate a pipebomb.

Note: Check out Igor Drukov's event handler tutorial, it is really good and I learned a lot from it.