Version 1.2.4

Minor updates
This commit is contained in:
Christian Franz 2023-03-02 08:41:03 +01:00
parent dc81decee6
commit 5251773f6f
9 changed files with 110 additions and 36 deletions

View File

@ -1,5 +1,5 @@
aswGUI = {} aswGUI = {}
aswGUI.version = "1.0.0" aswGUI.version = "1.0.1"
aswGUI.verbose = false aswGUI.verbose = false
aswGUI.requiredLibs = { aswGUI.requiredLibs = {
"dcsCommon", -- always "dcsCommon", -- always
@ -11,6 +11,7 @@ aswGUI.requiredLibs = {
--[[-- --[[--
Version History Version History
1.0.0 - initial version 1.0.0 - initial version
1.0.1 - env.info clean-up, verbosity clean-up
--]]-- --]]--
@ -18,7 +19,7 @@ aswGUI.ups = 1 -- = once every second
aswGUI.aswCraft = {} aswGUI.aswCraft = {}
--[[-- --[[--
::::::::::::::::: ASSUMES SINGLE_UNIT GROUPS :::::::::::::::::: ::::::::::::::::: ASSUMES SINGLE-UNIT GROUPS ::::::::::::::::::
--]]-- --]]--
@ -42,7 +43,6 @@ function aswGUI.initUnit(unitName) -- now this unit exists
local theGroup = theUnit:getGroup() local theGroup = theUnit:getGroup()
local asc = {} -- set up player craft config block local asc = {} -- set up player craft config block
--local groupData = cfxMX.playerUnit2Group[unitName]
asc.groupName = theGroup:getName() -- groupData.name asc.groupName = theGroup:getName() -- groupData.name
asc.name = unitName asc.name = unitName
asc.groupID = theGroup:getID() -- groupData.groupId asc.groupID = theGroup:getID() -- groupData.groupId
@ -446,41 +446,36 @@ end
-- Event handling -- Event handling
-- --
function aswGUI:onEvent(theEvent) function aswGUI:onEvent(theEvent)
--env.info("> >ENTER aswGUI:onEvent")
if not theEvent then if not theEvent then
trigger.action.outText("+++aswGUI: nil theEvent", 30) trigger.action.outText("+++aswGUI: nil theEvent", 30)
--env.info("< <ABEND aswGUI:onEvent: nil event")
return return
end end
local theID = theEvent.id local theID = theEvent.id
if not theID then if not theID then
trigger.action.outText("+++aswGUI: nil event.ID", 30) trigger.action.outText("+++aswGUI: nil event.ID", 30)
--env.info("< <ABEND aswGUI:onEvent: nil event ID")
return return
end end
local initiator = theEvent.initiator local initiator = theEvent.initiator
if not initiator then if not initiator then
--env.info("< <ABEND aswGUI:onEvent: nil initiator")
return return
end -- not interested end -- not interested
local theUnit = initiator local theUnit = initiator
if not Unit.isExist(theUnit) then if not Unit.isExist(theUnit) then
trigger.action.outText("+++aswGUI: non-unit event filtred.", 30) if aswGUI.verbose then
--env.info("< <ABEND aswGUI:onEvent: theUnit does not exist") trigger.action.outText("+++aswGUI: non-unit event filtered.", 30)
end
return
end end
local name = theUnit:getName() local name = theUnit:getName()
if not name then if not name then
trigger.action.outText("+++aswGUI: unable to access unit name in onEvent, aborting", 30) trigger.action.outText("+++aswGUI: unable to access unit name in onEvent, aborting", 30)
--env.info("< <ABEND aswGUI:onEvent: theUnit not a unit/no name")
return return
end end
-- see if this is a player aircraft -- see if this is a player aircraft
if not theUnit.getPlayerName then if not theUnit.getPlayerName then
--env.info("< <LEAVE aswGUI:onEvent: not player unit A")
return return
end -- not a player end -- not a player
if not theUnit:getPlayerName() then if not theUnit:getPlayerName() then
--env.info("< <LEAVE aswGUI:onEvent: not player unit B")
return return
end -- not a player end -- not a player
-- this is a player unit. Is it ASW carrier? -- this is a player unit. Is it ASW carrier?
@ -492,12 +487,9 @@ function aswGUI:onEvent(theEvent)
trigger.action.outText(aType,30) trigger.action.outText(aType,30)
end end
end end
--env.info("< <LEAVE aswGUI:onEvent: not troop carrier")
return return
end end
--env.info("> >Proccing aswGUI:onEvent event <" .. theID .. "")
-- now let's access it if it was -- now let's access it if it was
-- used before -- used before
local conf = aswGUI.aswCraft[name] local conf = aswGUI.aswCraft[name]
@ -530,7 +522,6 @@ function aswGUI:onEvent(theEvent)
if theID == 21 then -- player leave if theID == 21 then -- player leave
aswGUI.resetConf(conf) aswGUI.resetConf(conf)
end end
--env.info("< <Proccing complete asw event <" .. theID .. "")
end end
-- --
@ -567,7 +558,6 @@ function aswGUI.readConfigZone()
end end
function aswGUI.start() function aswGUI.start()
--env.info(">>>ENTER asw GUI start")
if not dcsCommon.libCheck then if not dcsCommon.libCheck then
trigger.action.outText("cfx aswGUI requires dcsCommon", 30) trigger.action.outText("cfx aswGUI requires dcsCommon", 30)
return false return false
@ -584,7 +574,6 @@ function aswGUI.start()
-- say Hi -- say Hi
trigger.action.outText("cfx ASW GUI v" .. aswGUI.version .. " started.", 30) trigger.action.outText("cfx ASW GUI v" .. aswGUI.version .. " started.", 30)
--env.info("<<<asw GUI started")
return true return true
end end

View File

@ -5,7 +5,7 @@ autoCSAR.requiredLibs = {
"cfxZones", -- Zones, of course "cfxZones", -- Zones, of course
} }
autoCSAR.killDelay = 2 * 60 autoCSAR.killDelay = 2 * 60
autoCSAR.counter = 31 -- any nuber is good, to kick-off counting autoCSAR.counter = 31 -- any number is good, to kick-off counting
--[[-- --[[--
VERSION HISTORY VERSION HISTORY
1.0.0 - Initial Version 1.0.0 - Initial Version

View File

@ -1,5 +1,5 @@
cfxHeloTroops = {} cfxHeloTroops = {}
cfxHeloTroops.version = "2.4.0" cfxHeloTroops.version = "2.4.1"
cfxHeloTroops.verbose = false cfxHeloTroops.verbose = false
cfxHeloTroops.autoDrop = true cfxHeloTroops.autoDrop = true
cfxHeloTroops.autoPickup = false cfxHeloTroops.autoPickup = false
@ -30,6 +30,8 @@ cfxHeloTroops.pickupRange = 100 -- meters
- eliminated cfxPlayer module import and all dependencies - eliminated cfxPlayer module import and all dependencies
- added support for groupTracker / limbo - added support for groupTracker / limbo
- removed restriction to only apply to helicopters in anticipation of the C-130 Hercules appearing in the game - removed restriction to only apply to helicopters in anticipation of the C-130 Hercules appearing in the game
2.4.1 - new actionSound attribute, sound plays to group whenever
troops have boarded or disembarked
--]]-- --]]--
-- --
@ -647,7 +649,7 @@ function cfxHeloTroops.deployTroopsFromHelicopter(conf)
troop.destination = dest -- transfer target zone for attackzone oders troop.destination = dest -- transfer target zone for attackzone oders
cfxGroundTroops.addGroundTroopsToPool(troop) -- will schedule move orders cfxGroundTroops.addGroundTroopsToPool(troop) -- will schedule move orders
trigger.action.outTextForGroup(conf.id, "<" .. theGroup:getName() .. "> have deployed to the ground with orders " .. orders .. "!", 30) trigger.action.outTextForGroup(conf.id, "<" .. theGroup:getName() .. "> have deployed to the ground with orders " .. orders .. "!", 30)
trigger.action.outSoundForGroup(conf.id, cfxHeloTroops.actionSound) -- "Quest Snare 3.wav")
-- see if this is tracked by a tracker, and pass them back so -- see if this is tracked by a tracker, and pass them back so
-- they can un-limbo -- they can un-limbo
if groupTracker then if groupTracker then
@ -711,6 +713,7 @@ function cfxHeloTroops.doLoadGroup(args)
conf.troopsOnBoard.destination = pooledGroup.destination -- may be nil conf.troopsOnBoard.destination = pooledGroup.destination -- may be nil
cfxGroundTroops.removeTroopsFromPool(pooledGroup) cfxGroundTroops.removeTroopsFromPool(pooledGroup)
trigger.action.outTextForGroup(conf.id, "Team '".. conf.troopsOnBoard.name .."' loaded and has orders <" .. conf.troopsOnBoard.orders .. ">", 30) trigger.action.outTextForGroup(conf.id, "Team '".. conf.troopsOnBoard.name .."' loaded and has orders <" .. conf.troopsOnBoard.orders .. ">", 30)
--trigger.action.outSoundForGroup(conf.id, cfxHeloTroops.actionSound) -- "Quest Snare 3.wav")
else else
if cfxHeloTroops.verbose then if cfxHeloTroops.verbose then
trigger.action.outText("+++heloT: ".. conf.troopsOnBoard.name .." was not committed to ground troops", 30) trigger.action.outText("+++heloT: ".. conf.troopsOnBoard.name .." was not committed to ground troops", 30)
@ -729,6 +732,7 @@ function cfxHeloTroops.doLoadGroup(args)
-- say so -- say so
trigger.action.outTextForGroup(conf.id, "Team '".. conf.troopsOnBoard.name .."' aboard, ready to go!", 30) trigger.action.outTextForGroup(conf.id, "Team '".. conf.troopsOnBoard.name .."' aboard, ready to go!", 30)
trigger.action.outSoundForGroup(conf.id, cfxHeloTroops.actionSound) -- "Quest Snare 3.wav")
-- reset menu -- reset menu
cfxHeloTroops.removeComms(conf.unit) cfxHeloTroops.removeComms(conf.unit)
@ -879,6 +883,8 @@ function cfxHeloTroops.readConfigZone()
cfxHeloTroops.pickupRange = cfxZones.getNumberFromZoneProperty(theZone, "pickupRange", 100) cfxHeloTroops.pickupRange = cfxZones.getNumberFromZoneProperty(theZone, "pickupRange", 100)
cfxHeloTroops.combatDropScore = cfxZones.getNumberFromZoneProperty(theZone, "combatDropScore", 200) cfxHeloTroops.combatDropScore = cfxZones.getNumberFromZoneProperty(theZone, "combatDropScore", 200)
cfxHeloTroops.actionSound = cfxZones.getStringFromZoneProperty(theZone, "actionSound", "Quest Snare 3.wav")
-- add own troop carriers -- add own troop carriers
if cfxZones.hasProperty(theZone, "troopCarriers") then if cfxZones.hasProperty(theZone, "troopCarriers") then
local tc = cfxZones.getStringFromZoneProperty(theZone, "troopCarriers", "UH-1D") local tc = cfxZones.getStringFromZoneProperty(theZone, "troopCarriers", "UH-1D")

