Inferno, airtank added
This commit is contained in:
Christian Franz 2024-09-12 08:16:14 +02:00
parent d205e79741
commit bfb24bf074
9 changed files with 87 additions and 18 deletions

Binary file not shown.

Binary file not shown.

View File

@ -1,5 +1,5 @@
tdz = {} tdz = {}
tdz.version = "1.1.0" tdz.version = "1.1.1"
tdz.requiredLibs = { tdz.requiredLibs = {
"dcsCommon", -- always "dcsCommon", -- always
"cfxZones", -- Zones, of course "cfxZones", -- Zones, of course
@ -19,6 +19,7 @@ VERSION HISTORY
filters FARPs filters FARPs
1.0.3 - "manual" now defaults to false 1.0.3 - "manual" now defaults to false
1.1.0 - now supports event 55 (runway touch) 1.1.0 - now supports event 55 (runway touch)
1.1.1 - corrected a type when signalling touchdown!
--]]-- --]]--
@ -47,10 +48,6 @@ function tdz.rotateXZPolyAroundCenterInRads(thePoly, center, rads)
tdz.translatePoly(thePoly, center) tdz.translatePoly(thePoly, center)
end end
--function tdz.rotateXZPolyAroundCenterInDegrees(thePoly, center, degrees)
-- tdz.rotateXZPolyAroundCenterInRads(thePoly, center, degrees * 0.0174533)
--end
function tdz.translatePoly(thePoly, v) -- straight rot, translate to 0 first function tdz.translatePoly(thePoly, v) -- straight rot, translate to 0 first
for idx, aPoint in pairs(thePoly) do for idx, aPoint in pairs(thePoly) do
aPoint.x = aPoint.x + v.x aPoint.x = aPoint.x + v.x
@ -247,7 +244,7 @@ function tdz.playerLanded(theUnit, playerName)
then then
theZone = aRunway -- FOUND! theZone = aRunway -- FOUND!
if theZone.touchDownFlag then if theZone.touchDownFlag then
theZone.pollFlag(theZone.touchDownFlag, theZone.method) theZone:pollFlag(theZone.touchDownFlag, theZone.method)
end end
trigger.action.outTextForGroup(gID, "Touchdown! Come to a FULL STOP for evaluation", 30) trigger.action.outTextForGroup(gID, "Touchdown! Come to a FULL STOP for evaluation", 30)
else else

View File

@ -13,7 +13,7 @@ airfield.allAirfields = {} -- inexed by af name, db entries: base, cat
can force the coalition of an airfield, and always provides the can force the coalition of an airfield, and always provides the
current owner as a value current owner as a value
Version History^ Version History
2.0.0 - show all airfields option 2.0.0 - show all airfields option
- fully reworked show options - fully reworked show options
- unmanaged airfields are automatically updated - unmanaged airfields are automatically updated

View File

