mirror of
https://github.com/weyne85/DML.git
synced 2025-10-29 16:57:49 +00:00
Version 1.2.4
Minor updates
This commit is contained in:
parent
dc81decee6
commit
5251773f6f
@ -1,5 +1,5 @@
|
||||
aswGUI = {}
|
||||
aswGUI.version = "1.0.0"
|
||||
aswGUI.version = "1.0.1"
|
||||
aswGUI.verbose = false
|
||||
aswGUI.requiredLibs = {
|
||||
"dcsCommon", -- always
|
||||
@ -11,6 +11,7 @@ aswGUI.requiredLibs = {
|
||||
--[[--
|
||||
Version History
|
||||
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 = {}
|
||||
|
||||
--[[--
|
||||
::::::::::::::::: 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 asc = {} -- set up player craft config block
|
||||
--local groupData = cfxMX.playerUnit2Group[unitName]
|
||||
asc.groupName = theGroup:getName() -- groupData.name
|
||||
asc.name = unitName
|
||||
asc.groupID = theGroup:getID() -- groupData.groupId
|
||||
@ -446,41 +446,36 @@ end
|
||||
-- Event handling
|
||||
--
|
||||
function aswGUI:onEvent(theEvent)
|
||||
--env.info("> >ENTER aswGUI:onEvent")
|
||||
if not theEvent then
|
||||
trigger.action.outText("+++aswGUI: nil theEvent", 30)
|
||||
--env.info("< <ABEND aswGUI:onEvent: nil event")
|
||||
return
|
||||
end
|
||||
local theID = theEvent.id
|
||||
if not theID then
|
||||
trigger.action.outText("+++aswGUI: nil event.ID", 30)
|
||||
--env.info("< <ABEND aswGUI:onEvent: nil event ID")
|
||||
return
|
||||
end
|
||||
local initiator = theEvent.initiator
|
||||
if not initiator then
|
||||
--env.info("< <ABEND aswGUI:onEvent: nil initiator")
|
||||
return
|
||||
end -- not interested
|
||||
local theUnit = initiator
|
||||
if not Unit.isExist(theUnit) then
|
||||
trigger.action.outText("+++aswGUI: non-unit event filtred.", 30)
|
||||
--env.info("< <ABEND aswGUI:onEvent: theUnit does not exist")
|
||||
if aswGUI.verbose then
|
||||
trigger.action.outText("+++aswGUI: non-unit event filtered.", 30)
|
||||
end
|
||||
return
|
||||
end
|
||||
local name = theUnit:getName()
|
||||
if not name then
|
||||
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
|
||||
end
|
||||
-- see if this is a player aircraft
|
||||
if not theUnit.getPlayerName then
|
||||
--env.info("< <LEAVE aswGUI:onEvent: not player unit A")
|
||||
return
|
||||
end -- not a player
|
||||
if not theUnit:getPlayerName() then
|
||||
--env.info("< <LEAVE aswGUI:onEvent: not player unit B")
|
||||
return
|
||||
end -- not a player
|
||||
-- this is a player unit. Is it ASW carrier?
|
||||
@ -492,12 +487,9 @@ function aswGUI:onEvent(theEvent)
|
||||
trigger.action.outText(aType,30)
|
||||
end
|
||||
end
|
||||
--env.info("< <LEAVE aswGUI:onEvent: not troop carrier")
|
||||
return
|
||||
end
|
||||
|
||||
--env.info("> >Proccing aswGUI:onEvent event <" .. theID .. "")
|
||||
|
||||
-- now let's access it if it was
|
||||
-- used before
|
||||
local conf = aswGUI.aswCraft[name]
|
||||
@ -530,7 +522,6 @@ function aswGUI:onEvent(theEvent)
|
||||
if theID == 21 then -- player leave
|
||||
aswGUI.resetConf(conf)
|
||||
end
|
||||
--env.info("< <Proccing complete asw event <" .. theID .. "")
|
||||
end
|
||||
|
||||
--
|
||||
@ -567,7 +558,6 @@ function aswGUI.readConfigZone()
|
||||
end
|
||||
|
||||
function aswGUI.start()
|
||||
--env.info(">>>ENTER asw GUI start")
|
||||
if not dcsCommon.libCheck then
|
||||
trigger.action.outText("cfx aswGUI requires dcsCommon", 30)
|
||||
return false
|
||||
@ -584,7 +574,6 @@ function aswGUI.start()
|
||||
|
||||
-- say Hi
|
||||
trigger.action.outText("cfx ASW GUI v" .. aswGUI.version .. " started.", 30)
|
||||
--env.info("<<<asw GUI started")
|
||||
return true
|
||||
end
|
||||
|
||||
|
||||
@ -5,7 +5,7 @@ autoCSAR.requiredLibs = {
|
||||
"cfxZones", -- Zones, of course
|
||||
}
|
||||
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
|
||||
1.0.0 - Initial Version
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
cfxHeloTroops = {}
|
||||
cfxHeloTroops.version = "2.4.0"
|
||||
cfxHeloTroops.version = "2.4.1"
|
||||
cfxHeloTroops.verbose = false
|
||||
cfxHeloTroops.autoDrop = true
|
||||
cfxHeloTroops.autoPickup = false
|
||||
@ -30,6 +30,8 @@ cfxHeloTroops.pickupRange = 100 -- meters
|
||||
- eliminated cfxPlayer module import and all dependencies
|
||||
- added support for groupTracker / limbo
|
||||
- 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
|
||||
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.outSoundForGroup(conf.id, cfxHeloTroops.actionSound) -- "Quest Snare 3.wav")
|
||||
-- see if this is tracked by a tracker, and pass them back so
|
||||
-- they can un-limbo
|
||||
if groupTracker then
|
||||
@ -711,6 +713,7 @@ function cfxHeloTroops.doLoadGroup(args)
|
||||
conf.troopsOnBoard.destination = pooledGroup.destination -- may be nil
|
||||
cfxGroundTroops.removeTroopsFromPool(pooledGroup)
|
||||
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
|
||||
if cfxHeloTroops.verbose then
|
||||
trigger.action.outText("+++heloT: ".. conf.troopsOnBoard.name .." was not committed to ground troops", 30)
|
||||
@ -729,6 +732,7 @@ function cfxHeloTroops.doLoadGroup(args)
|
||||
|
||||
-- say so
|
||||
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
|
||||
cfxHeloTroops.removeComms(conf.unit)
|
||||
@ -879,6 +883,8 @@ function cfxHeloTroops.readConfigZone()
|
||||
cfxHeloTroops.pickupRange = cfxZones.getNumberFromZoneProperty(theZone, "pickupRange", 100)
|
||||
cfxHeloTroops.combatDropScore = cfxZones.getNumberFromZoneProperty(theZone, "combatDropScore", 200)
|
||||
|
||||
cfxHeloTroops.actionSound = cfxZones.getStringFromZoneProperty(theZone, "actionSound", "Quest Snare 3.wav")
|
||||
|
||||
-- add own troop carriers
|
||||
if cfxZones.hasProperty(theZone, "troopCarriers") then
|
||||
local tc = cfxZones.getStringFromZoneProperty(theZone, "troopCarriers", "UH-1D")
|
||||
|
||||
@ -152,8 +152,7 @@ function cfxSmokeZone.checkFlags()
|
||||
end
|
||||
|
||||
function cfxSmokeZone.start()
|
||||
if not dcsCommon.libCheck("cfx Smoke Zones",
|
||||
cfxSmokeZone.requiredLibs) then
|
||||
if not dcsCommon.libCheck("cfx Smoke Zones", cfxSmokeZone.requiredLibs) then
|
||||
return false
|
||||
end
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
dcsCommon = {}
|
||||
dcsCommon.version = "2.8.2"
|
||||
dcsCommon.version = "2.8.3"
|
||||
--[[-- VERSION HISTORY
|
||||
2.2.6 - compassPositionOfARelativeToB
|
||||
- clockPositionOfARelativeToB
|
||||
@ -138,6 +138,8 @@ dcsCommon.version = "2.8.2"
|
||||
- made getEnemyCoalitionFor() more resilient
|
||||
- fix to smallRandom for negative numbers
|
||||
- isTroopCarrierType uses wildArrayContainsString
|
||||
2.8.3 - small optimizations in bearingFromAtoB()
|
||||
- new whichSideOfMine()
|
||||
|
||||
--]]--
|
||||
|
||||
@ -735,9 +737,9 @@ dcsCommon.version = "2.8.2"
|
||||
return 0
|
||||
end
|
||||
|
||||
dx = B.x - A.x
|
||||
dz = B.z - A.z
|
||||
bearing = math.atan2(dz, dx) -- in radiants
|
||||
local dx = B.x - A.x
|
||||
local dz = B.z - A.z
|
||||
local bearing = math.atan2(dz, dx) -- in radiants
|
||||
return bearing
|
||||
end
|
||||
|
||||
@ -865,6 +867,38 @@ dcsCommon.version = "2.8.2"
|
||||
return "hot"
|
||||
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()
|
||||
local degrees = math.random(360) * 3.14152 / 180
|
||||
return degrees
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
limitedAirframes = {}
|
||||
limitedAirframes.version = "1.5.1"
|
||||
limitedAirframes.version = "1.5.3"
|
||||
limitedAirframes.verbose = false
|
||||
limitedAirframes.enabled = true -- can be turned off
|
||||
limitedAirframes.userCanToggle = true -- F10 menu?
|
||||
@ -54,6 +54,8 @@ limitedAirframes.requiredLibs = {
|
||||
- 1.5.1 - new "announcer" attribute
|
||||
- 1.5.2 - integration with autoCSAR: prevent limitedAF from creating csar
|
||||
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
|
||||
|
||||
if ID == 21 then
|
||||
if ID == 21 then -- player left unit
|
||||
-- remove pilot name from unit name
|
||||
limitedAirframes.unitFlownByPlayer[unitName] = nil
|
||||
--trigger.action.outText("limAir: 21 -- unit " .. unitName .. " unoccupied", 30)
|
||||
@ -539,7 +541,7 @@ function limitedAirframes.handlePlayerLeftUnit(event)
|
||||
end
|
||||
|
||||
limitedAirframes.updatePlayerInUnit(theUnit, "MIA") -- cosmetic only
|
||||
limitedAirframes.createCSAR(theUnit)
|
||||
limitedAirframes.createCSAR(theUnit, true) -- will never be 31 event, must force now
|
||||
end
|
||||
|
||||
|
||||
@ -560,7 +562,7 @@ function limitedAirframes.pilotEjected(event)
|
||||
limitedAirframes.updatePlayerInUnit(theUnit, "MIA") -- cosmetic only
|
||||
-- create CSAR if applicable
|
||||
if not hasLostTheWar then
|
||||
limitedAirframes.createCSAR(theUnit)
|
||||
limitedAirframes.createCSAR(theUnit) -- not forced, autoCSAR can hande
|
||||
end
|
||||
end
|
||||
|
||||
@ -666,9 +668,19 @@ function limitedAirframes.checkPlayerFrameAvailability(event)
|
||||
end
|
||||
|
||||
|
||||
function limitedAirframes.createCSAR(theUnit)
|
||||
function limitedAirframes.createCSAR(theUnit, forced)
|
||||
if not forced then forced = false end
|
||||
|
||||
-- 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
|
||||
if csarManager and csarManager.createCSARforUnit then
|
||||
|
||||
25
modules/missionRestart.lua
Normal file
25
modules/missionRestart.lua
Normal 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()
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
williePete = {}
|
||||
williePete.version = "1.0.0"
|
||||
williePete.version = "1.0.1"
|
||||
williePete.ups = 10 -- we update at 10 fps, so accuracy of a
|
||||
-- missile moving at Mach 2 is within 33 meters,
|
||||
-- with interpolation even at 3 meters
|
||||
@ -9,6 +9,12 @@ williePete.requiredLibs = {
|
||||
"cfxZones", -- Zones, of course
|
||||
"cfxMX",
|
||||
}
|
||||
--[[--
|
||||
Version History
|
||||
1.0.0 - Initial version
|
||||
1.0.1 - update to suppress verbosity
|
||||
|
||||
--]]--
|
||||
|
||||
williePete.willies = {}
|
||||
williePete.wpZones = {}
|
||||
@ -407,7 +413,10 @@ function williePete.isWP(theWeapon)
|
||||
for idx, wpw in pairs(williePete.smokeWeapons) do
|
||||
if theDesc == wpw then return true end
|
||||
end
|
||||
if williePete.verbose then
|
||||
trigger.action.outText(theDesc .. " is no wp, ignoring.", 30)
|
||||
end
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
|
||||
BIN
tutorial & demo missions/demo - Willie Nillie.miz
Normal file
BIN
tutorial & demo missions/demo - Willie Nillie.miz
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user