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.version = "1.1.0"
tdz.version = "1.1.1"
tdz.requiredLibs = {
"dcsCommon", -- always
"cfxZones", -- Zones, of course
@ -19,6 +19,7 @@ VERSION HISTORY
filters FARPs
1.0.3 - "manual" now defaults to false
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)
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
for idx, aPoint in pairs(thePoly) do
aPoint.x = aPoint.x + v.x
@ -247,7 +244,7 @@ function tdz.playerLanded(theUnit, playerName)
then
theZone = aRunway -- FOUND!
if theZone.touchDownFlag then
theZone.pollFlag(theZone.touchDownFlag, theZone.method)
theZone:pollFlag(theZone.touchDownFlag, theZone.method)
end
trigger.action.outTextForGroup(gID, "Touchdown! Come to a FULL STOP for evaluation", 30)
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
current owner as a value
Version History^
Version History
2.0.0 - show all airfields option
- fully reworked show options
- unmanaged airfields are automatically updated

View File

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

View File

@ -1,5 +1,5 @@
inferno = {}
inferno.version = "0.9.9"
inferno.version = "1.0.0"
inferno.requiredLibs = {
"dcsCommon",
"cfxZones",
@ -91,6 +91,7 @@ function inferno.buildGrid(theZone)
local lp = {x=xc, y=zc}
local yc = land.getHeight(lp)
ele.center = {x=xc, y=yc, z=zc}
--[[--
if theZone.markCell then
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)
end
--]]--
ele.fxpos = {x=xf, y=yc, z=zf}
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
@ -223,10 +224,20 @@ function inferno.waterInZone(theZone, p, amount)
local x = p.x - theZone.minx
local z = p.z - theZone.minz
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 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
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
end
@ -307,10 +318,7 @@ function inferno.waterDropped(p, amount, data) -- if returns non-nil, has hit a
else
theZone.heroes[data.pName] = 1
end
-- trigger.action.outText("registering <" .. data.pName .. "> for drop in <" .. theZone.name .. ">", 30)
-- else
-- trigger.action.outText("Not registered, no data", 30)
end
return inferno.waterInZone(theZone, p, amount)
end
@ -619,6 +627,7 @@ end
--
function inferno.update() -- for flag polling etc
timer.scheduleFunction(inferno.update, {}, timer.getTime() + 1/inferno.ups)
local fireNum = 0
for idx, theZone in pairs (inferno.zones) do
if theZone.ignite and
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
inferno.douseFire(theZone)
end
if theZone.burning then
fireNum = fireNum + 1
end
end
if inferno.fireNum then
trigger.action.setUserFlag(inferno.fireNum, fireNum)
end
end
@ -645,6 +660,7 @@ function inferno.readConfigZone()
inferno.ups = theZone:getNumberFromZoneProperty("ups", 1)
inferno.fireTick = theZone:getNumberFromZoneProperty("fireTick", 10)
inferno.cellSize = theZone:getNumberFromZoneProperty("cellSize", 100)
--[[
inferno.menuName = theZone:getStringFromZoneProperty("menuName", "Firefighting")
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)
end
end
--]]--
if theZone:hasProperty("fire#") then
inferno.fireNum = theZone:getStringFromZoneProperty("fire#", "none")
end
end

View File

@ -1,5 +1,5 @@
cfxObjectDestructDetector = {}
cfxObjectDestructDetector.version = "2.0.3"
cfxObjectDestructDetector.version = "2.0.4"
cfxObjectDestructDetector.verbose = false
cfxObjectDestructDetector.requiredLibs = {
"dcsCommon", -- always
@ -23,6 +23,8 @@ cfxObjectDestructDetector.requiredLibs = {
if objects was killed by player
verbosity bug fixed after kill (ref to old ID)
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 = {}
@ -146,6 +148,9 @@ function cfxObjectDestructDetector:onEvent(event)
if event.id == world.event.S_EVENT_DEAD then
if not event.initiator then return end
local theObject = event.initiator
-- protect agianst DCS jul-11 and jul-22 bugs
if not theObject.getName then return end
-- check location
local pos = theObject:getPoint()
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.1 - fixes for DCS oddity in events after update
- cleanup
TODO: Kill event no longer invoked for map objetcs, attribute
to faction now, reverse invocation direction with PlayerScore
--]]--
cfxPlayerScore.requiredLibs = {
@ -587,6 +589,42 @@ function cfxPlayerScore.preProcessor(theEvent)
if theEvent.initiator == nil then
return false
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
local theUnit = theEvent.initiator
if not theUnit.getName then return end -- fix for DCS update bug

View File

@ -1,6 +1,6 @@
sittingDucks = {}
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.resupplyTime = -1 -- seconds until "reinforcements" reopen the slot, set to -1 to turn off, 3600 is one hour
sittingDucks.requiredLibs = {
@ -8,6 +8,15 @@ sittingDucks.requiredLibs = {
"cfxZones",
"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
-- Slot for players. Multiplayer only
@ -28,6 +37,7 @@ function sittingDucks:onEvent(event)
-- home in on the kill event
if event.id == 8 then -- dead event
local theUnit = event.initiator
if not theUnit.getName then return end -- dcs jul-11 and jul-22 bugs
local deadName = theUnit:getName()
if not deadName then return end
-- look at stopGap's collection of stand-ins