FlightOfTheBumble Posted October 26, 2024 Posted October 26, 2024 Hi Folks, I am looking for a non-MIST/MOOSE solution to showing current carrier info via F10 radio menu for pilots. The info I require is current BRC/FB/QNH (we sometimes have the boat change direction/etc.). I have tried a few things in the trigger menu using DO SCRIPT but I haven't had any luck. My wing uses the super-carrier, primarily the Truman. We are looking to lessen radio chatter, so calling into the boat with/using AI is out, along with lessening pilot queries on PRI. In addition, it is rare to have an LSO/Tower person available all the time. Any pointers, greatly appreciated - thanks.
cfrag Posted October 26, 2024 Posted October 26, 2024 (edited) 6 hours ago, FlightOfTheBumble said: I am looking for a non-MIST/MOOSE solution to showing current carrier info via F10 radio menu for pilots. I believe that you should be more specific what you are looking for. Below please find a script that I think does what you are asking for. The fact that I was able to throw it together while waiting for my toast tells me that you are after something with more finesse -- so let's hear it. 6 hours ago, FlightOfTheBumble said: I have tried a few things in the trigger menu using DO SCRIPT but I haven't had any luck. That is probably because DCS is excessively recalcitrant when you try to script radio messages - it suppresses all errors, and does not tell you. Look at how the script steps out of that context to enable debugging. Here's the entire script ci = {} -- carrier meths function ci.isShip(theBase, carrierOnly) local desc = theBase:getDesc() local cat = desc.category if carrierOnly and cat == 2 then local theUnit = theBase:getUnit() return theUnit:hasAttribute("AircraftCarrier") end return cat == 2 end function ci.getCarrierInfo(theBase) local theUnit = theBase:getUnit() local msg = theUnit:getName() .. ":\n" -- calc heading local pos = theUnit:getPosition() local heading = math.atan2(pos.x.z, pos.x.x) -- make sure positive only, add 360 degrees if heading < 0 then heading = heading + 2 * math.pi end msg = msg .. "Expect " .. math.floor(heading * 57.2958) .. " BRC." -- other stuff here return msg end -- comms response function ci.getCI(args) timer.scheduleFunction(ci.doGetCI, args, timer.getTime() + 0.1) -- step out of current context end function ci.doGetCI(args) local allYourBase = world.getAirbases() -- get all local msg = "Carriers:\n" for idx, theBase in pairs(allYourBase) do if ci.isShip(theBase, true) then msg = msg .. ci.getCarrierInfo(theBase) .. "\n" end end trigger.action.outText(msg, 30) end -- set up function ci.start() -- install menu for all missionCommands.addCommand("Get Carrier Info", nil, ci.getCI, nil) end -- go! ci.start() And below the miz (pop quiz: can you identify which 'Carrie' the miz refers to? Hint: it's not the King Novel/De Palma movie). carrie.miz Edited October 26, 2024 by cfrag
Recommended Posts