Renaming Liberation

Resolves #42
This commit is contained in:
Raffson 2022-12-19 21:17:31 +01:00
parent cdd72820b4
commit c114256b82
No known key found for this signature in database
GPG Key ID: B0402B2C9B764D99
9 changed files with 124 additions and 124 deletions

View File

@ -40,7 +40,7 @@ class LuaGenerator:
self.inject_plugins()
def generate_plugin_data(self) -> None:
lua_data = LuaData("dcsLiberation")
lua_data = LuaData("dcsRetribution")
install_path = lua_data.add_item("installPath")
install_path.set_value(os.path.abspath("."))
@ -201,7 +201,7 @@ class LuaGenerator:
for role, connections in node.connections.items():
iads_element.add_data_array(role, connections)
trigger = TriggerStart(comment="Set DCS Liberation data")
trigger = TriggerStart(comment="Set DCS Retribution data")
trigger.add_action(DoScript(String(lua_data.create_operations_lua())))
self.mission.triggerrules.triggers.append(trigger)
@ -380,7 +380,7 @@ class LuaData(LuaItem):
"""crates the liberation lua script for the dcs mission"""
lua_prefix = """
-- setting configuration table
env.info("DCSLiberation|: setting configuration table")
env.info("DCSRetribution|: setting configuration table")
"""
return lua_prefix + self.serialize()

View File

