mirror of
https://github.com/akaAgar/the-universal-mission-for-dcs-world.git
synced 2025-11-25 19:31:01 +00:00
Added wingman callsign to radio messages
This commit is contained in:
parent
07cfaf527c
commit
38a78607d8
@ -71,37 +71,37 @@ Library.radioMessages = {
|
||||
pilotWarningSAMLaunch = { "Spike! SAM just launched, break!", "SAM up! Defensive now!", "Launch! SAM, coming fast, pump chaff, go cold!", "SAM in the air, break hard!", "SAM fired, visual smoke! Extend, extend!" },
|
||||
|
||||
pilotWingmanEngageBandits = {
|
||||
"Copy, engaging now.",
|
||||
"Tally one, pressing.",
|
||||
"Roger, comitting.",
|
||||
"Confirm, going after him.",
|
||||
"Affirm, moving in on bandits."
|
||||
"$1. Copy, engaging now.",
|
||||
"$1. Tally one, pressing.",
|
||||
"$1. Roger, comitting.",
|
||||
"$1. Confirm, going after him.",
|
||||
"$1. Affirm, moving in on bandits."
|
||||
},
|
||||
pilotWingmanEngageNoTarget = {
|
||||
"Negative tally, unable engage.",
|
||||
"Cannot comply, blind on target.",
|
||||
"No joy on targets, cannot proceed.",
|
||||
"Negative contact, unable to commit.",
|
||||
"That's a no, not seeing any targets."
|
||||
"$1. Negative tally, unable engage.",
|
||||
"$1. Cannot comply, blind on target.",
|
||||
"$1. No joy on targets, cannot proceed.",
|
||||
"$1. Negative contact, unable to commit.",
|
||||
"$1. That's a no, not seeing any targets."
|
||||
},
|
||||
pilotWingmanOrbit = {
|
||||
"Wilco, holding here.",
|
||||
"Copy, orbiting now.",
|
||||
"Roger, in the hold.",
|
||||
"Affirm, setting up the orbit.",
|
||||
"Orbiting at your pos."
|
||||
"$1. Wilco, holding here.",
|
||||
"$1. Copy, orbiting now.",
|
||||
"$1. Roger, in the hold.",
|
||||
"$1. Affirm, setting up the orbit.",
|
||||
"$1. Orbiting at your pos."
|
||||
},
|
||||
pilotWingmanRejoin = {
|
||||
"Off the perch, rejoining your side.",
|
||||
"Tally visual, coming to you.",
|
||||
"Clear, rejoining to route.",
|
||||
"Pushing up to formation.",
|
||||
"Visual, sliding back into position."
|
||||
"$1. Off the perch, rejoining your side.",
|
||||
"$1. Tally visual, coming to you.",
|
||||
"$1. Clear, rejoining to route.",
|
||||
"$1. Pushing up to formation.",
|
||||
"$1. Visual, sliding back into position."
|
||||
},
|
||||
pilotWingmanReportStatus = {
|
||||
"Flight, checking in.\n\n$1",
|
||||
"Flight, reporting.\n\n$1",
|
||||
"Flight, status report.\n\n$1",
|
||||
"$1. Checking in.\n\n$2",
|
||||
"$1. Reporting.\n\n$2",
|
||||
"$1. Status report.\n\n$2",
|
||||
},
|
||||
|
||||
atcSafeLanding = { "Be advised: $1 is wheels down at $2 and clear of runway.", "All aircraft, $1 has landed at $2 and vacated active. Runway is open for next inbound.", "Traffic, $1 is on deck at $2 and heading to parking. Runway clear.", "All flights, $1 just rolled out at $2 and cleared the active.", "Heads up, $1 landed at $2 and moving to the ramp. Runway available for next approach." },
|
||||
@ -220,34 +220,34 @@ Library.radioMessages = {
|
||||
"Command, pass coordinates for objective $1.",
|
||||
"Command, confirm grid on objective $1."
|
||||
},
|
||||
playerFlightEngageBandits = {
|
||||
"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."
|
||||
playerWingmanEngageBandits = {
|
||||
"$1, engage bandits.",
|
||||
"$1, you're cleared hot bandits.",
|
||||
"$1, commit on bandits when ready.",
|
||||
"$1, engage bandits, your discretion.",
|
||||
"$1, you're free to engage bandits."
|
||||
},
|
||||
playerFlightOrbit = {
|
||||
"Flight, orbit my position.",
|
||||
"Flight, set up an orbit on me.",
|
||||
"Flight, hold on me.",
|
||||
"Flight, anchor on my current pos.",
|
||||
"Flight, orbit overhead"
|
||||
playerWingmanOrbit = {
|
||||
"$1, orbit my position.",
|
||||
"$1, set up an orbit on me.",
|
||||
"$1, hold on me.",
|
||||
"$1, anchor on my current pos.",
|
||||
"$1, orbit overhead"
|
||||
},
|
||||
playerFlightRejoin =
|
||||
playerWingmanRejoin =
|
||||
{
|
||||
"Flight, rejoin my side",
|
||||
"Flight, push it up, rejoin formation.",
|
||||
"Flight, come back to route.",
|
||||
"Flight, tighten it up.",
|
||||
"Flight, rejoin tactical."
|
||||
"$1, rejoin my side",
|
||||
"$1, push it up, rejoin formation.",
|
||||
"$1, come back to route.",
|
||||
"$1, tighten it up.",
|
||||
"$1, rejoin tactical."
|
||||
},
|
||||
playerFlightReportStatus = {
|
||||
"Flight, confirm you're set.",
|
||||
"Flight, how are you looking?",
|
||||
"Flight, report in.",
|
||||
"Flight, status check.",
|
||||
"Flight, talk me through your state."
|
||||
playerWingmanReportStatus = {
|
||||
"$1, confirm you're set.",
|
||||
"$1, how are you looking?",
|
||||
"$1, report in.",
|
||||
"$1, status check.",
|
||||
"$1, talk me through your state."
|
||||
},
|
||||
playerJTACSmoke = {
|
||||
"$1, request smoke on objective $2, over.",
|
||||
|
||||
@ -26,10 +26,27 @@ do
|
||||
return wingmenGroup
|
||||
end
|
||||
|
||||
local function getWingmenCallsign()
|
||||
local wingmenGroup = getWingmenGroup()
|
||||
if not wingmenGroup then return "Wingmen" end
|
||||
return wingmenGroup:getUnit(1):getCallsign()
|
||||
local function getWingmanNumberAsWord(index)
|
||||
if not index then return "Flight" end
|
||||
|
||||
return DCSEx.string.toStringNumber(index + 1, true)
|
||||
end
|
||||
|
||||
local function getWingmanCallsign(wingmanIndex)
|
||||
if wingmanIndex then
|
||||
if wingmanIndex < 1 or wingmanIndex > #wingmenUnitID then return "Wingman" end
|
||||
|
||||
local wingmanUnit = DCSEx.world.getUnitByID(wingmenUnitID[wingmanIndex])
|
||||
if not wingmanUnit then return "Wingman" end
|
||||
return wingmanUnit:getCallsign()
|
||||
end
|
||||
|
||||
for i=1,#wingmenUnitID do
|
||||
local wingmanUnit = DCSEx.world.getUnitByID(wingmenUnitID[i])
|
||||
if wingmanUnit then return wingmanUnit:getCallsign() end
|
||||
end
|
||||
|
||||
return "Flight"
|
||||
end
|
||||
|
||||
local function isValidTarget(detectedTarget, attributes)
|
||||
@ -89,11 +106,11 @@ do
|
||||
if not player then return end
|
||||
|
||||
if orderID == TUM.supportWingmen.orderID.ORBIT then
|
||||
TUM.radio.playForAll("playerFlightOrbit", nil, player:getCallsign(), false)
|
||||
TUM.radio.playForAll("playerWingmanOrbit", nil, player:getCallsign(), false)
|
||||
elseif orderID == TUM.supportWingmen.orderID.REJOIN then
|
||||
TUM.radio.playForAll("playerFlightRejoin", nil, player:getCallsign(), false)
|
||||
TUM.radio.playForAll("playerWingmanRejoin", nil, player:getCallsign(), false)
|
||||
elseif orderID == TUM.supportWingmen.orderID.ENGAGE_BANDITS then
|
||||
TUM.radio.playForAll("playerFlightEngageBandits", nil, player:getCallsign(), false)
|
||||
TUM.radio.playForAll("playerWingmanEngageBandits", nil, player:getCallsign(), false)
|
||||
end
|
||||
|
||||
if not wingmenGroupID then return end
|
||||
@ -169,7 +186,7 @@ do
|
||||
local player = world:getPlayer()
|
||||
if not player then return end
|
||||
|
||||
TUM.radio.playForAll("playerFlightOrbit", nil, player:getCallsign(), false)
|
||||
TUM.radio.playForAll("playerWingmanOrbit", { getWingmanNumberAsWord(args.index) }, player:getCallsign(), false)
|
||||
|
||||
local wingmenCtrl = getWingmanController(args.index)
|
||||
if not wingmenCtrl then return end
|
||||
@ -183,14 +200,14 @@ do
|
||||
}
|
||||
}
|
||||
wingmenCtrl:setTask(taskTable)
|
||||
TUM.radio.playForAll("pilotWingmanOrbit", nil, getWingmenCallsign(), true)
|
||||
TUM.radio.playForAll("pilotWingmanOrbit", { getWingmanNumberAsWord(args.index) }, getWingmanCallsign(args.index), true)
|
||||
end
|
||||
|
||||
local function doWingmenCommandRejoin(args)
|
||||
local player = world:getPlayer()
|
||||
if not player then return end
|
||||
|
||||
TUM.radio.playForAll("playerFlightRejoin", nil, player:getCallsign(), false)
|
||||
TUM.radio.playForAll("playerWingmanRejoin", { getWingmanNumberAsWord(args.index) }, player:getCallsign(), false)
|
||||
|
||||
local wingmenCtrl = getWingmanController(args.index)
|
||||
if not wingmenCtrl then return end
|
||||
@ -205,11 +222,48 @@ do
|
||||
}
|
||||
}
|
||||
wingmenCtrl:setTask(taskTable)
|
||||
TUM.radio.playForAll("pilotWingmanRejoin", nil, getWingmenCallsign(), true)
|
||||
TUM.radio.playForAll("pilotWingmanRejoin", { getWingmanNumberAsWord(args.index) }, getWingmanCallsign(args.index), true)
|
||||
end
|
||||
|
||||
local function doWingmenCommandEngage(args)
|
||||
-- , { index = wingmanIndex, attributes = { "Battle airplanes" }, range = 60 }
|
||||
local player = world:getPlayer()
|
||||
if not player then return end
|
||||
|
||||
if args.radioSuffix then
|
||||
TUM.radio.playForAll("playerWingmanEngage"..args.radioSuffix, { getWingmanNumberAsWord(args.index) }, player:getCallsign(), false)
|
||||
end
|
||||
|
||||
local wingmenCtrl = getWingmanController(args.index)
|
||||
if not wingmenCtrl then return end
|
||||
|
||||
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)
|
||||
return
|
||||
end
|
||||
|
||||
local taskTable = {
|
||||
id = "AttackGroup",
|
||||
params = {
|
||||
groupId = DCSEx.dcs.getObjectIDAsNumber(targetGroup),
|
||||
}
|
||||
}
|
||||
wingmenCtrl:setTask(taskTable)
|
||||
|
||||
-- Rejoin back once bandit has been shot down
|
||||
local rejoinBackTable = {
|
||||
id = "Follow",
|
||||
params = {
|
||||
groupId = DCSEx.dcs.getObjectIDAsNumber(player:getGroup()),
|
||||
pos = { x = -100, y = 0, z = -100 },
|
||||
lastWptIndexFlag = false,
|
||||
lastWptIndex = -1
|
||||
}
|
||||
}
|
||||
wingmenCtrl:pushTask(rejoinBackTable)
|
||||
if args.radioSuffix then
|
||||
TUM.radio.playForAll("pilotWingmanEngage"..args.radioSuffix, { getWingmanNumberAsWord(args.index) }, getWingmanCallsign(args.index), true)
|
||||
end
|
||||
end
|
||||
|
||||
local function doWingmenCommandReportTargets(attributes)
|
||||
@ -232,7 +286,7 @@ do
|
||||
if not player then return end
|
||||
|
||||
if not args.noPlayerMessage then
|
||||
TUM.radio.playForAll("playerFlightReportStatus", nil, player:getCallsign(), false)
|
||||
TUM.radio.playForAll("playerWingmanReportStatus", { getWingmanNumberAsWord(args.index) }, player:getCallsign(), false)
|
||||
end
|
||||
local wingmenGroup = getWingmenGroup()
|
||||
if not wingmenGroup then return end
|
||||
@ -242,11 +296,11 @@ do
|
||||
for i,u in ipairs(wingmenGroup:getUnits()) do
|
||||
if not args.index or args.index == i then
|
||||
atLeastOneUnit = true
|
||||
statusMsg = statusMsg..u:getCallsign():upper()
|
||||
if not args.index then statusMsg = statusMsg..u:getCallsign():upper().."\n" end
|
||||
if u:getLife() >= u:getLife0() then
|
||||
statusMsg = statusMsg.."\n- No damage sustained"
|
||||
statusMsg = statusMsg.."- No damage sustained, fuel green"
|
||||
else
|
||||
statusMsg = statusMsg.."\n- Aircraft suffered damage"
|
||||
statusMsg = statusMsg.."- Aircraft suffered damage, fuel green"
|
||||
end
|
||||
statusMsg = statusMsg.."\n- BRAA from you: "..DCSEx.dcs.getBRAA(u:getPoint(), DCSEx.math.vec3ToVec2(player:getPoint()), true)
|
||||
statusMsg = statusMsg.."\n- Armament: "
|
||||
@ -273,7 +327,7 @@ do
|
||||
statusMsg = statusMsg:sub(1, #statusMsg - 2)
|
||||
end
|
||||
|
||||
TUM.radio.playForAll("pilotWingmanReportStatus", { statusMsg }, getWingmenCallsign(), not args.noPlayerMessage)
|
||||
TUM.radio.playForAll("pilotWingmanReportStatus", { getWingmanNumberAsWord(args.index), statusMsg }, getWingmanCallsign(args.index), not args.noPlayerMessage)
|
||||
end
|
||||
|
||||
local function createWingmen()
|
||||
@ -325,7 +379,7 @@ do
|
||||
wingmenUnitID = DCSEx.table.deepCopy(groupInfo.unitsID)
|
||||
|
||||
TUM.log("Spawned AI wingmen")
|
||||
TUM.radio.playForAll("pilotWingmanRejoin", nil, getWingmenCallsign(), true)
|
||||
TUM.radio.playForAll("pilotWingmanRejoin", nil, getWingmanCallsign(), true)
|
||||
end
|
||||
|
||||
function TUM.supportWingmen.removeAll()
|
||||
@ -341,17 +395,12 @@ do
|
||||
end
|
||||
|
||||
local function createWingmanSubMenu(rootPath, wingmanIndex)
|
||||
local wingmanName = "Flight"
|
||||
if wingmanIndex then
|
||||
wingmanName = DCSEx.string.toStringNumber(wingmanIndex + 1, true)
|
||||
end
|
||||
|
||||
local wingmanPath = missionCommands.addSubMenu(wingmanName, rootPath)
|
||||
local wingmanPath = missionCommands.addSubMenu(getWingmanNumberAsWord(wingmanIndex), rootPath)
|
||||
|
||||
-- missionCommands.addCommand("Engage bandits", wingmanPath, doWingmenOrder, TUM.supportWingmen.orderID.ENGAGE_BANDITS)
|
||||
-- missionCommands.addCommand("Engage air defense", wingmanPath, doWingmenOrder, TUM.supportWingmen.orderID.ENGAGE_BANDITS)
|
||||
-- missionCommands.addCommand("Engage ground targets", wingmanPath, doWingmenOrder, TUM.supportWingmen.orderID.ENGAGE_BANDITS)
|
||||
missionCommands.addCommand("Engage bandits", wingmanPath, doWingmenCommandEngage, { index = wingmanIndex, attributes = { "Battle airplanes" }, range = 60 })
|
||||
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 })
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user