Merge branch 'master' into JTAC-talk-over-SRS

This commit is contained in:
David Pierron
2021-06-21 18:24:02 +02:00
+108 -86
View File
@@ -15,8 +15,8 @@
- mvee - https://github.com/mvee - mvee - https://github.com/mvee
- jmontleon - https://github.com/jmontleon - jmontleon - https://github.com/jmontleon
- emilianomolina - https://github.com/emilianomolina - emilianomolina - https://github.com/emilianomolina
- davidp57 - https://github.com/davidp57
Version: 1.73 - 15/04/2018
- Allow minimum distance from friendly logistics to be set - Allow minimum distance from friendly logistics to be set
]] ]]
@@ -409,7 +409,7 @@ ctld.logisticUnits = {
-- in the contained mission file -- in the contained mission file
ctld.vehicleTransportEnabled = { ctld.vehicleTransportEnabled = {
"76MD", -- the il-76 mod doesnt use a normal - sign so il-76md wont match... !!!! GRR "76MD", -- the il-76 mod doesnt use a normal - sign so il-76md wont match... !!!! GRR
"C-130", "Hercules",
} }
@@ -529,16 +529,20 @@ ctld.spawnableCrates = {
{ weight = 800, desc = "FOB Crate - Small", unit = "FOB-SMALL" }, -- Builds a FOB! - requires 3 * ctld.cratesRequiredForFOB { weight = 800, desc = "FOB Crate - Small", unit = "FOB-SMALL" }, -- Builds a FOB! - requires 3 * ctld.cratesRequiredForFOB
}, },
["AA Crates"] = { ["AA short range"] = {
{ weight = 50, desc = "Stinger", unit = "Soldier stinger", side = 2 }, { weight = 50, desc = "Stinger", unit = "Soldier stinger", side = 2 },
{ weight = 55, desc = "Igla", unit = "SA-18 Igla manpad", side = 1 }, { weight = 55, desc = "Igla", unit = "SA-18 Igla manpad", side = 1 },
{ weight = 405, desc = "Strela-1 9P31", unit = "Strela-1 9P31", side = 1, cratesRequired = 3 },
{ weight = 400, desc = "M1097 Avenger", unit = "M1097 Avenger", side = 2, cratesRequired = 3 },
},
["AA mid range"] = {
-- HAWK System -- HAWK System
{ weight = 540, desc = "HAWK Launcher", unit = "Hawk ln", side = 2}, { weight = 540, desc = "HAWK Launcher", unit = "Hawk ln", side = 2},
{ weight = 545, desc = "HAWK Search Radar", unit = "Hawk sr", side = 2 }, { weight = 545, desc = "HAWK Search Radar", unit = "Hawk sr", side = 2 },
{ weight = 550, desc = "HAWK Track Radar", unit = "Hawk tr", side = 2 }, { weight = 546, desc = "HAWK Track Radar", unit = "Hawk tr", side = 2 },
{ weight = 551, desc = "HAWK PCP", unit = "Hawk pcp" , side = 2 }, -- Remove this if on 1.2 { weight = 547, desc = "HAWK PCP", unit = "Hawk pcp" , side = 2 }, -- Remove this if on 1.2
{ weight = 552, desc = "HAWK Repair", unit = "HAWK Repair" , side = 2 }, { weight = 549, desc = "HAWK Repair", unit = "HAWK Repair" , side = 2 },
-- End of HAWK -- End of HAWK
-- KUB SYSTEM -- KUB SYSTEM
@@ -553,12 +557,19 @@ ctld.spawnableCrates = {
-- { weight = 585, desc = "BUK CC Radar", unit = "SA-11 Buk CC 9S470M1"}, -- { weight = 585, desc = "BUK CC Radar", unit = "SA-11 Buk CC 9S470M1"},
-- { weight = 590, desc = "BUK Repair", unit = "BUK Repair"}, -- { weight = 590, desc = "BUK Repair", unit = "BUK Repair"},
-- END of BUK -- END of BUK
},
["AA long range"] = {
-- Patriot System
{ weight = 555, desc = "Patriot Launcher", unit = "Patriot ln", side = 2 },
{ weight = 556, desc = "Patriot Radar", unit = "Patriot str" , side = 2 },
{ weight = 557, desc = "Patriot ECS", unit = "Patriot ECS", side = 2 },
-- { weight = 553, desc = "Patriot ICC", unit = "Patriot cp", side = 2 },
-- { weight = 554, desc = "Patriot EPP", unit = "Patriot EPP", side = 2 },
{ weight = 558, desc = "Patriot AMG (optional)", unit = "Patriot AMG" , side = 2 },
{ weight = 559, desc = "Patriot Repair", unit = "Patriot Repair" , side = 2 },
-- End of Patriot
{ weight = 595, desc = "Early Warning Radar", unit = "1L13 EWR", side = 1 }, -- cant be used by BLUE coalition { weight = 595, desc = "Early Warning Radar", unit = "1L13 EWR", side = 1 }, -- cant be used by BLUE coalition
{ weight = 405, desc = "Strela-1 9P31", unit = "Strela-1 9P31", side = 1, cratesRequired = 3 },
{ weight = 400, desc = "M1097 Avenger", unit = "M1097 Avenger", side = 2, cratesRequired = 3 },
}, },
} }
@@ -625,79 +636,6 @@ ctld.jtacUnitTypes = {
"SKP", "Hummer" -- there are some wierd encoding issues so if you write SKP-11 it wont match as the - sign is encoded differently... "SKP", "Hummer" -- there are some wierd encoding issues so if you write SKP-11 it wont match as the - sign is encoded differently...
} }
-------------------------------------------------------------------------------------------------------------------------------------------------------------
-- Utility methods
-------------------------------------------------------------------------------------------------------------------------------------------------------------
--- print an object for a debugging log
function ctld.p(o, level)
local MAX_LEVEL = 20
if level == nil then level = 0 end
if level > MAX_LEVEL then
ctld.logError("max depth reached in ctld.p : "..tostring(MAX_LEVEL))
return ""
end
local text = ""
if (type(o) == "table") then
text = "\n"
for key,value in pairs(o) do
for i=0, level do
text = text .. " "
end
text = text .. ".".. key.."="..ctld.p(value, level+1) .. "\n"
end
elseif (type(o) == "function") then
text = "[function]"
elseif (type(o) == "boolean") then
if o == true then
text = "[true]"
else
text = "[false]"
end
else
if o == nil then
text = "[nil]"
else
text = tostring(o)
end
end
return text
end
function ctld.logError(message)
env.info(" E - " .. ctld.Id .. message)
end
function ctld.logInfo(message)
env.info(" I - " .. ctld.Id .. message)
end
function ctld.logDebug(message)
if message and ctld.Debug then
env.info(" D - " .. ctld.Id .. message)
end
end
function ctld.logTrace(message)
if message and ctld.Trace then
env.info(" T - " .. ctld.Id .. message)
end
end
ctld.nextUnitId = 1;
ctld.getNextUnitId = function()
ctld.nextUnitId = ctld.nextUnitId + 1
return ctld.nextUnitId
end
ctld.nextGroupId = 1;
ctld.getNextGroupId = function()
ctld.nextGroupId = ctld.nextGroupId + 1
return ctld.nextGroupId
end
-- *************************************************************** -- ***************************************************************
-- **************** Mission Editor Functions ********************* -- **************** Mission Editor Functions *********************
@@ -1460,6 +1398,16 @@ ctld.AASystemTemplate = {
repair = "HAWK Repair", repair = "HAWK Repair",
}, },
{ {
name = "Patriot AA System",
count = 4,
parts = {
{name = "Patriot ln", desc = "Patriot Launcher", launcher = true},
{name = "Patriot ECS", desc = "Patriot Control Unit"},
{name = "Patriot str", desc = "Patriot Search and Track Radar"},
},
repair = "Patriot Repair",
},
{
name = "BUK AA System", name = "BUK AA System",
count = 3, count = 3,
parts = { parts = {
@@ -1485,6 +1433,82 @@ ctld.crateWait = {}
ctld.crateMove = {} ctld.crateMove = {}
---------------- INTERNAL FUNCTIONS ---------------- ---------------- INTERNAL FUNCTIONS ----------------
---
---
-------------------------------------------------------------------------------------------------------------------------------------------------------------
-- Utility methods
-------------------------------------------------------------------------------------------------------------------------------------------------------------
--- print an object for a debugging log
function ctld.p(o, level)
local MAX_LEVEL = 20
if level == nil then level = 0 end
if level > MAX_LEVEL then
ctld.logError("max depth reached in ctld.p : "..tostring(MAX_LEVEL))
return ""
end
local text = ""
if (type(o) == "table") then
text = "\n"
for key,value in pairs(o) do
for i=0, level do
text = text .. " "
end
text = text .. ".".. key.."="..ctld.p(value, level+1) .. "\n"
end
elseif (type(o) == "function") then
text = "[function]"
elseif (type(o) == "boolean") then
if o == true then
text = "[true]"
else
text = "[false]"
end
else
if o == nil then
text = "[nil]"
else
text = tostring(o)
end
end
return text
end
function ctld.logError(message)
env.info(" E - " .. ctld.Id .. message)
end
function ctld.logInfo(message)
env.info(" I - " .. ctld.Id .. message)
end
function ctld.logDebug(message)
if message and ctld.Debug then
env.info(" D - " .. ctld.Id .. message)
end
end
function ctld.logTrace(message)
if message and ctld.Trace then
env.info(" T - " .. ctld.Id .. message)
end
end
ctld.nextUnitId = 1;
ctld.getNextUnitId = function()
ctld.nextUnitId = ctld.nextUnitId + 1
return ctld.nextUnitId
end
ctld.nextGroupId = 1;
ctld.getNextGroupId = function()
ctld.nextGroupId = ctld.nextGroupId + 1
return ctld.nextGroupId
end
function ctld.getTransportUnit(_unitName) function ctld.getTransportUnit(_unitName)
if _unitName == nil then if _unitName == nil then
@@ -6300,9 +6324,7 @@ function ctld.initialize(force)
-- Scheduled functions (run cyclically) -- but hold execution for a second so we can override parts -- Scheduled functions (run cyclically) -- but hold execution for a second so we can override parts
if ctld.allowAiTeamPickups then timer.scheduleFunction(ctld.checkAIStatus, nil, timer.getTime() + 1)
timer.scheduleFunction(ctld.checkAIStatus, nil, timer.getTime() + 1)
end
timer.scheduleFunction(ctld.checkTransportStatus, nil, timer.getTime() + 5) timer.scheduleFunction(ctld.checkTransportStatus, nil, timer.getTime() + 5)
timer.scheduleFunction(function() timer.scheduleFunction(function()