Jump to content

bones1014

Members
  • Posts

    648
  • Joined

  • Last visited

Everything posted by bones1014

  1. Oh ok. I don't mind pointers. spaghetti code is bad and wastes time! If there's ever a better way to do something let me know. Coding can be tough.
  2. The color change and the Arm vs Safe line is based on that light above the counter in the cockpit. It turns off while the gun is firing.
  3. I guess I'm not sure what's going on. Try this Lua. I added Bailey's HSI code to it and it's all working together. Great stuff! Mi-8MT.lua
  4. The only way I got the A-4 to show up was changing the install directory to point at the saved games location. The A-4 folder appeared but there were no contents.
  5. I have the clickables exported and a lua started but I can't get the stream deck to recognize the A-4 mod. how did you get the UH-60 to appear when you open the ID lookup?
  6. Isn't that UH-60 a mod? How did you get it working with the stream deck script? It would be nice to get one working for the A-4 mod. did you just copy/paste the Lua? I used the DCS Interface: Incremental Input (Text Above) buttons for the gun counters.
  7. I looked at that already. both elements rotate separately. there isn't a set frame of reference between the needle and the rotating number dial. I have no idea how to do that one.
  8. can you share a screenshot of the device you're asking about?
  9. I created individual button ammo counters for the Mi-8 grenade and gun pods 1004 is the 7.62mm ammo. I use ID 586 to change the background from black to red to show armed state 1005 is the 12.7mm ammo. I use ID 587 to change the background from black to red to show armed state 1006 is the grenade ammo. I use ID 588 to change the background from black to red to show armed state Here's how they work. I fixed the error. If you didn't notice the error don't worry about it. Mi-8MT.lua
  10. I think I used the key combo alt+167 or something.
  11. Yep I see that weird symbol now. It's supposed to be a degree symbol after the drift angle. You can change it to what you want in the Lua Sent from my SM-G781U using Tapatalk
  12. No problem. It's fun to do once you see stuff working. I'm not sure what that character is either. I don't see it anywhere except your quotes. Maybe it's the degree symbol translated to something else. [emoji2371]. The gun counters are challenging. I currently have them on 2 buttons each right now and they work without any Lua code. Trying to translate it. Sent from my SM-G781U using Tapatalk
  13. I think I have what you want. 1003 = ground speed and drift angle 1000 = DISS-15 Drift Angle Readout 1001 = DISS-15 Flight Path Readout 1002 = Desired Course Let me know how it works for you. I'm gonna work on the gun pod counters next. Mi-8MT.lua
  14. Bailey is the real champ. I'm just emulating his work. I was going to work on the gun pod counters for the Mi-8. The drift would be good to have too. Sent from my SM-G781U using Tapatalk
  15. If anyone wants it I coded the F-16 UHF radio head display to fit on one button. function ExportScript.UhfPanel(mainPanelDevice) --export UHF radio unit to one button local tens_knob = ExportScript.Tools.round(mainPanelDevice:get_argument_value(412) * 10, 0) local ones_knob = ExportScript.Tools.round(mainPanelDevice:get_argument_value(413) * 10, 0) local tenths_knob = ExportScript.Tools.round(mainPanelDevice:get_argument_value(414) * 10, 0) local hundredths_knob = string.format("%.2d", mainPanelDevice:get_argument_value(415) * 100) local hundreds_knob if mainPanelDevice:get_argument_value(411) < 0.2 then hundreds_knob = "2" elseif mainPanelDevice:get_argument_value(411) > 0.2 and mainPanelDevice:get_argument_value(411) < 0.3 then hundreds_knob = "3" elseif mainPanelDevice:get_argument_value(411) >= 0.3 then hundreds_knob = "A" end local UHF_RADIO_FREQ = "UHF Freq" .. "\n" .. hundreds_knob .. tens_knob .. ones_knob .. "." .. tenths_knob .. hundredths_knob ExportScript.Tools.SendData(3016, UHF_RADIO_FREQ) end
  16. is there a good way to display three states on these buttons?
  17. I quick wrote this for the F-14 landing gear indicators. Seems to work so far through normal operation. function ExportScript.LandingGearIndicator(mainPanelDevice) --export all landing gear indicators local nose_gear local left_main local right_main --nose_gear 8300 = flag, 8301 = indicator if mainPanelDevice:get_argument_value(8300) < 0.5 and mainPanelDevice:get_argument_value(8301) > 0.5 then nose_gear = 1 --gear down elseif mainPanelDevice:get_argument_value(8300) > 0.5 then nose_gear = 2 --gear in transit elseif mainPanelDevice:get_argument_value(8300) < 0.5 and mainPanelDevice:get_argument_value(8301) < 0.5 then nose_gear = 0 --gear up end --left_main 8303 = flag, 8302 = indicator if mainPanelDevice:get_argument_value(8303) < 0.5 and mainPanelDevice:get_argument_value(8302) > 0.5 then left_main = 1 --gear down elseif mainPanelDevice:get_argument_value(8303) > 0.5 then left_main = 2 --gear in transit elseif mainPanelDevice:get_argument_value(8303) < 0.5 and mainPanelDevice:get_argument_value(8302) < 0.5 then left_main = 0 --gear up end --right_main 8304 = flag, 8305 = indicator if mainPanelDevice:get_argument_value(8304) < 0.5 and mainPanelDevice:get_argument_value(8305) > 0.5 then right_main = 1 --gear down elseif mainPanelDevice:get_argument_value(8304) > 0.5 then right_main = 2 --gear in transit elseif mainPanelDevice:get_argument_value(8304) < 0.5 and mainPanelDevice:get_argument_value(8305) < 0.5 then right_main = 0 --gear up end ExportScript.Tools.SendData(53026, nose_gear) ExportScript.Tools.SendData(53027, left_main) ExportScript.Tools.SendData(53028, right_main) end
  18. I dunno what I did but my first try was doing exactly what you posted at the end and I couldn't get it to work. That's why I was using text strings and equals instead of greater/less than because yes using greater/less than makes more sense to me. Thanks for cleaning it up.
  19. Got it! Maybe not the most elegant way to do it. I'd like to do just a straight if/then/else test of numbers but my syntax is wrong because it breaks. It will work if I test it against a text string. function ExportScript.SpeedBrakeIndicator(mainPanelDevice) --exports two speedbrake indicators in one local speedbrake_partial = string.format("%.1f", mainPanelDevice:get_argument_value(8307)) -- partial extension in x.x format number local speedbrake_extended = string.format("%.1f", mainPanelDevice:get_argument_value(8308)) -- full extension in x.x format number local speedbrake_indicator --exported value --test if speed brake is extended partially if speedbrake_partial == "1.0" then speedbrake_indicator = "1" --test if speed brake is extended fully elseif speedbrake_extended == "1.0" then speedbrake_indicator = "2" --test if speedbrake is retracted elseif speedbrake_partial == "0.0" and speedbrake_extended == "0.0" then speedbrake_indicator = "0" end ExportScript.Tools.SendData(53025, speedbrake_indicator) end
  20. Oh I didn't know that each if needed an end behind it! I'll add that. *update* I'm not getting the value to display but at least the whole script isn't crashing.
  21. I can get this to work but as soon as I try to add the if/the/else/elseif it crashes the whole export function ExportScript.SpeedBrakeIndicator(mainPanelDevice) --exports two speedbrake indicators in one local indicator indicator = "happy" ExportScript.Tools.SendData(53025, indicator) end If I try to do any kind of a logical test the script fails. I'm trying this now function ExportScript.SpeedBrakeIndicator(mainPanelDevice) --exports two speedbrake indicators in one local speedbrake_partial = string.format("%.1f", mainPanelDevice:get_argument_value(8307)) local speedbrake_extended = string.format("%.1f", mainPanelDevice:get_argument_value(8308)) if speedbrake_partial > 0 then speedbrake_indicator = "partial" ExportScript.Tools.SendData(53025, speedbrake_indicator) end This works function ExportScript.SpeedBrakeIndicator(mainPanelDevice) --exports two speedbrake indicators in one local speedbrake_partial = string.format("%.1f", mainPanelDevice:get_argument_value(8307)) local speedbrake_extended = string.format("%.1f", mainPanelDevice:get_argument_value(8308)) speedbrake_indicator = speedbrake_partial ExportScript.Tools.SendData(53025, speedbrake_indicator) end
  22. The F-14 has a speed brake indicator that is broken into two items. I'm trying to get it exported info one. I tried writing a script in the lua but it just causes the export script to stop working. I also tried using text values for the test like - speedbrake_indicator = "extended". Any ideas? I placed the ExportScript.SpeedBrakeIndicator(mainPanelDevice) in the function ExportScript.ProcessIkarusDCSConfigLowImportance(mainPanelDevice) function ExportScript.SpeedBrakeIndicator(mainPanelDevice) --exports two speedbrake indicators in one local speedbrake_indicator --check if speedbrake partially extended if mainPanelDevice:get_argument_value(8307) = 1.0 then speedbrake_indicator = 1 --check if speedbrake fully extended elseif mainPanelDevice:get_argument_value(8308) = 1.0 then speedbrake_indicator = 2 --check if speedbrake fully retracted elseif mainPanelDevice:get_argument_value(8307) = 0.0 and mainPanelDevice:get_argument_value(8308) = 0.0 then speedbrake_indicator = 0 end ExportScript.Tools.SendData(53025, speedbrake_indicator) end
  23. There's probably an easier way to do it with lua code but I'm not the one to ask about that. There are other guys here that are really good with it.
  24. You'd have to do some math to convert it into numbers for a proper display. or you can go nuts in the text change section like this for the gun counter on the Mi-8: 0.9000=18,0.8500=17,0.8000=16,0.7500=14,0.7000=13,0.6500=13,0.6000=12,0.5500=11,0.5000=10,0.4500=9,0.4000=8,0.3500=7,0.3000=6,0.2500=5,0.2000=4,0.1500=3,0.1000=2,0.0500=1,0.0000=0
×
×
  • Create New...