Added "go to map marker" wingman command

This commit is contained in:
Ambroise Garel 2025-07-25 10:25:07 +02:00
parent 59dbe9f3a0
commit f05b534aa8
2 changed files with 64 additions and 8 deletions

View File

@ -84,12 +84,26 @@ Library.radioMessages = {
"$1. Negative contact, unable to commit.",
"$1. That's a no, not seeing any targets."
},
pilotWingmanGoToMarker = {
"$1, copy. Pushing to waypoint now.",
"$1, on route to the coords, maintaining current alt.",
"$1, proceeding as briefed, on my way.",
"$1, moving to grid as planned.",
"$1's off, heading to the point."
},
pilotWingmanGoToMarkerNoMarker = {
"$1, negative on coords, say again?",
"$1. Copy, but I dont have the point. Confirm?",
"$1, missing the grid, need the mark.",
"$1 blind on the coordinates, request update.",
"$1 can't push, no steerpoint."
},
pilotWingmanOrbit = {
"$1. Wilco, holding here.",
"$1. Copy, orbiting now.",
"$1. Roger, in the hold.",
"$1. Affirm, setting up the orbit.",
"$1. Orbiting at your pos."
"$1. Orbiting at pos."
},
pilotWingmanRejoin = {
"$1. Off the perch, rejoining your side.",
@ -227,9 +241,16 @@ Library.radioMessages = {
"$1, engage bandits, your discretion.",
"$1, you're free to engage bandits."
},
playerWingmanGoToMarker = {
"$1, proceed to waypoint.",
"$1, push to the hold point now.",
"$1, push to station and hold.",
"$1, set up in the assigned area.",
"$1, move to designated steerpoint."
},
playerWingmanOrbit = {
"$1, orbit my position.",
"$1, set up an orbit on me.",
"$1, orbit your position.",
"$1, set up an orbit.",
"$1, hold on me.",
"$1, anchor on my current pos.",
"$1, orbit overhead"

View File

@ -191,12 +191,20 @@ do
local wingmenCtrl = getWingmanController(args.index)
if not wingmenCtrl then return end
local point = nil
if args.index then
point = DCSEx.math.vec3ToVec2(DCSEx.world.getUnitByID(wingmenUnitID[args.index]):getPoint())
else
point = DCSEx.world.getGroupCenter(getWingmenGroup())
end
local taskTable = {
id = "Orbit",
params = {
pattern = "Circle",
point = DCSEx.math.vec3ToVec2(player:getPoint()),
altitude = player:getPoint().y
point = point,
-- altitude = player:getPoint().y
}
}
wingmenCtrl:setTask(taskTable)
@ -238,7 +246,7 @@ do
local targets = getDetectedTargets(args.index, args.attributes, args.maxRange)
if not targets or #targets == 0 then
TUM.radio.playForAll("pilotWingmanEngageNoTarget", nil, getWingmanCallsign(args.index), true)
TUM.radio.playForAll("pilotWingmanEngageNoTarget", { getWingmanNumberAsWord(args.index) }, getWingmanCallsign(args.index), true)
return
end
@ -379,7 +387,33 @@ do
wingmenUnitID = DCSEx.table.deepCopy(groupInfo.unitsID)
TUM.log("Spawned AI wingmen")
TUM.radio.playForAll("pilotWingmanRejoin", nil, getWingmanCallsign(), true)
TUM.radio.playForAll("pilotWingmanRejoin", { getWingmanNumberAsWord() }, getWingmanCallsign(), true)
end
local function doWingmenCommandGoToMapMarker(args)
local player = world:getPlayer()
if not player then return end
TUM.radio.playForAll("playerWingmanGoToMarker", { getWingmanNumberAsWord(args.index) }, player:getCallsign(), false)
local wingmenCtrl = getWingmanController(args.index)
if not wingmenCtrl then return end
local mapMarker = DCSEx.world.getMarkerByText("wingman")
if not mapMarker then
TUM.radio.playForAll("pilotWingmanGoToMarkerNoMarker", { getWingmanNumberAsWord(args.index) }, getWingmanCallsign(args.index), true)
return
end
local taskTable = {
id = "Orbit",
params = {
pattern = "Circle",
point = DCSEx.math.vec3ToVec2(mapMarker.pos),
}
}
wingmenCtrl:setTask(taskTable)
TUM.radio.playForAll("pilotWingmanGoToMarker", { getWingmanNumberAsWord(args.index) }, getWingmanCallsign(args.index), true)
end
function TUM.supportWingmen.removeAll()
@ -403,7 +437,8 @@ do
missionCommands.addCommand("Engage bandits", wingmanPath, doWingmenCommandEngage, { index = wingmanIndex, attributes = { "Battle airplanes" }, maxRange = 60, radioSuffix = "Bandits" })
missionCommands.addCommand("Report targets", wingmanPath, doWingmenCommandReportTargets, { index = wingmanIndex })
missionCommands.addCommand("Report status", wingmanPath, doWingmenCommandReportStatus, { index = wingmanIndex, noPlayerMessage = false } )
missionCommands.addCommand("Orbit", wingmanPath, doWingmenCommandOrbit, { index = wingmanIndex })
missionCommands.addCommand("Go to map marker WINGMAN", wingmanPath, doWingmenCommandGoToMapMarker, { index = wingmanIndex } )
missionCommands.addCommand("Orbit at position", wingmanPath, doWingmenCommandOrbit, { index = wingmanIndex })
missionCommands.addCommand("Rejoin", wingmanPath, doWingmenCommandRejoin, { index = wingmanIndex })
end