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/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 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) diff --git a/gen/aircraft.py b/gen/aircraft.py index 4911c916..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-186(V) AM"), + 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() ), 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) 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/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 ] 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 diff --git a/pydcs b/pydcs index f46781b8..7b7c0322 160000 --- a/pydcs +++ b/pydcs @@ -1 +1 @@ -Subproject commit f46781b854102a9f06948c8fb81a40331b78459e +Subproject commit 7b7c0322856c43ed8d1c7d29b2e30121129af048 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", 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