Long shot here. I know you can manually program the screens when you get in the aircraft, but looking at ways to automate. With a bit of help from ChatGPT i created the script below to go in my saved games export.lua script. I need to know what codes to use for the MFD's.
In the example I'm trying to make it so (when in the front seat);
Air-to-Air Mode:
Left MFD: Air-to-Air Radar
Right MFD: TEWS
Center MFD: HSI page
Air-to-Ground Mode:
Left MFD: TGP (Targeting Pod)
Right MFD: Air-to-Ground Radar
Center MFD: ARMT page
Does anyone have any suggestions on how to get this to work or another easier alternative ? It would be great if one day Razbam or ED made it so you could change this without having to do it in the jet everytime.
local function switch_mfd_layout(mode)
-- Air-to-Air Mode Layout
if mode == "A/A" then
-- Left MFD to Air-to-Air Radar
LoSetCommand(3001) -- Example command for left MFD to Radar
-- Right MFD to TEWS
LoSetCommand(3002) -- Example command for right MFD to TEWS
-- Center MFD to HSI
LoSetCommand(3003) -- Example command for center MFD to HSI
-- Air-to-Ground Mode Layout
elseif mode == "A/G" then
-- Left MFD to TGP (Targeting Pod)
LoSetCommand(3004) -- Example command for left MFD to TGP
-- Right MFD to Air-to-Ground Radar
LoSetCommand(3005) -- Example command for right MFD to A/G Radar
-- Center MFD to ARMT
LoSetCommand(3006) -- Example command for center MFD to ARMT
end
end
-- Function to check master mode and switch displays accordingly
DCS.setUserCallbacks({
onSimulationFrame = function()
local master_mode = LoGetMCPState() -- Get Master Mode state
if master_mode == 0 then -- A/A Mode
switch_mfd_layout("A/A")
elseif master_mode == 1 then -- A/G Mode
switch_mfd_layout("A/G")
end
end
})
f153changeMFDs.lua