View File

@ -152,8 +152,7 @@ function cfxSmokeZone.checkFlags()
end end
function cfxSmokeZone.start() function cfxSmokeZone.start()
if not dcsCommon.libCheck("cfx Smoke Zones", if not dcsCommon.libCheck("cfx Smoke Zones", cfxSmokeZone.requiredLibs) then
cfxSmokeZone.requiredLibs) then
return false return false
end end

View File

@ -1,5 +1,5 @@
dcsCommon = {} dcsCommon = {}
dcsCommon.version = "2.8.2" dcsCommon.version = "2.8.3"
--[[-- VERSION HISTORY --[[-- VERSION HISTORY
2.2.6 - compassPositionOfARelativeToB 2.2.6 - compassPositionOfARelativeToB
- clockPositionOfARelativeToB - clockPositionOfARelativeToB
@ -138,6 +138,8 @@ dcsCommon.version = "2.8.2"
- made getEnemyCoalitionFor() more resilient - made getEnemyCoalitionFor() more resilient
- fix to smallRandom for negative numbers - fix to smallRandom for negative numbers
- isTroopCarrierType uses wildArrayContainsString - isTroopCarrierType uses wildArrayContainsString
2.8.3 - small optimizations in bearingFromAtoB()
- new whichSideOfMine()
--]]-- --]]--
@ -735,9 +737,9 @@ dcsCommon.version = "2.8.2"
return 0 return 0
end end
dx = B.x - A.x local dx = B.x - A.x
dz = B.z - A.z local dz = B.z - A.z
bearing = math.atan2(dz, dx) -- in radiants local bearing = math.atan2(dz, dx) -- in radiants
return bearing return bearing
end end
@ -865,6 +867,38 @@ dcsCommon.version = "2.8.2"
return "hot" return "hot"
end end
function dcsCommon.whichSideOfMine(theUnit, target) -- returs two values: -1/1 = left/right and "left"/"right"
if not theUnit then return nil end
if not target then return nil end
local uDOF = theUnit:getPosition() -- returns p, x, y, z Vec3
-- with x, y, z being the normalised vectors for right, up, forward
local heading = math.atan2(uDOF.x.z, uDOF.x.x) -- returns rads
if heading < 0 then
heading = heading + 2 * math.pi -- put heading in range of 0 to 2*pi
end
-- heading now runs from 0 through 2Pi
local A = uDOF.p
local B = target:getPoint()
-- now get bearing from theUnit to target
local dx = B.x - A.x
local dz = B.z - A.z
local bearing = math.atan2(dz, dx) -- in rads
if bearing < 0 then
bearing = bearing + 2 * math.pi -- make bearing 0 to 2*pi
end
-- we now have bearing to B, and own heading.
-- subtract own heading from bearing to see at what
-- bearing target would be if we 'turned the world' so
-- that theUnit is heading 0
local dBearing = bearing - heading
-- if result < 0 or > Pi (=180°), target is left from us
if dBearing < 0 or dBearing > math.pi then return -1, "left" end
return 1, "right"
-- note: no separate case for straight in front or behind
end
function dcsCommon.randomDegrees() function dcsCommon.randomDegrees()
local degrees = math.random(360) * 3.14152 / 180 local degrees = math.random(360) * 3.14152 / 180
return degrees return degrees

