From 5e35efcaef5a1e526a142768b65712773f2c9090 Mon Sep 17 00:00:00 2001 From: David Pierron Date: Fri, 25 Sep 2020 10:36:18 +0200 Subject: [PATCH 01/10] UHF Intraflight Frequency for Player and Clients A-10C In the mission editor, using a VHF frequency for a Player or Client A-10C results in an error. Changed the radio definitions to use AN/ARC-164 for intraflight comms. --- gen/aircraft.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gen/aircraft.py b/gen/aircraft.py index 4911c916..25c48aa0 100644 --- a/gen/aircraft.py +++ b/gen/aircraft.py @@ -374,7 +374,7 @@ class AircraftData: AIRCRAFT_DATA: Dict[str, AircraftData] = { "A-10C": AircraftData( inter_flight_radio=get_radio("AN/ARC-164"), - intra_flight_radio=get_radio("AN/ARC-186(V) AM"), + intra_flight_radio=get_radio("AN/ARC-164"), channel_allocator=WarthogRadioChannelAllocator() ), From 84da44a27bd20c5b378caaa0d1be075b8442795f Mon Sep 17 00:00:00 2001 From: David Pierron Date: Fri, 25 Sep 2020 11:06:25 +0200 Subject: [PATCH 02/10] Introduced LUA scripts plugins In order to be able to customize the scripts that can be injected in the mission, a __plugin.lst file is read and the scripts mentionned in this file are injected (through DoScriptFile and not DoScript). A mechanism checks if a standard script (Mist, JTACAutolase) has already been loaded, to avoid loading them twice. --- game/operation/operation.py | 62 ++++++++++++++++++++++++------------- 1 file changed, 40 insertions(+), 22 deletions(-) diff --git a/game/operation/operation.py b/game/operation/operation.py index f66eb124..2449746e 100644 --- a/game/operation/operation.py +++ b/game/operation/operation.py @@ -234,30 +234,29 @@ class Operation: if self.game.settings.perf_smoke_gen: self.visualgen.generate() - # Inject Lua Scripts - load_mist = TriggerStart(comment="Load Mist Lua Framework") - with open("./resources/scripts/mist_4_3_74.lua") as f: - load_mist.add_action(DoScript(String(f.read()))) - self.current_mission.triggerrules.triggers.append(load_mist) + # Inject Plugins Lua Scripts + listOfPluginsScripts = [] + try: + with open("./resources/scripts/plugins/__plugins.lst", "r") as a_file: + for line in a_file: + name = line.strip() + if not name.startswith( '#' ): + trigger = TriggerStart(comment="Load " + name) + listOfPluginsScripts.append(name) + fileref = self.current_mission.map_resource.add_resource_file("./resources/scripts/plugins/" + name) + trigger.add_action(DoScriptFile(fileref)) + self.current_mission.triggerrules.triggers.append(trigger) + except Exception as e: + print(e) - # Load Ciribob's JTACAutoLase script - load_autolase = TriggerStart(comment="Load JTAC script") - with open("./resources/scripts/JTACAutoLase.lua") as f: - - script = f.read() - script = script + "\n" - - smoke = "true" - if hasattr(self.game.settings, "jtac_smoke_on"): - if not self.game.settings.jtac_smoke_on: - smoke = "false" - - for jtac in jtacs: - script += f"\nJTACAutoLase('{jtac.unit_name}', {jtac.code}, {smoke}, 'vehicle')\n" - - load_autolase.add_action(DoScript(String(script))) - self.current_mission.triggerrules.triggers.append(load_autolase) + # Inject Mist Script if not done already in the plugins + if not "mist.lua" in listOfPluginsScripts and not "mist_4_3_74.lua" in listOfPluginsScripts: # don't load mist twice + trigger = TriggerStart(comment="Load Mist Lua Framework") + fileref = self.current_mission.map_resource.add_resource_file("./resources/scripts/mist_4_3_74.lua") + trigger.add_action(DoScriptFile(fileref)) + self.current_mission.triggerrules.triggers.append(trigger) + # Inject Liberation script load_dcs_libe = TriggerStart(comment="Load DCS Liberation Script") with open("./resources/scripts/dcs_liberation.lua") as f: script = f.read() @@ -268,6 +267,25 @@ class Operation: load_dcs_libe.add_action(DoScript(String(script))) self.current_mission.triggerrules.triggers.append(load_dcs_libe) + # Load Ciribob's JTACAutoLase script if not done already in the plugins + if not "JTACAutoLase.lua" in listOfPluginsScripts: # don't load JTACAutoLase twice + load_autolase = TriggerStart(comment="Load JTAC script") + with open("./resources/scripts/JTACAutoLase.lua") as f: + + script = f.read() + script = script + "\n" + + smoke = "true" + if hasattr(self.game.settings, "jtac_smoke_on"): + if not self.game.settings.jtac_smoke_on: + smoke = "false" + + for jtac in jtacs: + script += f"\nJTACAutoLase('{jtac.unit_name}', {jtac.code}, {smoke}, 'vehicle')\n" + + load_autolase.add_action(DoScript(String(script))) + self.current_mission.triggerrules.triggers.append(load_autolase) + self.assign_channels_to_flights() kneeboard_generator = KneeboardGenerator(self.current_mission) From 1a125c62e7d7b7354669c2421f5e38e570f104eb Mon Sep 17 00:00:00 2001 From: David Pierron Date: Fri, 25 Sep 2020 11:21:23 +0200 Subject: [PATCH 03/10] added sample __plugins.lst file --- .gitignore | 1 + .../scripts/plugins/__plugins.lst.sample | 29 +++++++++++++++++++ resources/scripts/plugins/link.cmd.sample | 29 +++++++++++++++++++ 3 files changed, 59 insertions(+) create mode 100644 resources/scripts/plugins/__plugins.lst.sample create mode 100644 resources/scripts/plugins/link.cmd.sample diff --git a/.gitignore b/.gitignore index 68c604e4..8c7d79f3 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,4 @@ logs/liberation.log qt_ui/logs/liberation.log *.psd +resources/scripts/plugins/* diff --git a/resources/scripts/plugins/__plugins.lst.sample b/resources/scripts/plugins/__plugins.lst.sample new file mode 100644 index 00000000..27cbf0c0 --- /dev/null +++ b/resources/scripts/plugins/__plugins.lst.sample @@ -0,0 +1,29 @@ +# this is a list of lua scripts that will be injected in the mission, in the same order +mist.lua +Moose.lua +CTLD.lua +NIOD.lua +WeatherMark.lua +veaf.lua +dcsUnits.lua +# JTACAutoLase is an empty file, only there to disable loading the official script (already included in CTLD) +JTACAutoLase.lua +veafAssets.lua +veafCarrierOperations.lua +veafCarrierOperations2.lua +veafCasMission.lua +veafCombatMission.lua +veafCombatZone.lua +veafGrass.lua +veafInterpreter.lua +veafMarkers.lua +veafMove.lua +veafNamedPoints.lua +veafRadio.lua +veafRemote.lua +veafSecurity.lua +veafShortcuts.lua +veafSpawn.lua +veafTransportMission.lua +veafUnits.lua +missionConfig.lua diff --git a/resources/scripts/plugins/link.cmd.sample b/resources/scripts/plugins/link.cmd.sample new file mode 100644 index 00000000..e9c69ce7 --- /dev/null +++ b/resources/scripts/plugins/link.cmd.sample @@ -0,0 +1,29 @@ +rem this can be used to easily create hardlinks from your plugin development folder + +mklink mist.lua d:\dev\_VEAF\VEAF-Mission-Creation-Tools\src\scripts\community\mist.lua +mklink Moose.lua d:\dev\_VEAF\VEAF-Mission-Creation-Tools\src\scripts\community\Moose.lua +mklink CTLD.lua d:\dev\_VEAF\VEAF-Mission-Creation-Tools\src\scripts\community\CTLD.lua +mklink NIOD.lua d:\dev\_VEAF\VEAF-Mission-Creation-Tools\src\scripts\community\NIOD.lua +mklink WeatherMark.lua d:\dev\_VEAF\VEAF-Mission-Creation-Tools\src\scripts\community\WeatherMark.lua +mklink veaf.lua d:\dev\_VEAF\VEAF-Mission-Creation-Tools\src\scripts\veaf\veaf.lua +mklink dcsUnits.lua d:\dev\_VEAF\VEAF-Mission-Creation-Tools\src\scripts\veaf\dcsUnits.lua +mklink JTACAutoLase.lua d:\dev\_VEAF\VEAF-Mission-Creation-Tools\src\scripts\veaf\JTACAutoLase.lua +mklink veafAssets.lua d:\dev\_VEAF\VEAF-Mission-Creation-Tools\src\scripts\veaf\veafAssets.lua +mklink veafCarrierOperations.lua d:\dev\_VEAF\VEAF-Mission-Creation-Tools\src\scripts\veaf\veafCarrierOperations.lua +mklink veafCarrierOperations2.lua d:\dev\_VEAF\VEAF-Mission-Creation-Tools\src\scripts\veaf\veafCarrierOperations2.lua +mklink veafCasMission.lua d:\dev\_VEAF\VEAF-Mission-Creation-Tools\src\scripts\veaf\veafCasMission.lua +mklink veafCombatMission.lua d:\dev\_VEAF\VEAF-Mission-Creation-Tools\src\scripts\veaf\veafCombatMission.lua +mklink veafCombatZone.lua d:\dev\_VEAF\VEAF-Mission-Creation-Tools\src\scripts\veaf\veafCombatZone.lua +mklink veafGrass.lua d:\dev\_VEAF\VEAF-Mission-Creation-Tools\src\scripts\veaf\veafGrass.lua +mklink veafInterpreter.lua d:\dev\_VEAF\VEAF-Mission-Creation-Tools\src\scripts\veaf\veafInterpreter.lua +mklink veafMarkers.lua d:\dev\_VEAF\VEAF-Mission-Creation-Tools\src\scripts\veaf\veafMarkers.lua +mklink veafMove.lua d:\dev\_VEAF\VEAF-Mission-Creation-Tools\src\scripts\veaf\veafMove.lua +mklink veafNamedPoints.lua d:\dev\_VEAF\VEAF-Mission-Creation-Tools\src\scripts\veaf\veafNamedPoints.lua +mklink veafRadio.lua d:\dev\_VEAF\VEAF-Mission-Creation-Tools\src\scripts\veaf\veafRadio.lua +mklink veafRemote.lua d:\dev\_VEAF\VEAF-Mission-Creation-Tools\src\scripts\veaf\veafRemote.lua +mklink veafSecurity.lua d:\dev\_VEAF\VEAF-Mission-Creation-Tools\src\scripts\veaf\veafSecurity.lua +mklink veafShortcuts.lua d:\dev\_VEAF\VEAF-Mission-Creation-Tools\src\scripts\veaf\veafShortcuts.lua +mklink veafSpawn.lua d:\dev\_VEAF\VEAF-Mission-Creation-Tools\src\scripts\veaf\veafSpawn.lua +mklink veafTransportMission.lua d:\dev\_VEAF\VEAF-Mission-Creation-Tools\src\scripts\veaf\veafTransportMission.lua +mklink veafUnits.lua d:\dev\_VEAF\VEAF-Mission-Creation-Tools\src\scripts\veaf\veafUnits.lua +mklink missionConfig.lua d:\dev\_VEAF\VEAF-Mission-Creation-Tools\src\scripts\veaf\missionConfig.lua From 66f607b5e6a9cf790f6107b5f67a815a24c937e7 Mon Sep 17 00:00:00 2001 From: David Pierron Date: Fri, 25 Sep 2020 11:33:07 +0200 Subject: [PATCH 04/10] added a comment that links to my forum post --- gen/aircraft.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gen/aircraft.py b/gen/aircraft.py index 25c48aa0..81a6202e 100644 --- a/gen/aircraft.py +++ b/gen/aircraft.py @@ -374,7 +374,7 @@ class AircraftData: AIRCRAFT_DATA: Dict[str, AircraftData] = { "A-10C": AircraftData( inter_flight_radio=get_radio("AN/ARC-164"), - intra_flight_radio=get_radio("AN/ARC-164"), + intra_flight_radio=get_radio("AN/ARC-164"), # VHF for intraflight is not accepted anymore by DCS (see https://forums.eagle.ru/showthread.php?p=4499738) channel_allocator=WarthogRadioChannelAllocator() ), From 4d510f643a988a8ed83003e42d07d853b8277201 Mon Sep 17 00:00:00 2001 From: David Pierron Date: Fri, 25 Sep 2020 17:11:17 +0200 Subject: [PATCH 05/10] add tanker type to tanker name --- gen/airsupportgen.py | 2 +- gen/naming.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gen/airsupportgen.py b/gen/airsupportgen.py index da0689e9..791c80b6 100644 --- a/gen/airsupportgen.py +++ b/gen/airsupportgen.py @@ -65,7 +65,7 @@ class AirSupportConflictGenerator: tanker_position = player_cp.position.point_from_heading(tanker_heading, TANKER_DISTANCE) tanker_group = self.mission.refuel_flight( country=self.mission.country(self.game.player_country), - name=namegen.next_tanker_name(self.mission.country(self.game.player_country)), + name=namegen.next_tanker_name(self.mission.country(self.game.player_country), tanker_unit_type), airport=None, plane_type=tanker_unit_type, position=tanker_position, diff --git a/gen/naming.py b/gen/naming.py index 0b543e0c..40da3a6b 100644 --- a/gen/naming.py +++ b/gen/naming.py @@ -61,9 +61,9 @@ class NameGenerator: self.number += 1 return "awacs|{}|{}|0|".format(country.id, self.number) - def next_tanker_name(self, country): + def next_tanker_name(self, country, unit_type): self.number += 1 - return "tanker|{}|{}|0|".format(country.id, self.number) + return "tanker|{}|{}|0|{}".format(country.id, self.number, db.unit_type_name(unit_type)) def next_carrier_name(self, country): self.number += 1 From 72e6ae418646a53f35b9c8433eb031032372ade0 Mon Sep 17 00:00:00 2001 From: Dan Albert Date: Sat, 26 Sep 2020 16:32:02 -0700 Subject: [PATCH 06/10] Fix None dereference. --- gen/airfields.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gen/airfields.py b/gen/airfields.py index 36f126b3..b7e08712 100644 --- a/gen/airfields.py +++ b/gen/airfields.py @@ -1527,7 +1527,10 @@ class RunwayData: ils: Optional[RadioFrequency] = None try: airfield = AIRFIELD_DATA[airport.name] - atc = airfield.atc.uhf + if airfield.atc is not None: + atc = airfield.atc.uhf + else: + atc = None tacan = airfield.tacan tacan_callsign = airfield.tacan_callsign ils = airfield.ils_freq(runway) From aa2e9b123cd01c1e17c328a88756a106947d2dce Mon Sep 17 00:00:00 2001 From: Khopa Date: Mon, 28 Sep 2020 00:03:01 +0200 Subject: [PATCH 07/10] Fix : AI is not planning flights for Tornado. --- gen/flights/ai_flight_planner_db.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/gen/flights/ai_flight_planner_db.py b/gen/flights/ai_flight_planner_db.py index c2824ef8..3b11b8ee 100644 --- a/gen/flights/ai_flight_planner_db.py +++ b/gen/flights/ai_flight_planner_db.py @@ -27,6 +27,7 @@ INTERCEPT_CAPABLE = [ # Used for CAP, Escort, and intercept if there is not a specialised aircraft available CAP_CAPABLE = [ + MiG_15bis, MiG_19P, MiG_21Bis, @@ -108,6 +109,9 @@ CAS_CAPABLE = [ F_16C_50, FA_18C_hornet, + Tornado_IDS, + Tornado_GR4, + C_101CC, MB_339PAN, L_39ZA, @@ -121,7 +125,6 @@ CAS_CAPABLE = [ AH_64D, AH_1W, - UH_1H, Mi_8MT, @@ -168,6 +171,9 @@ SEAD_CAPABLE = [ Su_34, MiG_27K, + Tornado_IDS, + Tornado_GR4, + A_4E_C, Rafale_A_S ] @@ -201,6 +207,9 @@ STRIKE_CAPABLE = [ F_16C_50, FA_18C_hornet, + Tornado_IDS, + Tornado_GR4, + C_101CC, L_39ZA, AJS37, @@ -237,6 +246,9 @@ ANTISHIP_CAPABLE = [ A_10C, A_10A, + Tornado_IDS, + Tornado_GR4, + Ju_88A4, Rafale_A_S ] From 7236c104033403b1aecdc57fedbe4323cc314774 Mon Sep 17 00:00:00 2001 From: Khopa Date: Mon, 28 Sep 2020 00:21:12 +0200 Subject: [PATCH 08/10] Changelog update --- changelog.md | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/changelog.md b/changelog.md index aa1f7abc..865636e7 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,9 @@ +# 2.1.2 + +## Fixes : +* **[Mission Generator]** Fix mission generation issues with radio frequencies (Thanks to contributors davidp57 and danalbert) +* **[Mission Generator]** AI should now properly plan flights for Tornados + # 2.1.1 ## Features/Improvements : @@ -5,9 +11,9 @@ * **[Kneeboards]** Generate mission kneeboards for player flights. Kneeboards include airfield/carrier information (ATC frequencies, ILS, TACAN, and runway assignments), assigned radio channels, waypoint lists, and AWACS/JTAC/tanker - information. + information. (Thanks to contributor danalbert) * **[Radios]** Allocate separate intra-flight channels for most aircraft to reduce global - chatter. + chatter. (Thanks to contributor danalbert) * **[Radios]** Configure radio channel presets for most aircraft. Currently supported are: * AJS37 * AV-8B @@ -15,7 +21,7 @@ * F-16C * F/A-18C * JF-17 - * M-2000C + * M-2000C (Thanks to contributor danalbert) * **[Base Menu]** Added possibility to repair destroyed SAM and base defenses units for the player (Click on a SAM site to fix it) * **[Base Menu]** Added possibility to buy/sell/replace SAM units * **[Map]** Added recon images for buildings on strike targets, click on a Strike target to get detailled informations @@ -25,7 +31,7 @@ * **[Cheat Menu]** Added buttons to remove money ## Fixed issues : -* **[UI/UX]** Spelling issues (Thanks to Github contributor steveveepee) +* **[UI/UX]** Spelling issues (Thanks to contributor steveveepee) * **[Campaign Generator]** LHA was placed on land in Syrian Civil War campaign * **[Campaign Generator]** Fixed inverted configuration for Syria full map * **[Campaign Generator]** Syria "Inherent Resolve" campaign, added Incirlik Air Base From 8b0f8770415afe1810d1a755bc62de13e7b44a52 Mon Sep 17 00:00:00 2001 From: Khopa Date: Mon, 28 Sep 2020 00:42:27 +0200 Subject: [PATCH 09/10] Verrsion string updated to 2.1.2 --- qt_ui/uiconstants.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qt_ui/uiconstants.py b/qt_ui/uiconstants.py index 02b9d14a..98026f3a 100644 --- a/qt_ui/uiconstants.py +++ b/qt_ui/uiconstants.py @@ -8,7 +8,7 @@ from game.event import UnitsDeliveryEvent, FrontlineAttackEvent from theater.theatergroundobject import CATEGORY_MAP from userdata.liberation_theme import get_theme_icons -VERSION_STRING = "2.1.1" +VERSION_STRING = "2.1.2" URLS : Dict[str, str] = { "Manual": "https://github.com/khopa/dcs_liberation/wiki", From a2a70213a779ddcbf847f9ae9739d827d21825bd Mon Sep 17 00:00:00 2001 From: Khopa Date: Mon, 28 Sep 2020 00:55:02 +0200 Subject: [PATCH 10/10] Update pydcs location --- pydcs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pydcs b/pydcs index f46781b8..7b7c0322 160000 --- a/pydcs +++ b/pydcs @@ -1 +1 @@ -Subproject commit f46781b854102a9f06948c8fb81a40331b78459e +Subproject commit 7b7c0322856c43ed8d1c7d29b2e30121129af048