From 32d009b95946a752716a21eb90e908c973354645 Mon Sep 17 00:00:00 2001 From: Ambroise Garel <47314805+akaAgar@users.noreply.github.com> Date: Sat, 26 Jul 2025 11:41:34 +0200 Subject: [PATCH] Added "cover me!" and additional "engage target" wingman commands --- Script/Library/RadioMessages.lua | 54 ++++++------- Script/The Universal Mission/WingmenMenu.lua | 80 +++++++++++++++----- 2 files changed, 90 insertions(+), 44 deletions(-) diff --git a/Script/Library/RadioMessages.lua b/Script/Library/RadioMessages.lua index 240bb3d..f01b27c 100644 --- a/Script/Library/RadioMessages.lua +++ b/Script/Library/RadioMessages.lua @@ -278,36 +278,38 @@ Library.radioMessages = { "Command, confirm grid on objective $1." }, playerWingmanEngageAirDefense = { - "Flight, prioritize air defense, engage now.", - "Flight, take down air defense systems.", - "Flight, suppress air defense threats.", - "Flight, air defense is yours, take it out.", - "Flight, eliminate air defense positions." - }, + "Flight, prioritize $1, engage now.", + "Flight, take down $1 systems.", + "Flight, suppress $1 threats.", + "Flight, $1 is yours, take it out.", + "Flight, eliminate $1 positions." + }, -- "$1" should be "air defense" in audio version playerWingmanEngageBandits = { - "Flight, engage bandits.", - "Flight, you're cleared hot bandits.", - "Flight, commit on bandits when ready.", - "Flight, engage bandits, your discretion.", - "Flight, you're free to engage bandits." + "Flight, engage $1.", + "Flight, you're cleared hot on $1.", + "Flight, commit on $1 when ready.", + "Flight, engage $1, your discretion.", + "Flight, you're free to engage $1." + }, -- "$1" should be "bandits" in audio version + playerWingmanCoverMe = { + "Flight, need cover now.", + "Flight, keep my six clean.", + "Flight, engaged defensive, cover me!", + "Flight, break off and clear my tail.", + "Flight, keep bandits off me." }, playerWingmanEngageGround = { - "Flight, engage ground targets.", - "Flight, prosecute ground targets ahead.", - "Flight, engage all ground contacts.", - "Flight, strike vehicle positions.", - "Flight, take the lead on ground targets.", - }, - playerWingmanEngageHelicopters = { - "Flight, you're cleared to prosecute helos.", - "Flight, engage helos at your discretion.", - "Flight, engage rotary contacts, break when done.", - }, + "Flight, engage $1 targets.", + "Flight, prosecute $1 targets ahead.", + "Flight, engage all $1 contacts.", + "Flight, strike $1 positions.", + "Flight, take the lead on $1 targets.", + }, -- "$1" should be "ground" in audio version playerWingmanEngageShips = { - "Flight, engage enemy vessels now.", - "Flight, strike ships in your sector.", - "Flight, take the lead on sea targets.", - }, + "Flight, engage enemy $1 now.", + "Flight, strike $1 in your sector.", + "Flight, take the lead on enemy $1.", + }, -- "$1" should be "ships" in audio version playerWingmanGoToMarker = { "Flight, proceed to waypoint.", "Flight, push to the hold point now.", diff --git a/Script/The Universal Mission/WingmenMenu.lua b/Script/The Universal Mission/WingmenMenu.lua index 1f8e524..c25f8bc 100644 --- a/Script/The Universal Mission/WingmenMenu.lua +++ b/Script/The Universal Mission/WingmenMenu.lua @@ -6,30 +6,25 @@ TUM.wingmenMenu = {} do - local function radioCommandReportContacts() + local function radioCommandCoverMe(args) local player = world:getPlayer() - if not player then return false end - TUM.radio.playForAll("playerWingmanReportContacts", nil, player:getCallsign(), false) + if not player then return end - TUM.wingmenTasking.commandReportContacts(nil, false, true) + TUM.radio.playForAll("playerWingmanCoverMe"..args.radioMessageSuffix, nil, player:getCallsign(), false) + + TUM.wingmenTasking.commandEngage(Group.Category.AIRPLANE, { "Fighters", "Interceptors", "Multirole fighters" } , true) end local function radioCommandEngage(args) local player = world:getPlayer() if not player then return end - TUM.radio.playForAll("playerWingmanEngage"..args.radioMessageSuffix, nil, player:getCallsign(), false) + args.radioTargetName = args.radioTargetName or "hostile" + + TUM.radio.playForAll("playerWingmanEngage"..args.radioMessageSuffix, { args.radioTargetName }, player:getCallsign(), false) TUM.wingmenTasking.commandEngage(args.category, args.attributes, true) end - local function radioCommandReportStatus() - local player = world:getPlayer() - if not player then return end - TUM.radio.playForAll("playerWingmanReportStatus", nil, player:getCallsign(), false) - - TUM.wingmenTasking.commandReportStatus(true) - end - local function radioCommandGoToMapMarker() local player = world:getPlayer() if not player then return end @@ -54,18 +49,67 @@ do TUM.wingmenTasking.commandRejoin(nil, true) end + local function radioCommandReportContacts() + local player = world:getPlayer() + if not player then return false end + TUM.radio.playForAll("playerWingmanReportContacts", nil, player:getCallsign(), false) + + TUM.wingmenTasking.commandReportContacts(nil, false, true) + end + + local function radioCommandReportStatus() + local player = world:getPlayer() + if not player then return end + TUM.radio.playForAll("playerWingmanReportStatus", nil, player:getCallsign(), false) + + TUM.wingmenTasking.commandReportStatus(true) + end + function TUM.wingmenMenu.create() if TUM.settings.getValue(TUM.settings.id.MULTIPLAYER) then return end -- No wingmen in multiplayer -- TODO: if WINGMEN_COUNT == 0 then return end local rootPath = missionCommands.addSubMenu("✈ Flight") + missionCommands.addCommand("Cover me!", rootPath, radioCommandCoverMe, nil) + local isWW2 = (TUM.settings.getValue(TUM.settings) == DCSEx.enums.timePeriod.WORLD_WAR_2) + + ------------------------------------------------------ + -- "Engage targets" submenu + ------------------------------------------------------ local engagePath = missionCommands.addSubMenu("Engage", rootPath) - missionCommands.addCommand("Bandits", engagePath, radioCommandEngage, { attributes = nil, category = Group.Category.HELICOPTER, radioMessageSuffix = "Bandits" }) - missionCommands.addCommand("Helicopters", engagePath, radioCommandEngage, { attributes = nil, category = Group.Category.HELICOPTER, radioMessageSuffix = "Helicopters" }) - missionCommands.addCommand("Air defense", engagePath, radioCommandEngage, { attributes = { "Air Defence" }, category = Group.Category.GROUND, radioMessageSuffix = "AirDefense" }) - missionCommands.addCommand("Ground targets", engagePath, radioCommandEngage, { attributes = {"Tanks", "Trucks", "Artillery", "IFV", "APC"}, category = Group.Category.GROUND, radioMessageSuffix = "Ground" }) - missionCommands.addCommand("Ships", engagePath, radioCommandEngage, { attributes = nil, category = Group.Category.SHIP, radioMessageSuffix = "Ships" }) + local engageSubPath = nil + + -- Aircraft -- (radioTargetName must be plural) + missionCommands.addCommand("Any aircraft", engagePath, radioCommandEngage, { attributes = nil, category = Group.Category.AIRPLANE, radioMessageSuffix = "Bandits", radioTargetName = "bandits" }) + engageSubPath = missionCommands.addSubMenu("Aircraft", rootPath) + missionCommands.addCommand("Fighters", engageSubPath, radioCommandEngage, { attributes = { "Fighters", "Interceptors", "Multirole fighters" }, category = Group.Category.AIRPLANE, radioMessageSuffix = "Bandits", radioTargetName = "fighters" }) + missionCommands.addCommand("Bombers and transports", engageSubPath, radioCommandEngage, { attributes = nil, category = Group.Category.AIRPLANE, radioMessageSuffix = "Bandits", radioTargetName = "strategic aircraft" }) + if not isWW2 then missionCommands.addCommand("Helicopters", engageSubPath, radioCommandEngage, { attributes = nil, category = Group.Category.HELICOPTER, radioMessageSuffix = "Bandits", radioTargetName = "helos" }) end + + -- Ground -- (radioTargetName must be singular) + missionCommands.addCommand("Any ground", engagePath, radioCommandEngage, { attributes = {"Tanks", "Trucks", "Artillery", "IFV", "APC"}, category = Group.Category.GROUND, radioMessageSuffix = "Ground", radioTargetName = "ground" }) + engageSubPath = missionCommands.addSubMenu("Ground", rootPath) + missionCommands.addCommand("Armor", engageSubPath, radioCommandEngage, { attributes = {"Tanks", "IFV", "APC"}, category = Group.Category.GROUND, radioMessageSuffix = "Ground", radioTargetName = "armor" }) + missionCommands.addCommand("Artillery", engageSubPath, radioCommandEngage, { attributes = {"Artillery"}, category = Group.Category.GROUND, radioMessageSuffix = "Ground", radioTargetName = "artillery" }) + missionCommands.addCommand("Trucks", engageSubPath, radioCommandEngage, { attributes = {"Trucks"}, category = Group.Category.GROUND, radioMessageSuffix = "Ground", radioTargetName = "unarmed" }) + + -- Air defense -- (radioTargetName must be singular) + missionCommands.addCommand("Any air defense", engagePath, radioCommandEngage, { attributes = { "Air Defence" }, category = Group.Category.GROUND, radioMessageSuffix = "AirDefense", radioTargetName = "air defense" }) + engageSubPath = missionCommands.addSubMenu("Air defense", rootPath) + missionCommands.addCommand("AAA", engageSubPath, radioCommandEngage, { attributes = { "AAA" }, category = Group.Category.GROUND, radioMessageSuffix = "AirDefense", radioTargetName = "AAA" }) + if not isWW2 then + missionCommands.addCommand("MANPADS", engageSubPath, radioCommandEngage, { attributes = { "SR SAM", "IR Guided SAM" }, category = Group.Category.GROUND, radioMessageSuffix = "AirDefense", radioTargetName = "MANPADS" }) + missionCommands.addCommand("Short range SAMs", engageSubPath, radioCommandEngage, { attributes = { "SR SAM", "IR Guided SAM" }, category = Group.Category.GROUND, radioMessageSuffix = "AirDefense", radioTargetName = "SHORAD" }) + missionCommands.addCommand("Long-range SAMs", engageSubPath, radioCommandEngage, { attributes = { "LR SAM", "MR SAM" }, category = Group.Category.GROUND, radioMessageSuffix = "AirDefense", radioTargetName = "HIMAD" }) + end + + -- Ships -- (radioTargetName must be plural) + missionCommands.addCommand("Any ship", engagePath, radioCommandEngage, { attributes = nil, category = Group.Category.SHIP, radioMessageSuffix = "Ships", radioTargetName = "ships" }) + engageSubPath = missionCommands.addSubMenu("Ships", rootPath) + missionCommands.addCommand("Armed ships", engageSubPath, radioCommandEngage, { attributes = { "Armed ships" }, category = Group.Category.SHIP, radioMessageSuffix = "Ships", radioTargetName = "armed ships" }) + missionCommands.addCommand("Cargo ships", engageSubPath, radioCommandEngage, { attributes = { "Unarmed ships" }, category = Group.Category.SHIP, radioMessageSuffix = "Ships", radioTargetName = "cargo ships" }) + ------------------------------------------------------ missionCommands.addCommand("Report contacts", rootPath, radioCommandReportContacts, nil) missionCommands.addCommand("Status", rootPath, radioCommandReportStatus, nil)