View File

@ -1,5 +1,5 @@
limitedAirframes = {} limitedAirframes = {}
limitedAirframes.version = "1.5.1" limitedAirframes.version = "1.5.3"
limitedAirframes.verbose = false limitedAirframes.verbose = false
limitedAirframes.enabled = true -- can be turned off limitedAirframes.enabled = true -- can be turned off
limitedAirframes.userCanToggle = true -- F10 menu? limitedAirframes.userCanToggle = true -- F10 menu?
@ -54,6 +54,8 @@ limitedAirframes.requiredLibs = {
- 1.5.1 - new "announcer" attribute - 1.5.1 - new "announcer" attribute
- 1.5.2 - integration with autoCSAR: prevent limitedAF from creating csar - 1.5.2 - integration with autoCSAR: prevent limitedAF from creating csar
when autoCSAR is active when autoCSAR is active
- 1.5.3 - ... but do allow it if not coming from 'ejected' so ditching
a plane will again create CSAR missions
--]]-- --]]--
@ -427,7 +429,7 @@ function limitedAirframes.somethingHappened(event)
-- removed dual 21 detection here -- removed dual 21 detection here
if ID == 21 then if ID == 21 then -- player left unit
-- remove pilot name from unit name -- remove pilot name from unit name
limitedAirframes.unitFlownByPlayer[unitName] = nil limitedAirframes.unitFlownByPlayer[unitName] = nil
--trigger.action.outText("limAir: 21 -- unit " .. unitName .. " unoccupied", 30) --trigger.action.outText("limAir: 21 -- unit " .. unitName .. " unoccupied", 30)
@ -539,7 +541,7 @@ function limitedAirframes.handlePlayerLeftUnit(event)
end end
limitedAirframes.updatePlayerInUnit(theUnit, "MIA") -- cosmetic only limitedAirframes.updatePlayerInUnit(theUnit, "MIA") -- cosmetic only
limitedAirframes.createCSAR(theUnit) limitedAirframes.createCSAR(theUnit, true) -- will never be 31 event, must force now
end end
@ -560,7 +562,7 @@ function limitedAirframes.pilotEjected(event)
limitedAirframes.updatePlayerInUnit(theUnit, "MIA") -- cosmetic only limitedAirframes.updatePlayerInUnit(theUnit, "MIA") -- cosmetic only
-- create CSAR if applicable -- create CSAR if applicable
if not hasLostTheWar then if not hasLostTheWar then
limitedAirframes.createCSAR(theUnit) limitedAirframes.createCSAR(theUnit) -- not forced, autoCSAR can hande
end end
end end
@ -666,9 +668,19 @@ function limitedAirframes.checkPlayerFrameAvailability(event)
end end
function limitedAirframes.createCSAR(theUnit) function limitedAirframes.createCSAR(theUnit, forced)
if not forced then forced = false end
-- override if autoCSAR is installed -- override if autoCSAR is installed
if autoCSAR then return end -- and let autoCSAR handle creation of CSAR when pilot's
-- seat hits ground, event 31
if (not forced) and autoCSAR then
-- csar is going to be created with parachute hitting the ground
if limitedAirframes.verbose then
trigger.action.outText("+++limA: aborting CSAR creation: autoCSAR active", 30)
end
return
end
-- only do this if we have installed CSAR Manager -- only do this if we have installed CSAR Manager
if csarManager and csarManager.createCSARforUnit then if csarManager and csarManager.createCSARforUnit then