@ -162,7 +162,7 @@ class LuaPlugin(PluginSettings):
for option in self.options:
enabled = str(option.enabled).lower()
name = option.identifier
option_decls.append(f" dcsLiberation.plugins.{name} = {enabled}")
option_decls.append(f" dcsRetribution.plugins.{name} = {enabled}")
joined_options = "\n".join(option_decls)
@ -170,11 +170,11 @@ class LuaPlugin(PluginSettings):
f"""\
-- {self.identifier} plugin configuration.
if dcsLiberation then
if not dcsLiberation.plugins then
dcsLiberation.plugins = {{}}
if dcsRetribution then
if not dcsRetribution.plugins then
dcsRetribution.plugins = {{}}
end
dcsLiberation.plugins.{self.identifier} = {{}}
dcsRetribution.plugins.{self.identifier} = {{}}
{joined_options}
end

View File

@ -1,7 +1,7 @@
-- the state.json file will be updated according to this schedule, and also on each destruction or capture event
local WRITESTATE_SCHEDULE_IN_SECONDS = 60
logger = mist.Logger:new("DCSLiberation", "info")
logger = mist.Logger:new("DCSRetribution", "info")
logger:info("Check that json.lua is loaded : json = "..tostring(json))
killed_aircrafts = {} -- killed aircraft will be added via S_EVENT_CRASH event
@ -37,7 +37,7 @@ function write_state()
["destroyed_objects_positions"] = destroyed_objects_positions,
}
if not json then
local message = string.format("Unable to save DCS Liberation state to %s, JSON library is not loaded !", _debriefing_file_location)
local message = string.format("Unable to save DCS Retribution state to %s, JSON library is not loaded !", _debriefing_file_location)
logger:error(message)
messageAll(message)
end
@ -76,30 +76,30 @@ end
local function discoverDebriefingFilePath()
-- establish a search pattern into the following modes
-- 1. Environment variable LIBERATION_EXPORT_DIR, to support dedicated server hosting
-- 2. Embedded DCS Liberation dcsLiberation.installPath (set by the app to its install path), to support locally hosted single player
-- 1. Environment variable RETRIBUTION_EXPORT_DIR, to support dedicated server hosting
-- 2. Embedded DCS Retribution dcsRetribution.installPath (set by the app to its install path), to support locally hosted single player
-- 3. System temporary folder, as set in the TEMP environment variable
-- 4. Working directory.
local useCurrentStamping = nil
if os then
useCurrentStamping = os.getenv("LIBERATION_EXPORT_STAMPED_STATE")
useCurrentStamping = os.getenv("RETRIBUTION_EXPORT_STAMPED_STATE")
end
local installPath = nil
if dcsLiberation then
installPath = dcsLiberation.installPath
if dcsRetribution then
installPath = dcsRetribution.installPath
end
if os then
local result = nil
-- try using the LIBERATION_EXPORT_DIR environment variable
result = testDebriefingFilePath(os.getenv("LIBERATION_EXPORT_DIR"), "LIBERATION_EXPORT_DIR", useCurrentStamping)
-- try using the RETRIBUTION_EXPORT_DIR environment variable
result = testDebriefingFilePath(os.getenv("RETRIBUTION_EXPORT_DIR"), "RETRIBUTION_EXPORT_DIR", useCurrentStamping)
if result then
return result
end
-- no joy ? maybe there is a valid path in the mission ?
result = testDebriefingFilePath(installPath, "the DCS Liberation install folder", useCurrentStamping)
result = testDebriefingFilePath(installPath, "the DCS Retribution install folder", useCurrentStamping)
if result then
return result
end
@ -124,15 +124,15 @@ write_state_error_handling = function()
local _debriefing_file_location = debriefing_file_location
if not debriefing_file_location then
_debriefing_file_location = "[nil]"
logger:error("Unable to find where to write DCS Liberation state")
logger:error("Unable to find where to write DCS Retribution state")
end
if pcall(write_state) then
else
messageAll("Unable to write DCS Liberation state to ".._debriefing_file_location..
"\nYou can abort the mission in DCS Liberation.\n"..
"\n\nPlease fix your setup in DCS Liberation, make sure you are pointing to the right installation directory from the File/Preferences menu. Then after fixing the path restart DCS Liberation, and then restart DCS."..
"\n\nYou can also try to fix the issue manually by replacing the file <dcs_installation_directory>/Scripts/MissionScripting.lua by the one provided there : <dcs_liberation_folder>/resources/scripts/MissionScripting.lua. And then restart DCS. (This will also have to be done again after each DCS update)"..
messageAll("Unable to write DCS Retribution state to ".._debriefing_file_location..
"\nYou can abort the mission in DCS Retribution.\n"..
"\n\nPlease fix your setup in DCS Retribution, make sure you are pointing to the right installation directory from the File/Preferences menu. Then after fixing the path restart DCS Retribution, and then restart DCS."..
"\n\nYou can also try to fix the issue manually by replacing the file <dcs_installation_directory>/Scripts/MissionScripting.lua by the one provided there : <dcs_retribution_folder>/resources/scripts/MissionScripting.lua. And then restart DCS. (This will also have to be done again after each DCS update)"..
"\n\nIt's not worth playing, the state of the mission will not be recorded.")
end

View File

@ -13,8 +13,8 @@
"mnemonic": "json"
},
{
"file": "dcs_liberation.lua",
"mnemonic": "liberation"
"file": "dcs_retribution.lua",
"mnemonic": "retribution"
}
],
"configurationWorkOrders": []

View File

@ -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

View File

@ -1,17 +1,17 @@
-------------------------------------------------------------------------------------------------------------------------------------------------------------
-- configuration file for the LotATC Export script
--
-- 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
-------------------------------------------------------------------------------------------------------------------------------------------------------------
-- LotATC Export plugin - configuration
logger:info("DCSLiberation|LotATC Export plugin - configuration")
logger:info("DCSRetribution|LotATC Export plugin - configuration")
local function discoverLotAtcDrawingsPath()
-- establish a search pattern into the following modes
-- 1. Environment variable LOTATC_DRAWINGS_DIR, to support server exporting with auto load from LotATC
-- 2. DCS saved games folder as configured in DCS Liberation
-- 2. DCS saved games folder as configured in DCS Retribution
local drawingEnvDir = os.getenv("LOTATC_DRAWINGS_DIR")
if drawingEnvDir then
@ -21,28 +21,28 @@ local function discoverLotAtcDrawingsPath()
end
end
if dcsLiberation then
logger:info("DCSLiberation|LotATC Export plugin - configuration dcsLiberation")
if dcsRetribution then
logger:info("DCSRetribution|LotATC Export plugin - configuration dcsRetribution")
local exportRedAA = true
local exportBlueAA = false
local exportSymbols = true
-- retrieve specific options values
if dcsLiberation.plugins then
logger:info("DCSLiberation|LotATC Export plugin - configuration dcsLiberation.plugins")
if dcsRetribution.plugins then
logger:info("DCSRetribution|LotATC Export plugin - configuration dcsRetribution.plugins")
if dcsLiberation.plugins.lotatc then
logger:info("DCSLiberation|LotATC Export plugin - dcsLiberation.plugins.lotatcExport")
if dcsRetribution.plugins.lotatc then
logger:info("DCSRetribution|LotATC Export plugin - dcsRetribution.plugins.lotatcExport")
exportRedAA = dcsLiberation.plugins.lotatc.exportRedAA
logger:info(string.format("DCSLiberation|LotATC Export plugin - exportRedAA = %s",tostring(exportRedAA)))
exportRedAA = dcsRetribution.plugins.lotatc.exportRedAA
logger:info(string.format("DCSRetribution|LotATC Export plugin - exportRedAA = %s",tostring(exportRedAA)))
exportBlueAA = dcsLiberation.plugins.lotatc.exportBlueAA
logger:info(string.format("DCSLiberation|LotATC Export plugin - exportBlueAA = %s",tostring(exportBlueAA)))
exportBlueAA = dcsRetribution.plugins.lotatc.exportBlueAA
logger:info(string.format("DCSRetribution|LotATC Export plugin - exportBlueAA = %s",tostring(exportBlueAA)))
exportBlueAA = dcsLiberation.plugins.lotatc.exportSymbols
logger:info(string.format("DCSLiberation|LotATC Export plugin - exportSymbols = %s",tostring(exportSymbols)))
exportBlueAA = dcsRetribution.plugins.lotatc.exportSymbols
logger:info(string.format("DCSRetribution|LotATC Export plugin - exportSymbols = %s",tostring(exportSymbols)))
end
end

View File

@ -1,7 +1,7 @@
--[[
Export script for LotATC drawings
Allows to export certain DCS Liberation objects as predefined drawing in LotATC.
Allows to export certain DCS Retribution objects as predefined drawing in LotATC.
This script runs at mission startup and generates a drawing JSON file to be imported
in LotATC.
@ -51,7 +51,7 @@ local function lotatcExport_get_aa_nato_name(unit, isFriend)
return nil
end
-- logger:info(string.format("DCSLiberation|LotATC Export plugin - try get NATO name for unit %s", unit.dcsGroupName))
-- logger:info(string.format("DCSRetribution|LotATC Export plugin - try get NATO name for unit %s", unit.dcsGroupName))
local iads = redIADS
if isFriend then
@ -60,7 +60,7 @@ local function lotatcExport_get_aa_nato_name(unit, isFriend)
local samSite = iads:getSAMSiteByGroupName(unit.dcsGroupName)
if samSite and samSite.natoName then
-- logger:info(string.format("DCSLiberation|LotATC Export plugin - NATO name is %s", samSite.natoName))
-- logger:info(string.format("DCSRetribution|LotATC Export plugin - NATO name is %s", samSite.natoName))
return samSite.natoName
else
return nil
@ -89,7 +89,7 @@ local function lotatcExport_get_name(unit, isFriend)
end
local function lotatc_write_json(filename, json)
logger:info(string.format("DCSLiberation|LotATC Export plugin - writing %s", filename))
logger:info(string.format("DCSRetribution|LotATC Export plugin - writing %s", filename))
local function Write()
local fp = io.open(filename, 'w')
@ -109,7 +109,7 @@ local function lotatcExport_threat_circles_for_faction(faction, color, isFriend)
local drawings = {}
for _,aa in pairs(faction) do
logger:info(string.format("DCSLiberation|LotATC Export plugin - exporting threat circle for %s", aa.dcsGroupName))
logger:info(string.format("DCSRetribution|LotATC Export plugin - exporting threat circle for %s", aa.dcsGroupName))
local convLat, convLon = coord.LOtoLL({x = aa.positionX, y = 0, z = aa.positionY})
@ -117,7 +117,7 @@ local function lotatcExport_threat_circles_for_faction(faction, color, isFriend)
table.insert(drawings,
{
["author"] = "DCSLiberation",
["author"] = "DCSRetribution",
["brushStyle"] = 1,
["color"] = color,
["colorBg"] = "#00000000",
@ -153,7 +153,7 @@ local function lotatcExport_symbols_for_faction(faction, color, isFriend)
local drawings = {}
for _,aa in pairs(faction) do
logger:info(string.format("DCSLiberation|LotATC Export plugin - exporting AA symbol for %s", aa.dcsGroupName))
logger:info(string.format("DCSRetribution|LotATC Export plugin - exporting AA symbol for %s", aa.dcsGroupName))
local convLat, convLon = coord.LOtoLL({x = aa.positionX, y = 0, z = aa.positionY})
@ -172,7 +172,7 @@ local function lotatcExport_symbols_for_faction(faction, color, isFriend)
table.insert(drawings,
{
["author"] = "DCSLiberation",
["author"] = "DCSRetribution",
["brushStyle"] = 1,
["classification"] = {
["classification"] = classification,
@ -244,10 +244,10 @@ function LotatcExport()
-- wants to see the RED AA.
if LotAtcExportConfig.exportRedAA then
lotatc_export_faction(dcsLiberation.RedAA, LotAtcExportConfig.redColor, [[blue\]], false)
lotatc_export_faction(dcsRetribution.RedAA, LotAtcExportConfig.redColor, [[blue\]], false)
end
if LotAtcExportConfig.exportBlueAA then
lotatc_export_faction(dcsLiberation.BlueAA, LotAtcExportConfig.blueColor, [[red\]], true)
lotatc_export_faction(dcsRetribution.BlueAA, LotAtcExportConfig.blueColor, [[red\]], true)
end
end

View File

@ -2,14 +2,14 @@
-- Mission configuration file for the Skynet-IADS framework
-- see https://github.com/walder/Skynet-IADS
--
-- 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
-------------------------------------------------------------------------------------------------------------------------------------------------------------
-- Skynet-IADS plugin - configuration
env.info("DCSLiberation|Skynet-IADS plugin - configuration")
env.info("DCSRetribution|Skynet-IADS plugin - configuration")
if dcsLiberation and SkynetIADS then
if dcsRetribution and SkynetIADS then
-- specific options
local createRedIADS = false
@ -20,23 +20,23 @@ if dcsLiberation and SkynetIADS then
local debugBLUE = false
-- retrieve specific options values
if dcsLiberation.plugins then
if dcsLiberation.plugins.skynetiads then
createRedIADS = dcsLiberation.plugins.skynetiads.createRedIADS
createBlueIADS = dcsLiberation.plugins.skynetiads.createBlueIADS
includeRedInRadio = dcsLiberation.plugins.skynetiads.includeRedInRadio
includeBlueInRadio = dcsLiberation.plugins.skynetiads.includeBlueInRadio
debugRED = dcsLiberation.plugins.skynetiads.debugRED
debugBLUE = dcsLiberation.plugins.skynetiads.debugBLUE
if dcsRetribution.plugins then
if dcsRetribution.plugins.skynetiads then
createRedIADS = dcsRetribution.plugins.skynetiads.createRedIADS
createBlueIADS = dcsRetribution.plugins.skynetiads.createBlueIADS
includeRedInRadio = dcsRetribution.plugins.skynetiads.includeRedInRadio
includeBlueInRadio = dcsRetribution.plugins.skynetiads.includeBlueInRadio
debugRED = dcsRetribution.plugins.skynetiads.debugRED
debugBLUE = dcsRetribution.plugins.skynetiads.debugBLUE
end
end
env.info(string.format("DCSLiberation|Skynet-IADS plugin - createRedIADS=%s", tostring(createRedIADS)))
env.info(string.format("DCSLiberation|Skynet-IADS plugin - createBlueIADS=%s", tostring(createBlueIADS)))
env.info(string.format("DCSLiberation|Skynet-IADS plugin - includeRedInRadio=%s", tostring(includeRedInRadio)))
env.info(string.format("DCSLiberation|Skynet-IADS plugin - includeBlueInRadio=%s", tostring(includeBlueInRadio)))
env.info(string.format("DCSLiberation|Skynet-IADS plugin - debugRED=%s", tostring(debugRED)))
env.info(string.format("DCSLiberation|Skynet-IADS plugin - debugBLUE=%s", tostring(debugBLUE)))
env.info(string.format("DCSRetribution|Skynet-IADS plugin - createRedIADS=%s", tostring(createRedIADS)))
env.info(string.format("DCSRetribution|Skynet-IADS plugin - createBlueIADS=%s", tostring(createBlueIADS)))
env.info(string.format("DCSRetribution|Skynet-IADS plugin - includeRedInRadio=%s", tostring(includeRedInRadio)))
env.info(string.format("DCSRetribution|Skynet-IADS plugin - includeBlueInRadio=%s", tostring(includeBlueInRadio)))
env.info(string.format("DCSRetribution|Skynet-IADS plugin - debugRED=%s", tostring(debugRED)))
env.info(string.format("DCSRetribution|Skynet-IADS plugin - debugBLUE=%s", tostring(debugBLUE)))
-- actual configuration code
local function initializeIADSElement(iads, iads_unit, element)
@ -64,7 +64,7 @@ if dcsLiberation and SkynetIADS then
end
if element.ConnectionNode then
for i, cn in pairs(element.ConnectionNode) do
env.info(string.format("DCSLiberation|Skynet-IADS plugin - adding IADS ConnectionNode %s", cn))
env.info(string.format("DCSRetribution|Skynet-IADS plugin - adding IADS ConnectionNode %s", cn))
local connection_node = StaticObject.getByName(cn .. " object") -- pydcs adds ' object' to the unit name for static elements
if connection_node then
iads_unit:addConnectionNode(connection_node)
@ -73,7 +73,7 @@ if dcsLiberation and SkynetIADS then
end
if element.PowerSource then
for i, ps in pairs(element.PowerSource) do
env.info(string.format("DCSLiberation|Skynet-IADS plugin - adding IADS PowerSource %s", ps))
env.info(string.format("DCSRetribution|Skynet-IADS plugin - adding IADS PowerSource %s", ps))
local power_source = StaticObject.getByName(ps .. " object") -- pydcs adds ' object' to the unit name for static elements
if power_source then
iads_unit:addPowerSource(power_source)
@ -82,7 +82,7 @@ if dcsLiberation and SkynetIADS then
end
if element.PD then
for i, pd in pairs(element.PD) do
env.info(string.format("DCSLiberation|Skynet-IADS plugin - adding IADS Point Defence %s", pd))
env.info(string.format("DCSRetribution|Skynet-IADS plugin - adding IADS Point Defence %s", pd))
local point_defence = iads:addSAMSite(pd)
if point_defence ~= nil then
-- only add as point defence if skynet can handle the PD unit
@ -119,16 +119,16 @@ if dcsLiberation and SkynetIADS then
end
-- add the AWACS
if dcsLiberation.AWACs then
for _, data in pairs(dcsLiberation.AWACs) do
env.info(string.format("DCSLiberation|Skynet-IADS plugin - processing AWACS %s", data.dcsGroupName))
if dcsRetribution.AWACs then
for _, data in pairs(dcsRetribution.AWACs) do
env.info(string.format("DCSRetribution|Skynet-IADS plugin - processing AWACS %s", data.dcsGroupName))
local group = Group.getByName(data.dcsGroupName)
if group then
if group:getCoalition() == coalition then
local unit = group:getUnit(1)
if unit then
local unitName = unit:getName()
env.info(string.format("DCSLiberation|Skynet-IADS plugin - adding AWACS %s", unitName))
env.info(string.format("DCSRetribution|Skynet-IADS plugin - adding AWACS %s", unitName))
iads:addEarlyWarningRadar(unitName)
end
end
@ -137,25 +137,25 @@ if dcsLiberation and SkynetIADS then
end
-- add the IADS Elements: SAM, EWR, and Command Centers
if dcsLiberation.IADS then
local coalition_iads = dcsLiberation.IADS[coalitionPrefix]
if dcsRetribution.IADS then
local coalition_iads = dcsRetribution.IADS[coalitionPrefix]
if coalition_iads.Ewr then
for _, unit in pairs(coalition_iads.Ewr) do
env.info(string.format("DCSLiberation|Skynet-IADS plugin - processing IADS EWR %s", unit.dcsGroupName))
env.info(string.format("DCSRetribution|Skynet-IADS plugin - processing IADS EWR %s", unit.dcsGroupName))
local iads_unit = iads:addEarlyWarningRadar(unit.dcsGroupName)
initializeIADSElement(iads, iads_unit, unit)
end
end
if coalition_iads.Sam then
for _, unit in pairs(coalition_iads.Sam) do
env.info(string.format("DCSLiberation|Skynet-IADS plugin - processing IADS SAM %s", unit.dcsGroupName))
env.info(string.format("DCSRetribution|Skynet-IADS plugin - processing IADS SAM %s", unit.dcsGroupName))
local iads_unit = iads:addSAMSite(unit.dcsGroupName)
initializeIADSElement(iads, iads_unit, unit)
end
end
if coalition_iads.SamAsEwr then
for _, unit in pairs(coalition_iads.SamAsEwr) do
env.info(string.format("DCSLiberation|Skynet-IADS plugin - processing IADS SAM as EWR %s", unit.dcsGroupName))
env.info(string.format("DCSRetribution|Skynet-IADS plugin - processing IADS SAM as EWR %s", unit.dcsGroupName))
local iads_unit = iads:addSAMSite(unit.dcsGroupName)
if iads_unit ~= nil then
-- only process if its a valid skynet group
@ -166,7 +166,7 @@ if dcsLiberation and SkynetIADS then
end
if coalition_iads.CommandCenter then
for _, unit in pairs(coalition_iads.CommandCenter) do
env.info(string.format("DCSLiberation|Skynet-IADS plugin - processing IADS Command Center %s", unit.dcsGroupName))
env.info(string.format("DCSRetribution|Skynet-IADS plugin - processing IADS Command Center %s", unit.dcsGroupName))
local commandCenter = StaticObject.getByName(unit.dcsGroupName .. " object") -- pydcs adds ' object' to the unit name for static elements
if commandCenter then
local iads_unit = iads:addCommandCenter(commandCenter)
@ -178,7 +178,7 @@ if dcsLiberation and SkynetIADS then
if inRadio then
--activate the radio menu to toggle IADS Status output
env.info("DCSLiberation|Skynet-IADS plugin - adding in radio menu")
env.info("DCSRetribution|Skynet-IADS plugin - adding in radio menu")
iads:addRadioMenu()
end
@ -190,13 +190,13 @@ if dcsLiberation and SkynetIADS then
-- create the IADS networks
-------------------------------------------------------------------------------------------------------------------------------------------------------------
if createRedIADS then
env.info("DCSLiberation|Skynet-IADS plugin - creating red IADS")
env.info("DCSRetribution|Skynet-IADS plugin - creating red IADS")
local redIADS = SkynetIADS:create("IADS")
initializeIADS(redIADS, 1, includeRedInRadio, debugRED) -- RED
end
if createBlueIADS then
env.info("DCSLiberation|Skynet-IADS plugin - creating blue IADS")
env.info("DCSRetribution|Skynet-IADS plugin - creating blue IADS")
local blueIADS = SkynetIADS:create("IADS")
initializeIADS(blueIADS, 2, includeBlueInRadio, debugBLUE) -- BLUE
end