Home   Help Search Login Register  

Author Topic: Detect Satchel touched off.  (Read 1094 times)

0 Members and 1 Guest are viewing this topic.

Offline The-Architect

  • Former Staff
  • ****
  • Bite my shiny metal...
    • Bob's Un-official Flashpoint Page
Detect Satchel touched off.
« on: 30 Sep 2005, 03:34:12 »
How do I check if a satchel has been touched off?

I want a base to go haywire if I detonate a satchel charge.
James Andrew Wilkinson 1977 - 2005 R.I.P.
"If it ain't the friggin' incoming it's the friggin' outgoing. Only difference is who gets the friggin' grease, and that ain't no friggin' difference at all."

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:Detect Satchel touched off.
« Reply #1 on: 30 Sep 2005, 08:42:48 »
hmm...

Add a "fired" eventHandler for the unit placing the satchel, like this:
Code: [Select]
this addEventHandler ["fired",{[if (_this select 4 == "PipeBomb") then {(nearestObject [_this select 0,_this select 4]) exec "placed.sqs"}]
and in init.sqs something like MYTAG_baseGoHaywire=false

Then, in the placed.sqs something like this
Code: [Select]
#loop
~1
? alive _this: goto "loop"

MYTAG_baseGoHaywire=true

And then of course for example a trigger having a condition MYTAG_baseGoHaywire which would then set the base go haywire...


None of the syntaxes or 'code' have guarantees whatsoever :P
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline Raptorsaurus

  • Editors Depot Staff
  • *****
Re:Detect Satchel touched off.
« Reply #2 on: 30 Sep 2005, 23:02:42 »
Give a "fired" event handler to the unit placing the satchel, then in the script called by that event handler start a loop that checks the "typeOf" of the satchel.  When the "typeOf" is no longer the same as the original "typeOf" then you know the sachel has exploded.
« Last Edit: 30 Sep 2005, 23:03:17 by Raptorsaurus »

Offline 456820

  • Contributing Member
  • **
Re:Detect Satchel touched off.
« Reply #3 on: 30 Sep 2005, 23:18:08 »
what about getdammage command on the satchel to relise when the satchel has been destroyed then set everyone to combat mode ?

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:Detect Satchel touched off.
« Reply #4 on: 30 Sep 2005, 23:51:01 »
Variations are endless, but the basic idea still stands...

You can use isNull, alive, damage, typeOf...
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.