OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: The-Architect 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.
-
hmm...
Add a "fired" eventHandler for the unit placing the satchel, like this:
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
#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
-
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.
-
what about getdammage command on the satchel to relise when the satchel has been destroyed then set everyone to combat mode ?
-
Variations are endless, but the basic idea still stands...
You can use isNull, alive, damage, typeOf...