@ -1,5 +1,5 @@
airtank = {} airtank = {}
airtank.version = "0.9.9" airtank.version = "1.0.0"
-- Module to extinguish fires controlled by the 'inferno' module. -- Module to extinguish fires controlled by the 'inferno' module.
-- For 'airtank' fire extinguisher aircraft modules. -- For 'airtank' fire extinguisher aircraft modules.
airtank.requiredLibs = { airtank.requiredLibs = {

View File

@ -1,5 +1,5 @@
inferno = {} inferno = {}
inferno.version = "0.9.9" inferno.version = "1.0.0"
inferno.requiredLibs = { inferno.requiredLibs = {
"dcsCommon", "dcsCommon",
"cfxZones", "cfxZones",
@ -91,6 +91,7 @@ function inferno.buildGrid(theZone)
local lp = {x=xc, y=zc} local lp = {x=xc, y=zc}
local yc = land.getHeight(lp) local yc = land.getHeight(lp)
ele.center = {x=xc, y=yc, z=zc} ele.center = {x=xc, y=yc, z=zc}
--[[--
if theZone.markCell then if theZone.markCell then
dcsCommon.createStaticObjectForCoalitionAtLocation(0, ele.center, dcsCommon.uuid(theZone.name), "Black_Tyre_RF", 0, false) dcsCommon.createStaticObjectForCoalitionAtLocation(0, ele.center, dcsCommon.uuid(theZone.name), "Black_Tyre_RF", 0, false)
@ -99,7 +100,7 @@ function inferno.buildGrid(theZone)
dcsCommon.createStaticObjectForCoalitionAtLocation(0, {x=ele.center.x - cellx/2, y=0, z=ele.center.z + cellz/2}, dcsCommon.uuid(theZone.name), "Windsock", 0, false) dcsCommon.createStaticObjectForCoalitionAtLocation(0, {x=ele.center.x - cellx/2, y=0, z=ele.center.z + cellz/2}, dcsCommon.uuid(theZone.name), "Windsock", 0, false)
dcsCommon.createStaticObjectForCoalitionAtLocation(0, {x=ele.center.x + cellx/2, y=0, z=ele.center.z + cellz/2}, dcsCommon.uuid(theZone.name), "Windsock", 0, false) dcsCommon.createStaticObjectForCoalitionAtLocation(0, {x=ele.center.x + cellx/2, y=0, z=ele.center.z + cellz/2}, dcsCommon.uuid(theZone.name), "Windsock", 0, false)
end end
--]]--
ele.fxpos = {x=xf, y=yc, z=zf} ele.fxpos = {x=xf, y=yc, z=zf}
ele.myType = land.getSurfaceType(lp) -- LAND=1, SHALLOW_WATER=2, WATER=3, ROAD=4, RUNWAY=5 ele.myType = land.getSurfaceType(lp) -- LAND=1, SHALLOW_WATER=2, WATER=3, ROAD=4, RUNWAY=5
-- we don not burn if a cell has shallow or deep water, or roads or runways -- we don not burn if a cell has shallow or deep water, or roads or runways
@ -223,10 +224,20 @@ function inferno.waterInZone(theZone, p, amount)
local x = p.x - theZone.minx local x = p.x - theZone.minx
local z = p.z - theZone.minz local z = p.z - theZone.minz
local xc = math.floor(x / theZone.cellSize) + 1 -- square cells! local xc = math.floor(x / theZone.cellSize) + 1 -- square cells!
if xc > theZone.numX then return nil end -- xc = theZone.numX end -- was cut off,
local zc = math.floor(z / theZone.cellSize) + 1 local zc = math.floor(z / theZone.cellSize) + 1
local ele = theZone.grid[xc][zc] if zc > theZone.numZ then return nil end -- zc = theZone.numZ end
local row = theZone.grid[xc]
if not row then
trigger.action.outText("inferno.waterinZone: cannot access row for xc = " .. xc .. ", x = " .. x .. ", numX = " .. theZone.numX .. " in " .. theZone.name, 30)
return "NIL row for xc " .. xc .. ", zc " .. zc .. " in " .. theZone.name
end
local ele = row[zc]
-- local ele = theZone.grid[xc][zc]
if not ele then if not ele then
trigger.action.outText("Inferno: no ele for <" .. theZone.name .. ">: x<" .. x .. ">z<" .. z .. ">", 30) trigger.action.outText("Inferno: no ele for <" .. theZone.name .. ">: x<" .. x .. ">z<" .. z .. ">", 30)
trigger.action.outText("with xc = " .. xc .. ", numX 0 " .. theZone.numX .. ", zc = " .. zc .. ", numZ=" .. theZone.numZ, 30)
return "NIL ele for x" .. xc .. ",z" .. zc .. " in " .. theZone.name return "NIL ele for x" .. xc .. ",z" .. zc .. " in " .. theZone.name
end end
@ -307,10 +318,7 @@ function inferno.waterDropped(p, amount, data) -- if returns non-nil, has hit a
else else
theZone.heroes[data.pName] = 1 theZone.heroes[data.pName] = 1
end end
-- trigger.action.outText("registering <" .. data.pName .. "> for drop in <" .. theZone.name .. ">", 30)
-- else
-- trigger.action.outText("Not registered, no data", 30)
end end
return inferno.waterInZone(theZone, p, amount) return inferno.waterInZone(theZone, p, amount)
end end
@ -619,6 +627,7 @@ end
-- --
function inferno.update() -- for flag polling etc function inferno.update() -- for flag polling etc
timer.scheduleFunction(inferno.update, {}, timer.getTime() + 1/inferno.ups) timer.scheduleFunction(inferno.update, {}, timer.getTime() + 1/inferno.ups)
local fireNum = 0
for idx, theZone in pairs (inferno.zones) do for idx, theZone in pairs (inferno.zones) do
if theZone.ignite and if theZone.ignite and
theZone:testZoneFlag(theZone.ignite, "change", "lastIgnite") then theZone:testZoneFlag(theZone.ignite, "change", "lastIgnite") then
@ -628,6 +637,12 @@ function inferno.update() -- for flag polling etc
if theZone.douse and theZone:testZoneFlag(theZone.douse, "change", "lastDouse") then if theZone.douse and theZone:testZoneFlag(theZone.douse, "change", "lastDouse") then
inferno.douseFire(theZone) inferno.douseFire(theZone)
end end
if theZone.burning then
fireNum = fireNum + 1
end
end
if inferno.fireNum then
trigger.action.setUserFlag(inferno.fireNum, fireNum)
end end
end end
@ -645,6 +660,7 @@ function inferno.readConfigZone()
inferno.ups = theZone:getNumberFromZoneProperty("ups", 1) inferno.ups = theZone:getNumberFromZoneProperty("ups", 1)
inferno.fireTick = theZone:getNumberFromZoneProperty("fireTick", 10) inferno.fireTick = theZone:getNumberFromZoneProperty("fireTick", 10)
inferno.cellSize = theZone:getNumberFromZoneProperty("cellSize", 100) inferno.cellSize = theZone:getNumberFromZoneProperty("cellSize", 100)
--[[
inferno.menuName = theZone:getStringFromZoneProperty("menuName", "Firefighting") inferno.menuName = theZone:getStringFromZoneProperty("menuName", "Firefighting")
inferno.impactSmoke = theZone:getBoolFromZoneProperty("impactSmoke", false) inferno.impactSmoke = theZone:getBoolFromZoneProperty("impactSmoke", false)
@ -661,7 +677,10 @@ function inferno.readConfigZone()
trigger.action.outText("+++inferno: REQUIRES radioMenu to run before inferno. 'AttachTo:' ignored.", 30) trigger.action.outText("+++inferno: REQUIRES radioMenu to run before inferno. 'AttachTo:' ignored.", 30)
end end
end end
--]]--
if theZone:hasProperty("fire#") then
inferno.fireNum = theZone:getStringFromZoneProperty("fire#", "none")
end
end end

View File

@ -1,5 +1,5 @@
cfxObjectDestructDetector = {} cfxObjectDestructDetector = {}
cfxObjectDestructDetector.version = "2.0.3" cfxObjectDestructDetector.version = "2.0.4"
cfxObjectDestructDetector.verbose = false cfxObjectDestructDetector.verbose = false
cfxObjectDestructDetector.requiredLibs = { cfxObjectDestructDetector.requiredLibs = {
"dcsCommon", -- always "dcsCommon", -- always
@ -23,6 +23,8 @@ cfxObjectDestructDetector.requiredLibs = {
if objects was killed by player if objects was killed by player
verbosity bug fixed after kill (ref to old ID) verbosity bug fixed after kill (ref to old ID)
2.0.3 if no output! given,a warning and default are given 2.0.3 if no output! given,a warning and default are given
2.0.4 prelim hardening against jul-11 and jul-12 bugs
--]]-- --]]--
cfxObjectDestructDetector.objectZones = {} cfxObjectDestructDetector.objectZones = {}
@ -146,6 +148,9 @@ function cfxObjectDestructDetector:onEvent(event)
if event.id == world.event.S_EVENT_DEAD then if event.id == world.event.S_EVENT_DEAD then
if not event.initiator then return end if not event.initiator then return end
local theObject = event.initiator local theObject = event.initiator
-- protect agianst DCS jul-11 and jul-22 bugs
if not theObject.getName then return end
-- check location -- check location
local pos = theObject:getPoint() local pos = theObject:getPoint()
local desc = theObject:getDesc() local desc = theObject:getDesc()

View File

@ -18,6 +18,8 @@ cfxPlayerScore.firstSave = true -- to force overwrite
3.3.0 - case INsensitivity for all typeScore objects 3.3.0 - case INsensitivity for all typeScore objects
3.3.1 - fixes for DCS oddity in events after update 3.3.1 - fixes for DCS oddity in events after update
- cleanup - cleanup
TODO: Kill event no longer invoked for map objetcs, attribute
to faction now, reverse invocation direction with PlayerScore
--]]-- --]]--
cfxPlayerScore.requiredLibs = { cfxPlayerScore.requiredLibs = {
@ -587,6 +589,42 @@ function cfxPlayerScore.preProcessor(theEvent)
if theEvent.initiator == nil then if theEvent.initiator == nil then
return false return false
end end
if cfxPlayerScore.verbose then
trigger.action.outText("Event preproc: " .. theEvent.id .. " (" .. dcsCommon.event2text(theEvent.id) .. ")", 30)
if theEvent.id == 8 or theEvent.id == 30 then -- dead or lost event
local who = theEvent.initiator
local name = "(nil ini)"
if who then
name = "(inval object)"
if who.getName then name = who:getName() end
end
trigger.action.outText("Dead/Lost subject: <" .. name .. ">", 30)
end
if theEvent.id == 2 then -- hit
local who = theEvent.initiator
local name = "(nil ini)"
if who then
name = "(inval initi)"
if who.getName then name = who:getName() end
if not name then -- WTF??? could be a weapon
name = "!nil getName!"
if who.getTypeName then name = who:getTypeName() end
if not name then
name = "WTFer"
end
end
end
local hit = theEvent.object
local hname = "(nil ini)"
if hit then
hname = "(inval object)"
if hit.getName then hname = hit:getName() end
end
trigger.action.outText("o:<" .. name .. "> hit <" .. hname .. ">", 30)
end
end
-- check if this was FORMERLY a player plane -- check if this was FORMERLY a player plane
local theUnit = theEvent.initiator local theUnit = theEvent.initiator
if not theUnit.getName then return end -- fix for DCS update bug if not theUnit.getName then return end -- fix for DCS update bug

View File

@ -1,6 +1,6 @@
sittingDucks = {} sittingDucks = {}
sittingDucks.verbose = false sittingDucks.verbose = false
sittingDucks.version = "1.0.0" sittingDucks.version = "1.0.1"
sittingDucks.ssbDisabled = 100 -- must match the setting of SSB, usually 100 sittingDucks.ssbDisabled = 100 -- must match the setting of SSB, usually 100
sittingDucks.resupplyTime = -1 -- seconds until "reinforcements" reopen the slot, set to -1 to turn off, 3600 is one hour sittingDucks.resupplyTime = -1 -- seconds until "reinforcements" reopen the slot, set to -1 to turn off, 3600 is one hour
sittingDucks.requiredLibs = { sittingDucks.requiredLibs = {
@ -8,6 +8,15 @@ sittingDucks.requiredLibs = {
"cfxZones", "cfxZones",
"stopGap", "stopGap",
} }
--[[
Version History
1.0.0 Initial Version
1.0.1 DCS releases 2024-jul-11 and 2024-jul-22 bugs hardening
--]]--
-- --
-- Destroying a client stand-in on an airfield will block that -- Destroying a client stand-in on an airfield will block that
-- Slot for players. Multiplayer only -- Slot for players. Multiplayer only
@ -28,6 +37,7 @@ function sittingDucks:onEvent(event)
-- home in on the kill event -- home in on the kill event
if event.id == 8 then -- dead event if event.id == 8 then -- dead event
local theUnit = event.initiator local theUnit = event.initiator
if not theUnit.getName then return end -- dcs jul-11 and jul-22 bugs
local deadName = theUnit:getName() local deadName = theUnit:getName()
if not deadName then return end if not deadName then return end
-- look at stopGap's collection of stand-ins -- look at stopGap's collection of stand-ins