Scarecrow Posted January 4, 2015 Posted January 4, 2015 Hoping one of you fine folks has some experience with the Ka50 export as it seems to differ from the newer aircraft. I have a G940 which has a 3 colour LED under the throttle buttons. There is a program available for the G940 to recieve export data from DCS world. This works fine for the Huey but I can't get data out of the Ka50. Below is my export.lua . Any help on how to get comparable data out of the Shark would be very appreciated. function ProcessHueyGameLogic(t) local MainPanel = GetDevice(0) if MainPanel ~= 0 then -- Uncomment if you want the leds to update while outside of the cockpit -- MainPanel:update_arguments() -- Gather switch / lamp data local gov_emerg = MainPanel:get_argument_value(100) -- Lamp 0 or 1 local wpn_armed = MainPanel:get_argument_value(254) -- Lamp 0 or 0.9 local wpn_safe = MainPanel:get_argument_value(255) -- Lamp 0 or 0.9 local wpn_selector = MainPanel:get_argument_value(256) -- Switch -1 or 0 local master_caution = MainPanel:get_argument_value(277) -- Lamp 0 or 1 local flare_armed = MainPanel:get_argument_value(458) -- Lamp 0 or 1 local anti_coll = MainPanel:get_argument_value(225) -- Lamp 0 or 1 local nav_lights = MainPanel:get_argument_value(223) -- Switch -1 or 0 or 0.9 ? local flare_disp = MainPanel:get_argument_value(464) -- Lamp 0 or 1 -- First, reset all to OFF SetAllLed(OFF) -- Now apply data to Leds SetLedC(1, GREEN, wpn_safe > 0.5) SetLedC(1, RED, wpn_armed > 0.5) SetLedC(5, AMBER, gov_emerg > 0.5) SetLedC(5, GREEN, gov_emerg < 0.5) -- Flare Logic if flare_armed > 0.5 then if flare_disp >0.5 then SetLed(3, RED) else SetLed(3, GREEN) end end -- Some blink logic for master caution if master_caution > 0.5 then local int, fract = math.modf(t) if fract >= 0.5 then SetLed(6, AMBER) end else SetLed(6, GREEN) end -- Navigation Light Switch Logic if nav_lights < 0.0 then SetLed(8, AMBER) else if nav_lights > 0.5 then SetLed(8, RED) else SetLed(8, GREEN) end end -- Anticollion Switch Logic if anti_coll < 0.5 then SetLed(4, GREEN) else local int, fract = math.modf(t) if fract >= 0.5 then SetLed(4, RED) end end -- Special handling for 7.62mm and rocket selector: -- We only light buttons, if wpn_armed is set if wpn_armed > 0.5 then if wpn_selector >= 0 then SetLed(2, AMBER) else SetLed(2, GREEN) end end end end This is function that handles the Huey data, it works fine. The KA50 does not work, I've checked clickabledata.lua and 330 for bankhold is correct but there is no value coming out:cry: function ProcessSharkGameLogic(t) local Mainpanel = GetDevice(0) if MainPanel ~= 0 then -- Lit button returns 0.1 when active. 0.2 when depressed but not active. 0.3 when depressed and active -- Indicators returns between 0.0 to 1.0, mostly only 0.0 and 1.0 but for example gear_handle moves between them -- Indicators with continous values are marked as such) -- Auto-pilot buttons and switches local bankhold = MainPanel:get_argument_value(330) -- Lit button -- First, reset all to OFF SetAllLed(OFF) -- Now apply data to Leds SetLedC(4, GREEN, bankhold > 0.0) end end I've attached the whole thing at the bottom just in case:)Export.lua
Gadroc Posted January 4, 2015 Posted January 4, 2015 I believe you need to call update_arguments on MainPanel before pulling out values.
Scarecrow Posted January 4, 2015 Author Posted January 4, 2015 Thank you for the reply Gadroc:) It was actually an issue of case sensitivity in that Mainpanel is defined but MainPanel is called. Issue is solved now thanks:)
Recommended Posts