mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
@@ -1,28 +1,28 @@
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
-- configuration file for the CTLD Plugin including the JTAC Autolase
|
||||
--
|
||||
-- This configuration is tailored for a mission generated by DCS Liberation
|
||||
-- see https://github.com/dcs-liberation/dcs_liberation
|
||||
-- This configuration is tailored for a mission generated by DCS Retribution
|
||||
-- see https://github.com/dcs-retribution/dcs-retribution
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
function spawn_crates()
|
||||
--- CrateSpawn script which needs to be run after CTLD was initialized (3s delay)
|
||||
env.info("DCSLiberation|CTLD plugin - Spawn crates")
|
||||
for _, crate in pairs(dcsLiberation.Logistics.crates) do
|
||||
env.info("DCSRetribution|CTLD plugin - Spawn crates")
|
||||
for _, crate in pairs(dcsRetribution.Logistics.crates) do
|
||||
ctld.spawnCrateAtZone(crate.coalition, tonumber(crate.weight), crate.zone)
|
||||
end
|
||||
end
|
||||
|
||||
function preload_troops(preload_data)
|
||||
--- Troop loading script which needs to be run after CTLD was initialized (5s delay)
|
||||
env.info(string.format("DCSLiberation|CTLD plugin - Preloading Troops into %s", preload_data["unit"]))
|
||||
env.info(string.format("DCSRetribution|CTLD plugin - Preloading Troops into %s", preload_data["unit"]))
|
||||
ctld.preLoadTransport(preload_data["unit"], preload_data["amount"], true)
|
||||
end
|
||||
|
||||
function toboolean(str) return str == "true" end
|
||||
|
||||
-- CTLD plugin - configuration
|
||||
if dcsLiberation then
|
||||
if dcsRetribution then
|
||||
local ctld_pickup_smoke = "none"
|
||||
local ctld_dropoff_smoke = "none"
|
||||
|
||||
@@ -32,28 +32,28 @@ if dcsLiberation then
|
||||
local fc3LaserCode = false
|
||||
|
||||
-- retrieve specific options values
|
||||
if dcsLiberation.plugins then
|
||||
if dcsLiberation.plugins.ctld then
|
||||
env.info("DCSLiberation|CTLD plugin - Setting Up")
|
||||
if dcsRetribution.plugins then
|
||||
if dcsRetribution.plugins.ctld then
|
||||
env.info("DCSRetribution|CTLD plugin - Setting Up")
|
||||
--- Debug Settings
|
||||
ctld.Debug = dcsLiberation.plugins.ctld.debug
|
||||
ctld.Trace = dcsLiberation.plugins.ctld.debug
|
||||
ctld.Debug = dcsRetribution.plugins.ctld.debug
|
||||
ctld.Trace = dcsRetribution.plugins.ctld.debug
|
||||
|
||||
-- Sling loadings settings
|
||||
ctld.enableCrates = true
|
||||
ctld.slingLoad = dcsLiberation.plugins.ctld.slingload
|
||||
ctld.staticBugFix = not dcsLiberation.plugins.ctld.slingload
|
||||
ctld.slingLoad = dcsRetribution.plugins.ctld.slingload
|
||||
ctld.staticBugFix = not dcsRetribution.plugins.ctld.slingload
|
||||
|
||||
--- Special unitLoad Settings as proposed in #2174
|
||||
ctld.maximumDistanceLogistic = 300
|
||||
ctld.unitLoadLimits = {}
|
||||
ctld.unitActions = {}
|
||||
for _, transport in pairs(dcsLiberation.Logistics.transports) do
|
||||
for _, transport in pairs(dcsRetribution.Logistics.transports) do
|
||||
ctld.unitLoadLimits[transport.aircraft_type] = tonumber(transport.cabin_size)
|
||||
ctld.unitActions[transport.aircraft_type] = { crates = toboolean(transport.crates), troops = toboolean(transport.troops) }
|
||||
end
|
||||
|
||||
if dcsLiberation.plugins.ctld.smoke then
|
||||
if dcsRetribution.plugins.ctld.smoke then
|
||||
ctld_pickup_smoke = "blue"
|
||||
ctld_dropoff_smoke = "green"
|
||||
end
|
||||
@@ -61,14 +61,14 @@ if dcsLiberation then
|
||||
-- Definition of spawnable things
|
||||
local ctld_troops = ctld.loadableGroups
|
||||
ctld.loadableGroups = {
|
||||
{ name = "Liberation Troops (2)", inf = 2 },
|
||||
{ name = "Liberation Troops (4)", inf = 4 },
|
||||
{ name = "Liberation Troops (6)", inf = 4, mg = 1, at = 1 },
|
||||
{ name = "Liberation Troops (10)", inf = 5, mg = 2, at = 2, aa = 1 },
|
||||
{ name = "Liberation Troops (12)", inf = 6, mg = 2, at = 2, aa = 2 },
|
||||
{ name = "Liberation Troops (24)", inf = 12, mg = 4, at = 4, aa = 3, jtac = 1 },
|
||||
{ name = "Retribution Troops (2)", inf = 2 },
|
||||
{ name = "Retribution Troops (4)", inf = 4 },
|
||||
{ name = "Retribution Troops (6)", inf = 4, mg = 1, at = 1 },
|
||||
{ name = "Retribution Troops (10)", inf = 5, mg = 2, at = 2, aa = 1 },
|
||||
{ name = "Retribution Troops (12)", inf = 6, mg = 2, at = 2, aa = 2 },
|
||||
{ name = "Retribution Troops (24)", inf = 12, mg = 4, at = 4, aa = 3, jtac = 1 },
|
||||
}
|
||||
if dcsLiberation.plugins.ctld.tailorctld then
|
||||
if dcsRetribution.plugins.ctld.tailorctld then
|
||||
--- remove all default CTLD spawning settings
|
||||
--- so that we can tailor them for the tasked missions
|
||||
ctld.enableSmokeDrop = false
|
||||
@@ -89,21 +89,21 @@ if dcsLiberation then
|
||||
end
|
||||
|
||||
--- add all carriers as pickup zone
|
||||
if dcsLiberation.Carriers then
|
||||
for _, carrier in pairs(dcsLiberation.Carriers) do
|
||||
if dcsRetribution.Carriers then
|
||||
for _, carrier in pairs(dcsRetribution.Carriers) do
|
||||
table.insert(ctld.pickupZones, { carrier.unit_name, ctld_pickup_smoke, -1, "yes", 0 })
|
||||
end
|
||||
end
|
||||
|
||||
--- generate mission specific spawnable crates
|
||||
local spawnable_crates = {}
|
||||
for _, crate in pairs(dcsLiberation.Logistics.spawnable_crates) do
|
||||
for _, crate in pairs(dcsRetribution.Logistics.spawnable_crates) do
|
||||
table.insert(spawnable_crates, { weight = tonumber(crate.weight), desc = crate.unit, unit = crate.unit })
|
||||
end
|
||||
ctld.spawnableCrates["Liberation Crates"] = spawnable_crates
|
||||
ctld.spawnableCrates["Retribution Crates"] = spawnable_crates
|
||||
|
||||
--- Parse the LogisticsInfo for the mission
|
||||
for _, item in pairs(dcsLiberation.Logistics.flights) do
|
||||
for _, item in pairs(dcsRetribution.Logistics.flights) do
|
||||
for _, pilot in pairs(item.pilot_names) do
|
||||
table.insert(ctld.transportPilotNames, pilot)
|
||||
if toboolean(item.preload) then
|
||||
@@ -120,24 +120,24 @@ if dcsLiberation then
|
||||
if item.target_zone then
|
||||
table.insert(ctld.wpZones, { item.target_zone, "none", "yes", tonumber(item.side) })
|
||||
end
|
||||
if dcsLiberation.plugins.ctld.logisticunit and item.logistic_unit then
|
||||
if dcsRetribution.plugins.ctld.logisticunit and item.logistic_unit then
|
||||
table.insert(ctld.logisticUnits, item.logistic_unit)
|
||||
end
|
||||
end
|
||||
|
||||
autolase = dcsLiberation.plugins.ctld.autolase
|
||||
env.info(string.format("DCSLiberation|CTLD plugin - JTAC AutoLase enabled = %s", tostring(autolase)))
|
||||
autolase = dcsRetribution.plugins.ctld.autolase
|
||||
env.info(string.format("DCSRetribution|CTLD plugin - JTAC AutoLase enabled = %s", tostring(autolase)))
|
||||
|
||||
if autolase then
|
||||
smoke = dcsLiberation.plugins.ctld.jtacsmoke
|
||||
env.info(string.format("DCSLiberation|CTLD plugin - JTACAutolase smoke = %s", tostring(smoke)))
|
||||
smoke = dcsRetribution.plugins.ctld.jtacsmoke
|
||||
env.info(string.format("DCSRetribution|CTLD plugin - JTACAutolase smoke = %s", tostring(smoke)))
|
||||
|
||||
fc3LaserCode = dcsLiberation.plugins.ctld.fc3LaserCode
|
||||
env.info(string.format("DCSLiberation|CTLD plugin - JTACAutolase fc3LaserCode = %s", tostring(fc3LaserCode)))
|
||||
fc3LaserCode = dcsRetribution.plugins.ctld.fc3LaserCode
|
||||
env.info(string.format("DCSRetribution|CTLD plugin - JTACAutolase fc3LaserCode = %s", tostring(fc3LaserCode)))
|
||||
|
||||
-- JTAC Autolase configuration code
|
||||
for _, jtac in pairs(dcsLiberation.JTACs) do
|
||||
env.info(string.format("DCSLiberation|JTACAutolase - setting up %s", jtac.dcsGroupName))
|
||||
for _, jtac in pairs(dcsRetribution.JTACs) do
|
||||
env.info(string.format("DCSRetribution|JTACAutolase - setting up %s", jtac.dcsGroupName))
|
||||
if fc3LaserCode then
|
||||
-- If fc3LaserCode is enabled in the plugin configuration, force the JTAC
|
||||
-- laser code to 1113 to allow lasing for Su-25 Frogfoots and A-10A Warthogs.
|
||||
@@ -146,7 +146,7 @@ if dcsLiberation then
|
||||
ctld.JTACAutoLase(jtac.dcsGroupName, jtac.laserCode, smoke, 'vehicle', nil, { freq = jtac.radio, mod = jtac.modulation, name = jtac.dcsGroupName })
|
||||
end
|
||||
end
|
||||
if dcsLiberation.plugins.ctld.airliftcrates then
|
||||
if dcsRetribution.plugins.ctld.airliftcrates then
|
||||
timer.scheduleFunction(spawn_crates, nil, timer.getTime() + 3)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user