View File

@ -0,0 +1,25 @@
missionRestart = {}
missionRestart.restarting = false
function missionRestart.restart()
if missionRestart.restarting then return end
trigger.action.outText("Server: Mission restarting...", 30)
local res = net.dostring_in("gui", "mn = DCS.getMissionFilename(); success = net.load_mission(mn); return success")
missionRestart.restarting = true
end
function missionRestart.update()
-- call me in a second to poll triggers
timer.scheduleFunction(missionRestart.update, {}, timer.getTime() + 1)
if trigger.misc.getUserFlag("simpleMissionRestart") > 0 then
missionRestart.restart()
end
end
missionRestart.update()

View File

@ -1,5 +1,5 @@
williePete = {} williePete = {}
williePete.version = "1.0.0" williePete.version = "1.0.1"
williePete.ups = 10 -- we update at 10 fps, so accuracy of a williePete.ups = 10 -- we update at 10 fps, so accuracy of a
-- missile moving at Mach 2 is within 33 meters, -- missile moving at Mach 2 is within 33 meters,
-- with interpolation even at 3 meters -- with interpolation even at 3 meters
@ -9,6 +9,12 @@ williePete.requiredLibs = {
"cfxZones", -- Zones, of course "cfxZones", -- Zones, of course
"cfxMX", "cfxMX",
} }
--[[--
Version History
1.0.0 - Initial version
1.0.1 - update to suppress verbosity
--]]--
williePete.willies = {} williePete.willies = {}
williePete.wpZones = {} williePete.wpZones = {}
@ -407,7 +413,10 @@ function williePete.isWP(theWeapon)
for idx, wpw in pairs(williePete.smokeWeapons) do for idx, wpw in pairs(williePete.smokeWeapons) do
if theDesc == wpw then return true end if theDesc == wpw then return true end
end end
trigger.action.outText(theDesc .. " is no wp, ignoring.", 30) if williePete.verbose then
trigger.action.outText(theDesc .. " is no wp, ignoring.", 30)
end
return false return false
end end

Binary file not shown.