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

View File

@ -162,7 +162,7 @@ class LuaPlugin(PluginSettings):
for option in self.options: for option in self.options:
enabled = str(option.enabled).lower() enabled = str(option.enabled).lower()
name = option.identifier 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) joined_options = "\n".join(option_decls)
@ -170,11 +170,11 @@ class LuaPlugin(PluginSettings):
f"""\ f"""\
-- {self.identifier} plugin configuration. -- {self.identifier} plugin configuration.
if dcsLiberation then if dcsRetribution then
if not dcsLiberation.plugins then if not dcsRetribution.plugins then
dcsLiberation.plugins = {{}} dcsRetribution.plugins = {{}}
end end
dcsLiberation.plugins.{self.identifier} = {{}} dcsRetribution.plugins.{self.identifier} = {{}}
{joined_options} {joined_options}
end 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 -- 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 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)) logger:info("Check that json.lua is loaded : json = "..tostring(json))
killed_aircrafts = {} -- killed aircraft will be added via S_EVENT_CRASH event 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, ["destroyed_objects_positions"] = destroyed_objects_positions,
} }
if not json then 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) logger:error(message)
messageAll(message) messageAll(message)
end end
@ -76,30 +76,30 @@ end
local function discoverDebriefingFilePath() local function discoverDebriefingFilePath()
-- establish a search pattern into the following modes -- establish a search pattern into the following modes
-- 1. Environment variable LIBERATION_EXPORT_DIR, to support dedicated server hosting -- 1. Environment variable RETRIBUTION_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 -- 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 -- 3. System temporary folder, as set in the TEMP environment variable
-- 4. Working directory. -- 4. Working directory.
local useCurrentStamping = nil local useCurrentStamping = nil
if os then if os then
useCurrentStamping = os.getenv("LIBERATION_EXPORT_STAMPED_STATE") useCurrentStamping = os.getenv("RETRIBUTION_EXPORT_STAMPED_STATE")
end end
local installPath = nil local installPath = nil
if dcsLiberation then if dcsRetribution then
installPath = dcsLiberation.installPath installPath = dcsRetribution.installPath
end end
if os then if os then
local result = nil local result = nil
-- try using the LIBERATION_EXPORT_DIR environment variable -- try using the RETRIBUTION_EXPORT_DIR environment variable
result = testDebriefingFilePath(os.getenv("LIBERATION_EXPORT_DIR"), "LIBERATION_EXPORT_DIR", useCurrentStamping) result = testDebriefingFilePath(os.getenv("RETRIBUTION_EXPORT_DIR"), "RETRIBUTION_EXPORT_DIR", useCurrentStamping)
if result then if result then
return result return result
end end
-- no joy ? maybe there is a valid path in the mission ? -- 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 if result then
return result return result
end end
@ -124,15 +124,15 @@ write_state_error_handling = function()
local _debriefing_file_location = debriefing_file_location local _debriefing_file_location = debriefing_file_location
if not debriefing_file_location then if not debriefing_file_location then
_debriefing_file_location = "[nil]" _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 end
if pcall(write_state) then if pcall(write_state) then
else else
messageAll("Unable to write DCS Liberation state to ".._debriefing_file_location.. messageAll("Unable to write DCS Retribution state to ".._debriefing_file_location..
"\nYou can abort the mission in DCS Liberation.\n".. "\nYou can abort the mission in DCS Retribution.\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\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_liberation_folder>/resources/scripts/MissionScripting.lua. And then restart DCS. (This will also have to be done again after each DCS update)".. "\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.") "\n\nIt's not worth playing, the state of the mission will not be recorded.")
end end

View File

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

View File

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

View File

