From 518224a43791c72ef64919d666a69315bbfa34e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Qu=C3=A9ton=201-1?= <13013609+Queton1-1@users.noreply.github.com> Date: Sat, 7 Oct 2023 12:36:01 +0200 Subject: [PATCH 1/4] Add ctld.addPlayerAircraftByType If option true, allow units to CTLD by aircraft type and not by pilot name --- CTLD.lua | 190 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 190 insertions(+) diff --git a/CTLD.lua b/CTLD.lua index 567a1f8..2fb734d 100644 --- a/CTLD.lua +++ b/CTLD.lua @@ -42,6 +42,9 @@ ctld.staticBugWorkaround = false -- DCS had a bug where destroying statics woul ctld.disableAllSmoke = false -- if true, all smoke is diabled at pickup and drop off zones regardless of settings below. Leave false to respect settings below +--> Allow units to CTLD by aircraft type and not by pilot name +ctld.addPlayerAircraftByType = true + ctld.hoverPickup = true -- if set to false you can load crates with the F10 menu instead of hovering... Only if not using real crates! ctld.enableCrates = true -- if false, Helis will not be able to spawn or unpack crates so will be normal CTTS @@ -228,6 +231,56 @@ ctld.wpZones = { -- ******************** Transports names ********************** +-- If ctld.addPlayerAircraftByType = True, comment or uncomment lines to allow aircraft's type carry CTLD +ctld.aircraftTypeTable = { + --%%%%% MODS %%%%% + "Bronco-OV-10A", + "Hercules", + --"SK-60", + "UH-60L", + --"T-45", + + --%%%%% CHOPPERS %%%%% + "Ka-50", + "Ka-50_3", + "Mi-8MT", + "Mi-24P", + "SA342L", + "SA342M", + "SA342Mistral", + "SA342Minigun", + "UH-1H", + + --%%%%% AIRCRAFTS %%%%% + "C-101EB", + "C-101CC", + --"Christen Eagle II", + "L-39C", + "L-39ZA", + "MB-339A", + "MB-339APAN", + "Mirage-F1B", + "Mirage-F1BD", + "Mirage-F1BE", + "Mirage-F1BQ", + "Mirage-F1DDA", + --"Su-25T", + --"Yak-52", + + --%%%%% WARBIRDS %%%%% + --"Bf-109K-4", + --"Fw 190A8", + --"FW-190D9", + --"I-16", + "MosquitoFBMkVI", + --"P-47D-30", + --"P-47D-40", + --"P-51D", + --"P-51D-30-NA", + --"SpitfireLFMkIX", + --"SpitfireLFMkIXCW", + "TF-51D", +} -- Use any of the predefined names or set your own ones ctld.transportPilotNames = { @@ -431,6 +484,51 @@ ctld.unitLoadLimits = { -- ["SA342L"] = 4, -- ["SA342M"] = 4, + --%%%%% MODS %%%%% + ["Bronco-OV-10A"] = 4, + ["Hercules"] = 30, + ["SK-60"] = 1, + ["UH-60L"] = 12, + ["T-45"] = 1, + + --%%%%% CHOPPERS %%%%% + ["Mi-8MT"] = 16, + ["Mi-24P"] = 10, + ["SA342L"] = 4, + ["SA342M"] = 4, + ["SA342Mistral"] = 4, + ["SA342Minigun"] = 3, + ["UH-1H"] = 8, + + --%%%%% AIRCRAFTS %%%%% + ["C-101EB"] = 1, + ["C-101CC"] = 1, + ["Christen Eagle II"] = 1, + ["L-39C"] = 1, + ["L-39ZA"] = 1, + ["MB-339A"] = 1, + ["MB-339APAN"] = 1, + ["Mirage-F1B"] = 1, + ["Mirage-F1BD"] = 1, + ["Mirage-F1BE"] = 1, + ["Mirage-F1BQ"] = 1, + ["Mirage-F1DDA"] = 1, + ["Su-25T"] = 1, + ["Yak-52"] = 1, + + --%%%%% WARBIRDS %%%%% + ["Bf-109K-4"] = 1, + ["Fw 190A8"] = 1, + ["FW-190D9"] = 1, + ["I-16"] = 1, + ["MosquitoFBMkVI"] = 1, + ["P-47D-30"] = 1, + ["P-47D-40"] = 1, + ["P-51D"] = 1, + ["P-51D-30-NA"] = 1, + ["SpitfireLFMkIX"] = 1, + ["SpitfireLFMkIXCW"] = 1, + ["TF-51D"] = 1, } @@ -455,6 +553,53 @@ ctld.unitActions = { -- ["SA342L"] = {crates=false, troops=true}, -- ["SA342M"] = {crates=false, troops=true}, + --%%%%% MODS %%%%% + ["Bronco-OV-10A"] = {crates=true, troops=true}, + ["Hercules"] = {crates=true, troops=true}, + ["SK-60"] = {crates=true, troops=true}, + ["UH-60L"] = {crates=true, troops=true}, + ["T-45"] = {crates=true, troops=true}, + + --%%%%% CHOPPERS %%%%% + ["Ka-50"] = {crates=true, troops=false}, + ["Ka-50_3"] = {crates=true, troops=false}, + ["Mi-8MT"] = {crates=true, troops=true}, + ["Mi-24P"] = {crates=true, troops=true}, + ["SA342L"] = {crates=false, troops=true}, + ["SA342M"] = {crates=false, troops=true}, + ["SA342Mistral"] = {crates=false, troops=true}, + ["SA342Minigun"] = {crates=false, troops=true}, + ["UH-1H"] = {crates=true, troops=true}, + + --%%%%% AIRCRAFTS %%%%% + ["C-101EB"] = {crates=true, troops=true}, + ["C-101CC"] = {crates=true, troops=true}, + ["Christen Eagle II"] = {crates=true, troops=true}, + ["L-39C"] = {crates=true, troops=true}, + ["L-39ZA"] = {crates=true, troops=true}, + ["MB-339A"] = {crates=true, troops=true}, + ["MB-339APAN"] = {crates=true, troops=true}, + ["Mirage-F1B"] = {crates=true, troops=true}, + ["Mirage-F1BD"] = {crates=true, troops=true}, + ["Mirage-F1BE"] = {crates=true, troops=true}, + ["Mirage-F1BQ"] = {crates=true, troops=true}, + ["Mirage-F1DDA"] = {crates=true, troops=true}, + ["Su-25T"]= {crates=true, troops=false}, + ["Yak-52"] = {crates=true, troops=true}, + + --%%%%% WARBIRDS %%%%% + ["Bf-109K-4"] = {crates=true, troops=false}, + ["Fw 190A8"] = {crates=true, troops=false}, + ["FW-190D9"] = {crates=true, troops=false}, + ["I-16"] = {crates=true, troops=false}, + ["MosquitoFBMkVI"] = {crates=true, troops=true}, + ["P-47D-30"] = {crates=true, troops=false}, + ["P-47D-40"] = {crates=true, troops=false}, + ["P-51D"] = {crates=true, troops=false}, + ["P-51D-30-NA"] = {crates=true, troops=false}, + ["SpitfireLFMkIX"] = {crates=true, troops=false}, + ["SpitfireLFMkIXCW"] = {crates=true, troops=false}, + ["TF-51D"] = {crates=true, troops=true}, } -- ************** WEIGHT CALCULATIONS FOR INFANTRY GROUPS ****************** @@ -644,7 +789,48 @@ ctld.jtacUnitTypes = { -- **************** Mission Editor Functions ********************* -- *************************************************************** +function AddPlayerAircraftByType() + _bluePlayers = coalition.getPlayers(2) + _redPlayers = coalition.getPlayers(1) + --> Blue Players + for i = 1, #_bluePlayers do + for i_2 = 1, #ctld.aircraftTypeTable do + if ctld.aircraftTypeTable[i_2] == Unit.getTypeName(_bluePlayers[i]) then + _match = 0 + for i_3 = 1, #ctld.transportPilotNames do + + if ctld.transportPilotNames[i_3] == Unit.getName(_bluePlayers[i]) then + _match = match + 1 + end + end + if _match == 0 then + ctld.transportPilotNames[#ctld.transportPilotNames+1] = Unit.getName(_bluePlayers[i]) + end + + end + end + end + + --> Red Players + for i = 1, #_redPlayers do + for i_2 = 1, #ctld.aircraftTypeTable do + if ctld.aircraftTypeTable[i_2] == Unit.getTypeName(_redPlayers[i]) then + _match = 0 + for i_3 = 1, #ctld.transportPilotNames do + + if ctld.transportPilotNames[i_3] == Unit.getName(_redPlayers[i]) then + _match = match + 1 + end + end + if _match == 0 then + ctld.transportPilotNames[#ctld.transportPilotNames+1] = Unit.getName(_redPlayers[i]) + end + + end + end + end +end ----------------------------------------------------------------- -- Spawn group at a trigger and set them as extractable. Usage: -- ctld.spawnGroupAtTrigger("groupside", number, "triggerName", radius) @@ -4878,6 +5064,10 @@ function ctld.addF10MenuOptions() timer.scheduleFunction(ctld.addF10MenuOptions, nil, timer.getTime() + 10) + if ctld.addPlayerAircraftByType == true then + AddPlayerAircraftByType() + end + for _, _unitName in pairs(ctld.transportPilotNames) do local status, error = pcall(function() From b9fa2f937eeb157511a2bde91a2ab259b5636408 Mon Sep 17 00:00:00 2001 From: RexAttaque Date: Sun, 7 Jan 2024 00:56:49 +0100 Subject: [PATCH 2/4] Cleaned up code (local variables, fixed typos, used pairs for loops to have something more compact and modular, added logging) --- CTLD.lua | 66 ++++++++++++++++++++++++++------------------------------ 1 file changed, 31 insertions(+), 35 deletions(-) diff --git a/CTLD.lua b/CTLD.lua index 2fb734d..f443219 100644 --- a/CTLD.lua +++ b/CTLD.lua @@ -789,44 +789,43 @@ ctld.jtacUnitTypes = { -- **************** Mission Editor Functions ********************* -- *************************************************************** -function AddPlayerAircraftByType() - _bluePlayers = coalition.getPlayers(2) - _redPlayers = coalition.getPlayers(1) +function ctld.AddPlayerAircraftByType() - --> Blue Players - for i = 1, #_bluePlayers do - for i_2 = 1, #ctld.aircraftTypeTable do - if ctld.aircraftTypeTable[i_2] == Unit.getTypeName(_bluePlayers[i]) then - _match = 0 - for i_3 = 1, #ctld.transportPilotNames do + ctld.logTrace("ctld.AddPlayerAircraftByType()") - if ctld.transportPilotNames[i_3] == Unit.getName(_bluePlayers[i]) then - _match = match + 1 + local coalitions = { + ["red"] = coalition.getPlayers(1), + ["blue"] = coalition.getPlayers(2) + } + + ctld.logTrace("Got following players in coalitions :" .. ctld.p(coalitions)) + + for _, _players in pairs(coalitions) do + for _,_player in pairs(_players) do + local playerTypeName = _player:getTypeName() + local playerUnitName = _player:getName() + + ctld.logTrace("Player : " .. ctld.p(_player) .. " has unit name : " .. playerUnitName .. " and type : " .. playerTypeName) + + if _player ~= nil then + local notFound = true + + for _,transportPilotName in pairs(ctld.transportPilotNames) do + if transportPilotName == playerUnitName then + + ctld.logTrace("Player is already a transport pilot, skipping...") + notFound = false + break end end - if _match == 0 then - ctld.transportPilotNames[#ctld.transportPilotNames+1] = Unit.getName(_bluePlayers[i]) - end - end - end - end - - --> Red Players - for i = 1, #_redPlayers do - for i_2 = 1, #ctld.aircraftTypeTable do - if ctld.aircraftTypeTable[i_2] == Unit.getTypeName(_redPlayers[i]) then - _match = 0 - for i_3 = 1, #ctld.transportPilotNames do - - if ctld.transportPilotNames[i_3] == Unit.getName(_redPlayers[i]) then - _match = match + 1 + if notFound then + for _,aircraftType in pairs(ctld.aircraftTypeTable) do + if aircraftType == playerTypeName then + table.insert(ctld.transportPilotNames, playerUnitName) + end end end - if _match == 0 then - ctld.transportPilotNames[#ctld.transportPilotNames+1] = Unit.getName(_redPlayers[i]) - end - end end end @@ -4635,7 +4634,6 @@ end -- are we in pickup zone function ctld.inPickupZone(_heli) - ctld.logDebug(string.format("ctld.inPickupZone(_heli=%s)", ctld.p(_heli))) if ctld.inAir(_heli) then return { inZone = false, limit = -1, index = -1 } @@ -4644,7 +4642,6 @@ function ctld.inPickupZone(_heli) local _heliPoint = _heli:getPoint() for _i, _zoneDetails in pairs(ctld.pickupZones) do - ctld.logTrace(string.format("_zoneDetails=%s", ctld.p(_zoneDetails))) local _triggerZone = trigger.misc.getZone(_zoneDetails[1]) @@ -4665,7 +4662,6 @@ function ctld.inPickupZone(_heli) --get distance to center local _dist = ctld.getDistance(_heliPoint, _triggerZone.point) - ctld.logTrace(string.format("_dist=%s", ctld.p(_dist))) if _dist <= _triggerZone.radius then local _heliCoalition = _heli:getCoalition() if _zoneDetails[4] == 1 and (_zoneDetails[5] == _heliCoalition or _zoneDetails[5] == 0) then @@ -5065,7 +5061,7 @@ function ctld.addF10MenuOptions() timer.scheduleFunction(ctld.addF10MenuOptions, nil, timer.getTime() + 10) if ctld.addPlayerAircraftByType == true then - AddPlayerAircraftByType() + ctld.AddPlayerAircraftByType() end for _, _unitName in pairs(ctld.transportPilotNames) do From e5a18716737f4742e2f061e41898c641542c2ced Mon Sep 17 00:00:00 2001 From: RexAttaque Date: Fri, 19 Jan 2024 23:40:53 +0100 Subject: [PATCH 3/4] Transitionned to using the MIST database to add transport pilots at CTLD init --- CTLD.lua | 45 +++++++++++++++++++++++++++++---------------- 1 file changed, 29 insertions(+), 16 deletions(-) diff --git a/CTLD.lua b/CTLD.lua index f443219..8a05b1c 100644 --- a/CTLD.lua +++ b/CTLD.lua @@ -793,27 +793,33 @@ function ctld.AddPlayerAircraftByType() ctld.logTrace("ctld.AddPlayerAircraftByType()") - local coalitions = { - ["red"] = coalition.getPlayers(1), - ["blue"] = coalition.getPlayers(2) - } + for _, _countries in pairs(mist.DBs.units) do + for _, _categories in pairs(_countries) do + for _category, _groups in pairs(_categories) do - ctld.logTrace("Got following players in coalitions :" .. ctld.p(coalitions)) + if type(_groups) == "table" and _category ~= nil and (_category == "helicopter" or _category == "plane") then - for _, _players in pairs(coalitions) do - for _,_player in pairs(_players) do - local playerTypeName = _player:getTypeName() - local playerUnitName = _player:getName() + if _groups ~= nil then - ctld.logTrace("Player : " .. ctld.p(_player) .. " has unit name : " .. playerUnitName .. " and type : " .. playerTypeName) + for _,_group in pairs(_groups) do + + if _group ~= nil and _group.units ~= nil then + + for _,_unit in pairs(_group.units) do + + if _unit ~= nil then + local playerTypeName = _unit.type + local playerUnitName = _unit.unitName + + ctld.logTrace("Unit : " .. ctld.p(_unit)) + ctld.logDebug("Has name : " .. playerUnitName .. " and type : " .. playerTypeName) - if _player ~= nil then local notFound = true for _,transportPilotName in pairs(ctld.transportPilotNames) do if transportPilotName == playerUnitName then - ctld.logTrace("Player is already a transport pilot, skipping...") + ctld.logDebug("Unit is already a transport pilot, skipping...") notFound = false break end @@ -822,7 +828,14 @@ function ctld.AddPlayerAircraftByType() if notFound then for _,aircraftType in pairs(ctld.aircraftTypeTable) do if aircraftType == playerTypeName then + ctld.logDebug("Adding unit as transport pilot...") table.insert(ctld.transportPilotNames, playerUnitName) + end + end + end + end + end + end end end end @@ -5060,10 +5073,6 @@ function ctld.addF10MenuOptions() timer.scheduleFunction(ctld.addF10MenuOptions, nil, timer.getTime() + 10) - if ctld.addPlayerAircraftByType == true then - ctld.AddPlayerAircraftByType() - end - for _, _unitName in pairs(ctld.transportPilotNames) do local status, error = pcall(function() @@ -6568,6 +6577,10 @@ function ctld.initialize(force) assert(mist ~= nil, "\n\n** HEY MISSION-DESIGNER! **\n\nMiST has not been loaded!\n\nMake sure MiST 3.6 or higher is running\n*before* running this script!\n") + if ctld.addPlayerAircraftByType == true then + ctld.AddPlayerAircraftByType() + end + ctld.addedTo = {} ctld.spawnedCratesRED = {} -- use to store crates that have been spawned ctld.spawnedCratesBLUE = {} -- use to store crates that have been spawned From 419dae35fadb55c39c081ae1edf7dfffb8eede3b Mon Sep 17 00:00:00 2001 From: David Pierron Date: Sat, 9 Nov 2024 11:50:44 +0100 Subject: [PATCH 4/4] reset default values to more realistic ones --- CTLD.lua | 188 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 97 insertions(+), 91 deletions(-) diff --git a/CTLD.lua b/CTLD.lua index 8a05b1c..d7cb0ae 100644 --- a/CTLD.lua +++ b/CTLD.lua @@ -43,7 +43,7 @@ ctld.staticBugWorkaround = false -- DCS had a bug where destroying statics woul ctld.disableAllSmoke = false -- if true, all smoke is diabled at pickup and drop off zones regardless of settings below. Leave false to respect settings below --> Allow units to CTLD by aircraft type and not by pilot name -ctld.addPlayerAircraftByType = true +ctld.addPlayerAircraftByType = false ctld.hoverPickup = true -- if set to false you can load crates with the F10 menu instead of hovering... Only if not using real crates! @@ -234,36 +234,37 @@ ctld.wpZones = { -- If ctld.addPlayerAircraftByType = True, comment or uncomment lines to allow aircraft's type carry CTLD ctld.aircraftTypeTable = { --%%%%% MODS %%%%% - "Bronco-OV-10A", - "Hercules", + --"Bronco-OV-10A", + --"Hercules", --"SK-60", - "UH-60L", + --"UH-60L", --"T-45", --%%%%% CHOPPERS %%%%% - "Ka-50", - "Ka-50_3", + --"Ka-50", + --"Ka-50_3", "Mi-8MT", "Mi-24P", - "SA342L", - "SA342M", - "SA342Mistral", - "SA342Minigun", + --"SA342L", + --"SA342M", + --"SA342Mistral", + --"SA342Minigun", "UH-1H", + "CH-47Fbl1", --%%%%% AIRCRAFTS %%%%% - "C-101EB", - "C-101CC", + --"C-101EB", + --"C-101CC", --"Christen Eagle II", - "L-39C", - "L-39ZA", - "MB-339A", - "MB-339APAN", - "Mirage-F1B", - "Mirage-F1BD", - "Mirage-F1BE", - "Mirage-F1BQ", - "Mirage-F1DDA", + --"L-39C", + --"L-39ZA", + --"MB-339A", + --"MB-339APAN", + --"Mirage-F1B", + --"Mirage-F1BD", + --"Mirage-F1BE", + --"Mirage-F1BQ", + --"Mirage-F1DDA", --"Su-25T", --"Yak-52", @@ -272,14 +273,14 @@ ctld.aircraftTypeTable = { --"Fw 190A8", --"FW-190D9", --"I-16", - "MosquitoFBMkVI", + --"MosquitoFBMkVI", --"P-47D-30", --"P-47D-40", --"P-51D", --"P-51D-30-NA", --"SpitfireLFMkIX", --"SpitfireLFMkIXCW", - "TF-51D", + --"TF-51D", } -- Use any of the predefined names or set your own ones @@ -485,50 +486,51 @@ ctld.unitLoadLimits = { -- ["SA342M"] = 4, --%%%%% MODS %%%%% - ["Bronco-OV-10A"] = 4, + --["Bronco-OV-10A"] = 4, ["Hercules"] = 30, - ["SK-60"] = 1, + --["SK-60"] = 1, ["UH-60L"] = 12, - ["T-45"] = 1, + --["T-45"] = 1, --%%%%% CHOPPERS %%%%% ["Mi-8MT"] = 16, ["Mi-24P"] = 10, - ["SA342L"] = 4, - ["SA342M"] = 4, - ["SA342Mistral"] = 4, - ["SA342Minigun"] = 3, + --["SA342L"] = 4, + --["SA342M"] = 4, + --["SA342Mistral"] = 4, + --["SA342Minigun"] = 3, ["UH-1H"] = 8, + ["CH-47Fbl1"] = 33, --%%%%% AIRCRAFTS %%%%% - ["C-101EB"] = 1, - ["C-101CC"] = 1, - ["Christen Eagle II"] = 1, - ["L-39C"] = 1, - ["L-39ZA"] = 1, - ["MB-339A"] = 1, - ["MB-339APAN"] = 1, - ["Mirage-F1B"] = 1, - ["Mirage-F1BD"] = 1, - ["Mirage-F1BE"] = 1, - ["Mirage-F1BQ"] = 1, - ["Mirage-F1DDA"] = 1, - ["Su-25T"] = 1, - ["Yak-52"] = 1, + --["C-101EB"] = 1, + --["C-101CC"] = 1, + --["Christen Eagle II"] = 1, + --["L-39C"] = 1, + --["L-39ZA"] = 1, + --["MB-339A"] = 1, + --["MB-339APAN"] = 1, + --["Mirage-F1B"] = 1, + --["Mirage-F1BD"] = 1, + --["Mirage-F1BE"] = 1, + --["Mirage-F1BQ"] = 1, + --["Mirage-F1DDA"] = 1, + --["Su-25T"] = 1, + --["Yak-52"] = 1, --%%%%% WARBIRDS %%%%% - ["Bf-109K-4"] = 1, - ["Fw 190A8"] = 1, - ["FW-190D9"] = 1, - ["I-16"] = 1, - ["MosquitoFBMkVI"] = 1, - ["P-47D-30"] = 1, - ["P-47D-40"] = 1, - ["P-51D"] = 1, - ["P-51D-30-NA"] = 1, - ["SpitfireLFMkIX"] = 1, - ["SpitfireLFMkIXCW"] = 1, - ["TF-51D"] = 1, + --["Bf-109K-4"] = 1, + --["Fw 190A8"] = 1, + --["FW-190D9"] = 1, + --["I-16"] = 1, + --["MosquitoFBMkVI"] = 1, + --["P-47D-30"] = 1, + --["P-47D-40"] = 1, + --["P-51D"] = 1, + --["P-51D-30-NA"] = 1, + --["SpitfireLFMkIX"] = 1, + --["SpitfireLFMkIXCW"] = 1, + --["TF-51D"] = 1, } @@ -554,52 +556,53 @@ ctld.unitActions = { -- ["SA342M"] = {crates=false, troops=true}, --%%%%% MODS %%%%% - ["Bronco-OV-10A"] = {crates=true, troops=true}, + --["Bronco-OV-10A"] = {crates=true, troops=true}, ["Hercules"] = {crates=true, troops=true}, ["SK-60"] = {crates=true, troops=true}, ["UH-60L"] = {crates=true, troops=true}, - ["T-45"] = {crates=true, troops=true}, + --["T-45"] = {crates=true, troops=true}, --%%%%% CHOPPERS %%%%% - ["Ka-50"] = {crates=true, troops=false}, - ["Ka-50_3"] = {crates=true, troops=false}, + --["Ka-50"] = {crates=true, troops=false}, + --["Ka-50_3"] = {crates=true, troops=false}, ["Mi-8MT"] = {crates=true, troops=true}, ["Mi-24P"] = {crates=true, troops=true}, - ["SA342L"] = {crates=false, troops=true}, - ["SA342M"] = {crates=false, troops=true}, - ["SA342Mistral"] = {crates=false, troops=true}, - ["SA342Minigun"] = {crates=false, troops=true}, + --["SA342L"] = {crates=false, troops=true}, + --["SA342M"] = {crates=false, troops=true}, + --["SA342Mistral"] = {crates=false, troops=true}, + --["SA342Minigun"] = {crates=false, troops=true}, ["UH-1H"] = {crates=true, troops=true}, + ["CH-47Fbl1"] = {crates=true, troops=true}, --%%%%% AIRCRAFTS %%%%% - ["C-101EB"] = {crates=true, troops=true}, - ["C-101CC"] = {crates=true, troops=true}, - ["Christen Eagle II"] = {crates=true, troops=true}, - ["L-39C"] = {crates=true, troops=true}, - ["L-39ZA"] = {crates=true, troops=true}, - ["MB-339A"] = {crates=true, troops=true}, - ["MB-339APAN"] = {crates=true, troops=true}, - ["Mirage-F1B"] = {crates=true, troops=true}, - ["Mirage-F1BD"] = {crates=true, troops=true}, - ["Mirage-F1BE"] = {crates=true, troops=true}, - ["Mirage-F1BQ"] = {crates=true, troops=true}, - ["Mirage-F1DDA"] = {crates=true, troops=true}, - ["Su-25T"]= {crates=true, troops=false}, - ["Yak-52"] = {crates=true, troops=true}, + --["C-101EB"] = {crates=true, troops=true}, + --["C-101CC"] = {crates=true, troops=true}, + --["Christen Eagle II"] = {crates=true, troops=true}, + --["L-39C"] = {crates=true, troops=true}, + --["L-39ZA"] = {crates=true, troops=true}, + --["MB-339A"] = {crates=true, troops=true}, + --["MB-339APAN"] = {crates=true, troops=true}, + --["Mirage-F1B"] = {crates=true, troops=true}, + --["Mirage-F1BD"] = {crates=true, troops=true}, + --["Mirage-F1BE"] = {crates=true, troops=true}, + --["Mirage-F1BQ"] = {crates=true, troops=true}, + --["Mirage-F1DDA"] = {crates=true, troops=true}, + --["Su-25T"]= {crates=true, troops=false}, + --["Yak-52"] = {crates=true, troops=true}, --%%%%% WARBIRDS %%%%% - ["Bf-109K-4"] = {crates=true, troops=false}, - ["Fw 190A8"] = {crates=true, troops=false}, - ["FW-190D9"] = {crates=true, troops=false}, - ["I-16"] = {crates=true, troops=false}, - ["MosquitoFBMkVI"] = {crates=true, troops=true}, - ["P-47D-30"] = {crates=true, troops=false}, - ["P-47D-40"] = {crates=true, troops=false}, - ["P-51D"] = {crates=true, troops=false}, - ["P-51D-30-NA"] = {crates=true, troops=false}, - ["SpitfireLFMkIX"] = {crates=true, troops=false}, - ["SpitfireLFMkIXCW"] = {crates=true, troops=false}, - ["TF-51D"] = {crates=true, troops=true}, + --["Bf-109K-4"] = {crates=true, troops=false}, + --["Fw 190A8"] = {crates=true, troops=false}, + --["FW-190D9"] = {crates=true, troops=false}, + --["I-16"] = {crates=true, troops=false}, + --["MosquitoFBMkVI"] = {crates=true, troops=true}, + --["P-47D-30"] = {crates=true, troops=false}, + --["P-47D-40"] = {crates=true, troops=false}, + --["P-51D"] = {crates=true, troops=false}, + --["P-51D-30-NA"] = {crates=true, troops=false}, + --["SpitfireLFMkIX"] = {crates=true, troops=false}, + --["SpitfireLFMkIXCW"] = {crates=true, troops=false}, + --["TF-51D"] = {crates=true, troops=true}, } -- ************** WEIGHT CALCULATIONS FOR INFANTRY GROUPS ****************** @@ -4647,6 +4650,7 @@ end -- are we in pickup zone function ctld.inPickupZone(_heli) + ctld.logDebug(string.format("ctld.inPickupZone(_heli=%s)", ctld.p(_heli))) if ctld.inAir(_heli) then return { inZone = false, limit = -1, index = -1 } @@ -4655,6 +4659,7 @@ function ctld.inPickupZone(_heli) local _heliPoint = _heli:getPoint() for _i, _zoneDetails in pairs(ctld.pickupZones) do + ctld.logTrace(string.format("_zoneDetails=%s", ctld.p(_zoneDetails))) local _triggerZone = trigger.misc.getZone(_zoneDetails[1]) @@ -4675,6 +4680,7 @@ function ctld.inPickupZone(_heli) --get distance to center local _dist = ctld.getDistance(_heliPoint, _triggerZone.point) + ctld.logTrace(string.format("_dist=%s", ctld.p(_dist))) if _dist <= _triggerZone.radius then local _heliCoalition = _heli:getCoalition() if _zoneDetails[4] == 1 and (_zoneDetails[5] == _heliCoalition or _zoneDetails[5] == 0) then @@ -6577,7 +6583,7 @@ function ctld.initialize(force) assert(mist ~= nil, "\n\n** HEY MISSION-DESIGNER! **\n\nMiST has not been loaded!\n\nMake sure MiST 3.6 or higher is running\n*before* running this script!\n") - if ctld.addPlayerAircraftByType == true then + if ctld.addPlayerAircraftByType == true then ctld.AddPlayerAircraftByType() end