Version 0.985

Quick Ref
Clone Zones Reference Resolve
Clone Relations Demo
This commit is contained in:
Christian Franz
2022-02-24 16:55:32 +01:00
parent d69ce05d80
commit f1aa9cabf1
22 changed files with 885 additions and 138 deletions

View File

@@ -1,5 +1,5 @@
cfxObjectDestructDetector = {}
cfxObjectDestructDetector.version = "1.0.1"
cfxObjectDestructDetector.version = "1.1.0"
cfxObjectDestructDetector.requiredLibs = {
"dcsCommon", -- always
"cfxZones", -- Zones, of course
@@ -9,6 +9,8 @@ cfxObjectDestructDetector.verbose = false
VERSION HISTORY
1.0.0 initial version, based on parashoo, arty zones
1.0.1 fixed bug: trigger.MISC.getUserFlag()
1.1.0 added support for method, f! and destroyed!
Detect when an object with OBJECT ID as assigned in ME dies
*** EXTENDS ZONES
@@ -69,6 +71,16 @@ function cfxObjectDestructDetector.processObjectDestructZone(aZone)
if cfxZones.hasProperty(aZone, "f-1") then
aZone.decreaseFlag = cfxZones.getStringFromZoneProperty(aZone, "f-1", "999")
end
-- new method support
aZone.method = cfxZones.getStringFromZoneProperty(aZone, "method", "flip")
if cfxZones.hasProperty(aZone, "f!") then
aZone.outDestroyFlag = cfxZones.getNumberFromZoneProperty(aZone, "f!", -1)
end
if cfxZones.hasProperty(aZone, "destroyed!") then
aZone.outDestroyFlag = cfxZones.getNumberFromZoneProperty(aZone, "destroyed!", -1)
end
end
--
-- MAIN DETECTOR
@@ -98,6 +110,11 @@ function cfxObjectDestructDetector:onEvent(event)
trigger.action.setUserFlag(aZone.decreaseFlag, val)
end
-- support for banging
if aZone.outDestroyFlag then
cfxZones.pollFlag(aZone.outDestroyFlag, aZone.method)
end
-- invoke callbacks
cfxObjectDestructDetector.invokeCallbacksFor(aZone)
if cfxObjectDestructDetector.verbose then