@ -1,17 +1,17 @@
------------------------------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------------------------------------
-- configuration file for the LotATC Export script -- configuration file for the LotATC Export script
-- --
-- This configuration is tailored for a mission generated by DCS Liberation -- This configuration is tailored for a mission generated by DCS Retribution
-- see https://github.com/dcs-liberation/dcs_liberation -- see https://github.com/dcs-retribution/dcs-retribution
------------------------------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------------------------------------
-- LotATC Export plugin - configuration -- LotATC Export plugin - configuration
logger:info("DCSLiberation|LotATC Export plugin - configuration") logger:info("DCSRetribution|LotATC Export plugin - configuration")
local function discoverLotAtcDrawingsPath() local function discoverLotAtcDrawingsPath()
-- establish a search pattern into the following modes -- establish a search pattern into the following modes
-- 1. Environment variable LOTATC_DRAWINGS_DIR, to support server exporting with auto load from LotATC -- 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") local drawingEnvDir = os.getenv("LOTATC_DRAWINGS_DIR")
if drawingEnvDir then if drawingEnvDir then
@ -21,28 +21,28 @@ local function discoverLotAtcDrawingsPath()
end end
end end
if dcsLiberation then if dcsRetribution then
logger:info("DCSLiberation|LotATC Export plugin - configuration dcsLiberation") logger:info("DCSRetribution|LotATC Export plugin - configuration dcsRetribution")
local exportRedAA = true local exportRedAA = true
local exportBlueAA = false local exportBlueAA = false
local exportSymbols = true local exportSymbols = true
-- retrieve specific options values -- retrieve specific options values
if dcsLiberation.plugins then if dcsRetribution.plugins then
logger:info("DCSLiberation|LotATC Export plugin - configuration dcsLiberation.plugins") logger:info("DCSRetribution|LotATC Export plugin - configuration dcsRetribution.plugins")
if dcsLiberation.plugins.lotatc then if dcsRetribution.plugins.lotatc then
logger:info("DCSLiberation|LotATC Export plugin - dcsLiberation.plugins.lotatcExport") logger:info("DCSRetribution|LotATC Export plugin - dcsRetribution.plugins.lotatcExport")
exportRedAA = dcsLiberation.plugins.lotatc.exportRedAA exportRedAA = dcsRetribution.plugins.lotatc.exportRedAA
logger:info(string.format("DCSLiberation|LotATC Export plugin - exportRedAA = %s",tostring(exportRedAA))) logger:info(string.format("DCSRetribution|LotATC Export plugin - exportRedAA = %s",tostring(exportRedAA)))
exportBlueAA = dcsLiberation.plugins.lotatc.exportBlueAA exportBlueAA = dcsRetribution.plugins.lotatc.exportBlueAA
logger:info(string.format("DCSLiberation|LotATC Export plugin - exportBlueAA = %s",tostring(exportBlueAA))) logger:info(string.format("DCSRetribution|LotATC Export plugin - exportBlueAA = %s",tostring(exportBlueAA)))
exportBlueAA = dcsLiberation.plugins.lotatc.exportSymbols exportBlueAA = dcsRetribution.plugins.lotatc.exportSymbols
logger:info(string.format("DCSLiberation|LotATC Export plugin - exportSymbols = %s",tostring(exportSymbols))) logger:info(string.format("DCSRetribution|LotATC Export plugin - exportSymbols = %s",tostring(exportSymbols)))
end end
end end

View File

@ -1,7 +1,7 @@
--[[ --[[
Export script for LotATC drawings 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 This script runs at mission startup and generates a drawing JSON file to be imported
in LotATC. in LotATC.
@ -51,7 +51,7 @@ local function lotatcExport_get_aa_nato_name(unit, isFriend)
return nil return nil
end 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 local iads = redIADS
if isFriend then if isFriend then
@ -60,7 +60,7 @@ local function lotatcExport_get_aa_nato_name(unit, isFriend)
local samSite = iads:getSAMSiteByGroupName(unit.dcsGroupName) local samSite = iads:getSAMSiteByGroupName(unit.dcsGroupName)
if samSite and samSite.natoName then 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 return samSite.natoName
else else
return nil return nil
@ -89,7 +89,7 @@ local function lotatcExport_get_name(unit, isFriend)
end end
local function lotatc_write_json(filename, json) 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 function Write()
local fp = io.open(filename, 'w') local fp = io.open(filename, 'w')
@ -109,7 +109,7 @@ local function lotatcExport_threat_circles_for_faction(faction, color, isFriend)
local drawings = {} local drawings = {}
for _,aa in pairs(faction) do 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}) 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, table.insert(drawings,
{ {
["author"] = "DCSLiberation", ["author"] = "DCSRetribution",
["brushStyle"] = 1, ["brushStyle"] = 1,
["color"] = color, ["color"] = color,
["colorBg"] = "#00000000", ["colorBg"] = "#00000000",
@ -153,7 +153,7 @@ local function lotatcExport_symbols_for_faction(faction, color, isFriend)
local drawings = {} local drawings = {}
for _,aa in pairs(faction) do 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}) 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, table.insert(drawings,
{ {
["author"] = "DCSLiberation", ["author"] = "DCSRetribution",
["brushStyle"] = 1, ["brushStyle"] = 1,
["classification"] = { ["classification"] = {
["classification"] = classification, ["classification"] = classification,
@ -244,10 +244,10 @@ function LotatcExport()
-- wants to see the RED AA. -- wants to see the RED AA.
if LotAtcExportConfig.exportRedAA then if LotAtcExportConfig.exportRedAA then
lotatc_export_faction(dcsLiberation.RedAA, LotAtcExportConfig.redColor, [[blue\]], false) lotatc_export_faction(dcsRetribution.RedAA, LotAtcExportConfig.redColor, [[blue\]], false)
end end
if LotAtcExportConfig.exportBlueAA then if LotAtcExportConfig.exportBlueAA then
lotatc_export_faction(dcsLiberation.BlueAA, LotAtcExportConfig.blueColor, [[red\]], true) lotatc_export_faction(dcsRetribution.BlueAA, LotAtcExportConfig.blueColor, [[red\]], true)
end end
end end

View File

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