Added "cover me!" and additional "engage target" wingman commands

This commit is contained in:
Ambroise Garel 2025-07-26 11:41:34 +02:00
parent 65e1c72824
commit 32d009b959
2 changed files with 90 additions and 44 deletions

View File

@ -278,36 +278,38 @@ Library.radioMessages = {
"Command, confirm grid on objective $1." "Command, confirm grid on objective $1."
}, },
playerWingmanEngageAirDefense = { playerWingmanEngageAirDefense = {
"Flight, prioritize air defense, engage now.", "Flight, prioritize $1, engage now.",
"Flight, take down air defense systems.", "Flight, take down $1 systems.",
"Flight, suppress air defense threats.", "Flight, suppress $1 threats.",
"Flight, air defense is yours, take it out.", "Flight, $1 is yours, take it out.",
"Flight, eliminate air defense positions." "Flight, eliminate $1 positions."
}, }, -- "$1" should be "air defense" in audio version
playerWingmanEngageBandits = { playerWingmanEngageBandits = {
"Flight, engage bandits.", "Flight, engage $1.",
"Flight, you're cleared hot bandits.", "Flight, you're cleared hot on $1.",
"Flight, commit on bandits when ready.", "Flight, commit on $1 when ready.",
"Flight, engage bandits, your discretion.", "Flight, engage $1, your discretion.",
"Flight, you're free to engage bandits." "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 = { playerWingmanEngageGround = {
"Flight, engage ground targets.", "Flight, engage $1 targets.",
"Flight, prosecute ground targets ahead.", "Flight, prosecute $1 targets ahead.",
"Flight, engage all ground contacts.", "Flight, engage all $1 contacts.",
"Flight, strike vehicle positions.", "Flight, strike $1 positions.",
"Flight, take the lead on ground targets.", "Flight, take the lead on $1 targets.",
}, }, -- "$1" should be "ground" in audio version
playerWingmanEngageHelicopters = {
"Flight, you're cleared to prosecute helos.",
"Flight, engage helos at your discretion.",
"Flight, engage rotary contacts, break when done.",
},
playerWingmanEngageShips = { playerWingmanEngageShips = {
"Flight, engage enemy vessels now.", "Flight, engage enemy $1 now.",
"Flight, strike ships in your sector.", "Flight, strike $1 in your sector.",
"Flight, take the lead on sea targets.", "Flight, take the lead on enemy $1.",
}, }, -- "$1" should be "ships" in audio version
playerWingmanGoToMarker = { playerWingmanGoToMarker = {
"Flight, proceed to waypoint.", "Flight, proceed to waypoint.",
"Flight, push to the hold point now.", "Flight, push to the hold point now.",

View File

@ -6,30 +6,25 @@
TUM.wingmenMenu = {} TUM.wingmenMenu = {}
do do
local function radioCommandReportContacts() local function radioCommandCoverMe(args)
local player = world:getPlayer() local player = world:getPlayer()
if not player then return false end if not player then return end
TUM.radio.playForAll("playerWingmanReportContacts", nil, player:getCallsign(), false)
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 end
local function radioCommandEngage(args) local function radioCommandEngage(args)
local player = world:getPlayer() local player = world:getPlayer()
if not player then return end 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) TUM.wingmenTasking.commandEngage(args.category, args.attributes, true)
end 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 function radioCommandGoToMapMarker()
local player = world:getPlayer() local player = world:getPlayer()
if not player then return end if not player then return end
@ -54,18 +49,67 @@ do
TUM.wingmenTasking.commandRejoin(nil, true) TUM.wingmenTasking.commandRejoin(nil, true)
end 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() function TUM.wingmenMenu.create()
if TUM.settings.getValue(TUM.settings.id.MULTIPLAYER) then return end -- No wingmen in multiplayer if TUM.settings.getValue(TUM.settings.id.MULTIPLAYER) then return end -- No wingmen in multiplayer
-- TODO: if WINGMEN_COUNT == 0 then return end -- TODO: if WINGMEN_COUNT == 0 then return end
local rootPath = missionCommands.addSubMenu("✈ Flight") 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) local engagePath = missionCommands.addSubMenu("Engage", rootPath)
missionCommands.addCommand("Bandits", engagePath, radioCommandEngage, { attributes = nil, category = Group.Category.HELICOPTER, radioMessageSuffix = "Bandits" }) local engageSubPath = nil
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" }) -- Aircraft -- (radioTargetName must be plural)
missionCommands.addCommand("Ground targets", engagePath, radioCommandEngage, { attributes = {"Tanks", "Trucks", "Artillery", "IFV", "APC"}, category = Group.Category.GROUND, radioMessageSuffix = "Ground" }) missionCommands.addCommand("Any aircraft", engagePath, radioCommandEngage, { attributes = nil, category = Group.Category.AIRPLANE, radioMessageSuffix = "Bandits", radioTargetName = "bandits" })
missionCommands.addCommand("Ships", engagePath, radioCommandEngage, { attributes = nil, category = Group.Category.SHIP, radioMessageSuffix = "Ships" }) 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("Report contacts", rootPath, radioCommandReportContacts, nil)
missionCommands.addCommand("Status", rootPath, radioCommandReportStatus, nil) missionCommands.addCommand("Status", rootPath, radioCommandReportStatus, nil)