Mission Objectives tend to fill up the F10 Menu
Closed this issue · 1 comments
BR Version: x.x.x () DCS Version: x.x.x
Brief Description:
Too many Mission Objectives make the F10 menu unusable.
I have several other scripts running: CTLD, CSAR, DSMC, JTAC. With this, having more than 4 objectives would saturate the F10 menu and make the whole thing difficult to use (e.g. CTLD would end up at place 12, preventing F12 from closing the radio menu / having an erratic behavior)
Expected:
Nothing really, that's the way BR is programmed. I would find it easier though if all Mission Objectives would be under their own SubMenu under F10 -> MissionOBJs or something to that effect. This will make the F10 menu more manageable.
So maybe amend the way BR populates the F10 menu with objectives? It's an extra click of the mouse or an extra F-button press but it'll make it possible to deal with multi objective missions.
Mission and Template Zip:
Not uploading, I'll paste my amended code below.
Mission modified: Y/N
Y but I have modified the script. the modded script looks like this
-- ===================================================================================
-- 3.2 - COMMON F10 MENU
-- ===================================================================================
-- Mission F10 menu hierarchy
briefingRoom.f10Menu = { }
briefingRoom.f10Menu.objectives = { }
-- Mission F10 menu functions
briefingRoom.f10MenuCommands = { }
briefingRoom.f10MenuCommands.missionFeatures = { }
-- Mission status menu
function briefingRoom.f10MenuCommands.missionStatus()
local msnStatus = ""
local msnSound = ""
if briefingRoom.mission.complete then
msnStatus = "Command: Mission complete, you may return to base.\n\n"
msnSound = "RadioHQMissionStatusComplete"
else
msnStatus = "Command: Mission is still in progress.\n\n"
msnSound = "RadioHQMissionStatusInProgress"
end
for i,o in ipairs(briefingRoom.mission.objectives) do
if o.complete then
msnStatus = msnStatus..(o.failed and "[/]" or "[X]")
else
msnStatus = msnStatus.."[ ]"
end
local objectiveProgress = ""
if o.unitsCount > 0 and o.hideTargetCount ~= true then
local targetsDone = math.max(0, o.unitsCount - #o.unitNames)
objectiveProgress = " ("..tostring(targetsDone).."/"..tostring(o.unitsCount)..")"
end
msnStatus = msnStatus.." "..o.task..objectiveProgress.."\n"
end
briefingRoom.radioManager.play("Pilot: Command, require update on mission status.", "RadioPilotMissionStatus")
briefingRoom.radioManager.play(msnStatus, msnSound, briefingRoom.radioManager.getAnswerDelay())
end
function briefingRoom.f10MenuCommands.getWaypointCoordinates(index)
local cooMessage = dcsExtensions.vec2ToStringCoordinates(briefingRoom.mission.objectives[index].waypoint)
briefingRoom.radioManager.play("Pilot: Command, request confirmation of waypoint "..briefingRoom.mission.objectives[index].name.." coordinates.", "RadioPilotWaypointCoordinates")
briefingRoom.radioManager.play("Command: Acknowledged, transmitting waypoint "..briefingRoom.mission.objectives[index].name.." coordinates.\n\n"..cooMessage, "RadioHQWaypointCoordinates", briefingRoom.radioManager.getAnswerDelay())
missionCommands.removeItemForCoalition(briefingRoom.playerCoalition, briefingRoom.mission.objectives[index].waypointRadioCommand)
briefingRoom.mission.objectives[index].waypointRadioCommand = missionCommands.addCommandForCoalition(briefingRoom.playerCoalition, "Waypoint coordinates:\n"..cooMessage, briefingRoom.f10Menu.objectives[index], briefingRoom.f10MenuCommands.getWaypointCoordinates, index)
end
function briefingRoom.f10MenuCommands.endMission ()
trigger.action.setUserFlag("BR_END_MISSION_NOW", true)
end
-- Common mission menu (mission status and mission features)
briefingRoom.f10Menu.missionMenu = missionCommands.addSubMenuForCoalition(briefingRoom.playerCoalition, "Mission", nil)
missionCommands.addCommandForCoalition(briefingRoom.playerCoalition, "Mission Status", briefingRoom.f10Menu.missionMenu, briefingRoom.f10MenuCommands.missionStatus, nil)
-- ===================================================================================
-- 3.3 - OBJECTIVES TABLES (generated by BriefingRoom)
-- ===================================================================================
briefingRoom.mission.objectives = { } -- Main objective table
briefingRoom.mission.objectives[1] = { complete = false, failed = false, groupName = "27th Armored infantry division-TGT-GENUS", hideTargetCount = false, name = "GENUS", targetCategory = Unit.Category.GROUND_UNIT, taskType = "DestroyAll", task = "Destroy all APCs designated objective GENUS.", unitsCount = #dcsExtensions.getUnitNamesByGroupNameSuffix("-TGT-GENUS"), unitNames = dcsExtensions.getUnitNamesByGroupNameSuffix("-TGT-GENUS") }
--briefingRoom.f10Menu.objectives[1] = missionCommands.addSubMenuForCoalition(coalition.side.BLUE, "Objective GENUS", nil)
briefingRoom.mission.objectives[2] = { complete = false, failed = false, groupName = "134th Infantry regiment-TGT-FETCH", hideTargetCount = false, name = "FETCH", targetCategory = Unit.Category.GROUND_UNIT, taskType = "ExtractTroops", task = "Rescue Troops under attack from waypoint FETCH Pickup and transport to designated objective FETCH.", unitsCount = #dcsExtensions.getUnitNamesByGroupNameSuffix("-TGT-FETCH"), unitNames = dcsExtensions.getUnitNamesByGroupNameSuffix("-TGT-FETCH") }
--briefingRoom.f10Menu.objectives[2] = missionCommands.addSubMenuForCoalition(coalition.side.BLUE, "Objective FETCH", nil)
briefingRoom.mission.objectives[3] = { complete = false, failed = false, groupName = "208th Fire support task force-TGT-HALL", hideTargetCount = false, name = "HALL", targetCategory = Unit.Category.GROUND_UNIT, taskType = "DestroyAll", task = "Destroy all artillery designated objective HALL.", unitsCount = #dcsExtensions.getUnitNamesByGroupNameSuffix("-TGT-HALL"), unitNames = dcsExtensions.getUnitNamesByGroupNameSuffix("-TGT-HALL") }
--briefingRoom.f10Menu.objectives[3] = missionCommands.addSubMenuForCoalition(coalition.side.BLUE, "Objective HALL", nil)
briefingRoom.mission.objectives[4] = { complete = false, failed = false, groupName = "242nd Artillery corps-TGT-HARD", hideTargetCount = false, name = "HARD", targetCategory = Unit.Category.GROUND_UNIT, taskType = "SupportAttack", task = "Support an attack on artillery designated objective HARD.", unitsCount = #dcsExtensions.getUnitNamesByGroupNameSuffix("-TGT-HARD"), unitNames = dcsExtensions.getUnitNamesByGroupNameSuffix("-TGT-HARD") }
--briefingRoom.f10Menu.objectives[4] = missionCommands.addSubMenuForCoalition(coalition.side.BLUE, "Objective HARD", nil)
briefingRoom.mission.objectives[1].waypoint = { ["x"] = -85996.250237088, ["y"] = 38365.415835355 }
briefingRoom.mission.objectives[2].waypoint = { ["x"] = -199866.359375, ["y"] = -35206.71484375 }
briefingRoom.mission.objectives[3].waypoint = { ["x"] = -202236.7077942, ["y"] = -35609.300637164 }
briefingRoom.mission.objectives[4].waypoint = { ["x"] = -99004.066671346, ["y"] = 9569.822810981 }
-- Add "Mission OBJs" top-level menu
briefingRoom.f10Menu.missionObjectivesMenu = missionCommands.addSubMenuForCoalition(briefingRoom.playerCoalition, "Mission OBJs", briefingRoom.f10Menu--[[.missionMenu--]])
-- Add Objective menus under "Mission OBJs"
for i=1, #briefingRoom.mission.objectives do
briefingRoom.f10Menu.objectives[i] = missionCommands.addSubMenuForCoalition(coalition.side.BLUE, briefingRoom.mission.objectives[i].name, briefingRoom.f10Menu.missionObjectivesMenu)
end
-- Assign waypoint radio commands for each objective
for i=1, #briefingRoom.mission.objectives do
briefingRoom.mission.objectives[i].waypointRadioCommand = missionCommands.addCommandForCoalition(briefingRoom.playerCoalition, "Request waypoint coordinates", briefingRoom.f10Menu.objectives[i], briefingRoom.f10MenuCommands.getWaypointCoordinates, i)
end
I'm keeping this open but tbh it's EDs issue. They need to implement a way of natively having more options than 10.