Jump to content
The simFlight Network Forums

Dirk98

Members
  • Posts

    154
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Dirk98

  1. "AI zapper" would be easier to find :P Thanks, Pete! Dirk.
  2. I can't find this Control in FSUIPC list, is there one? Thanks, Dirk.
  3. Any idea how to add the sound of turning knobs? All button pull / pushes tick ok. Thanks, Dirk.
  4. Here you go, Dirk: -- VS/FPA switch button function switchHDGTRK (joynum, button, downup) ipc.writeLvar( "L:AB_AP_HDGTRK", 1 - ipc.readLvar("L:AB_AP_HDGTRK") ) ipc.writeLvar( "L:SmallOverheadPushButtons", 1 ) end -- VS/FPA Inc function incFPAorVS ( joynum, button, downup ) if ipc.readLvar("L:AB_AP_HDGTRK") == 1 then -- 1 = TRK/FPA local lFPA = ipc.readLvar( "L:AB_AP_FPA_Select2" ) + 0.1 if lFPA > 9.9 then lFPA = 9.9 end ipc.writeLvar( "L:AB_AP_FPA_Select2", lFPA ) else -- 0 = HDG/SPD so set VS local lVS = ipc.readLvar( "L:AB_AP_VS_Select2" ) + 1 if lVS > 60 then lVS = 60 end ipc.writeLvar( "L:AB_AP_VS_Select2", lVS ) end end -- VS/FPA Dec function decFPAorVS ( joynum, button, downup ) if ipc.readLvar("L:AB_AP_HDGTRK") == 1 then -- 1 = TRK/FPA local lFPA = ipc.readLvar( "L:AB_AP_FPA_Select2" ) - 0.1 if lFPA < -9.9 then lFPA = -9.9 end ipc.writeLvar( "L:AB_AP_FPA_Select2", lFPA ) else -- 0 = HDG/SPD so set VS local lVS = ipc.readLvar( "L:AB_AP_VS_Select2" ) - 1 if lVS < -60 then lVS = -60 end ipc.writeLvar( "L:AB_AP_VS_Select2", lVS ) end end -- VS/FPA Level function levFPAorVS ( joynum, button, downup ) if ipc.readLvar("L:AB_AP_HDGTRK") == 1 then ipc.writeLvar( "L:AB_AP_FPA_Select2", 0 ) else ipc.writeLvar( "L:AB_AP_VS_Select2", 0 ) end end -- register the buttons of your joystick triggering the functions -- replace joyletter by the actual used letter/number, also replace buttonX by the actual value event.button("joyletter", button1, 1, "incFPAorVS") event.button("joyletter", button2, 1, "decFPAorVS") event.button("joyletter", button3, 1, "switchHDGTRK") event.button("joyletter", button4, 1, "levFPAorV")[/CODE] [color=#666600]Cheers,[/color] [color=#666600]Dirk [/color] :D
  5. I can't figure out why most of the script works ok, except for MACH Minus and MACH Minus Fast. The positivie part works both in SPD and MACH modes just fine: -- SPD/MACH switch button function switchSPDMACH (joynum, button, downup) ipc.writeLvar( "L:AB_AP_SPDMACH", 1 - ipc.readLvar("L:AB_AP_SPDMACH") ) ipc.writeLvar( "L:SmallOverheadPushButtons", 1 ) end -- SPD/MACH Inc function incSPDorMACH ( joynum, button, downup ) if ipc.readLvar("L:AB_AP_SPDMACH") == 1 then local lMACH = ipc.readLvar( "L:AB_AP_Mach_Select" ) + 0.01 if lMACH > 1.0 then lMACH = 1.0 end ipc.writeLvar( "L:AB_AP_Mach_Select", lMACH ) else local lSPD = ipc.readLvar( "L:AB_AP_SPEED_Select" ) + 1 if lSPD > 340 then lSPD = 340 end ipc.writeLvar( "L:AB_AP_SPEED_Select", lSPD ) end end -- SPD/MACH IncFast function incFastSPDorMACH ( joynum, button, downup ) if ipc.readLvar("L:AB_AP_SPDMACH") == 1 then local lMACH = ipc.readLvar( "L:AB_AP_Mach_Select" ) + 0.1 if lMACH > 1.0 then lMACH = 1.0 end ipc.writeLvar( "L:AB_AP_Mach_Select", lMACH ) else local lSPD = ipc.readLvar( "L:AB_AP_SPEED_Select" ) + 10 if lSPD > 340 then lSPD = 340 end ipc.writeLvar( "L:AB_AP_SPEED_Select", lSPD ) end end -- SPD/MACH Dec function decSPDorMACH ( joynum, button, downup ) if ipc.readLvar("L:AB_AP_SMPDMACH") == 1 then local lMACH = ipc.readLvar( "L:AB_AP_Mach_Select" ) - 0.01 if lMACH < 0 then lMACH = 0 end ipc.writeLvar( "L:AB_AP_Mach_Select", lMACH ) else local lSPD = ipc.readLvar( "L:AB_AP_SPEED_Select" ) - 1 if lSPD < 0 then lSPD = 0 end ipc.writeLvar( "L:AB_AP_SPEED_Select", lSPD ) end end -- SPD/MACH DecFast function decFastSPDorMACH ( joynum, button, downup ) if ipc.readLvar("L:AB_AP_SMPDMACH") == 1 then local lMACH = ipc.readLvar( "L:AB_AP_Mach_Select" ) - 0.1 if lMACH < 0 then lMACH = 0 end ipc.writeLvar( "L:AB_AP_Mach_Select", lMACH ) else local lSPD = ipc.readLvar( "L:AB_AP_SPEED_Select" ) - 10 if lSPD < 0 then lSPD = 0 end ipc.writeLvar( "L:AB_AP_SPEED_Select", lSPD ) end end event.button(149, 3, 1, "switchSPDMACH") event.button(149, 22, 1, "incSPDorMACH") event.button(149, 23, 1, "incFastSPDorMACH") event.button(149, 21, 1, "decSPDorMACH") event.button(149, 20, 1, "decFastSPDorMACH")[/CODE] Any idea? Much thanks, Dirk.
  6. Yes, it is! With the tip from Joshua Che. on aerosoft boards (ipc.writeLvar( "L:AB_AP_VS_Select2", 0 ) I produced my own little script (or should I call it "hack"?) : -- VS/FPA Level code function levFPAorVS ( joynum, button, downup ) if ipc.readLvar("L:AB_AP_HDGTRK") == 1 then ipc.writeLvar( "L:AB_AP_FPA_Select2", 0 ) else ipc.writeLvar( "L:AB_AP_VS_Select2", 0 ) end end event.button(175, 5, 1, "levFPAorVS") [/CODE] See, Reinhard, your kind help and scripts do magic on me already, I feel like I can script something too, lol. Thank you very much again, Dirk.
  7. Understood. Just in case, KAPTEJNLN, here you'll find all the new names (follow the link to aerosoft SDK http://forum.aerosof...-sdk-variables/ ) and improved scripting concept for AXE (compared to what had been done for AX): http://forum.simflig...-into-one-file/ Cheers, Dirk.
  8. Just in case somebody needs current AXE LVars, the latest list is available here: http://forum.aerosoft.com/index.php?/topic/64255-airbus-x-extended-sdk-variables/ Cheers, Dirk.
  9. I'll post soon my LUA for AXE, that basically can be used with any HID device, all interested please praise Reinhard (and Pete of course). Question tor Reinhard: I posted about this issue with AB_AP_VSlevel on aerosoft/axe/sdk forum. I'm not sure though I was right claiming it was an error or an omission of the current AXE SDK: See, AB_AP_VSlevel resets only TRK/FPA to "0", when FCU is in TRK/FPA mode. It does nothing for HDG/VS mode though. I currently use this code: -- VS/FPA level code function levelVSlevel (joynum, button, downup) ipc.writeLvar( "L:AB_AP_VSlevel", 1 - ipc.readLvar("L:AB_AP_VSlevel") ) ipc.writeLvar( "L:SmallOverheadPushButtons", 1 ) end event.button(175, 5, 1, "levelVSlevel")[/CODE] Is it possible to add some switching script to reset VS to 0 as well "outside" of AXE code? Thanks, Dirk.
  10. The HDG knob turning code works perfect without "end if". You made my day, Reinhard, thank you very much. I'm working on the VS/FPA knob and button script now, there are some parts missing yet. Dirk.
  11. Haha! This code now increases VS by 100 or FPA by 0.1 each time I press the assigned button, depending on which state the VS/FPA button is in (not in the code yet, I do it manually). I think I can start building up on it. -- VS/FPA Toggle code function incFPAorVS ( joynum, button, downup ) if ipc.readLvar("L:AB_AP_HDGTRK") == 1 then -- 1 = TRK/FPA local lFPA = ipc.readLvar( "L:AB_AP_FPA_Select2" ) + 0.1 if lFPA > 9.9 then lFPA = 9.9 end ipc.writeLvar( "L:AB_AP_FPA_Select2", lFPA ) else -- 0 = HDG/SPD so set VS local lVS = ipc.readLvar( "L:AB_AP_VS_Select2" ) + 1 if lVS > 60 then lVS = 60 end ipc.writeLvar( "L:AB_AP_VS_Select2", lVS ) end end event.button(175, 4, 1, "incFPAorVS")[/CODE] Will check the HDG inc/dec code without "end if" now. Thanks! Dirk.
  12. Woo-hooo, Reinhard! You are the King! (lua king) Thank you very much for your time spent on this. Can't wait to work on your script, dig hard into it and try out on the hardware. I have a dozen+ of GF panels, VRinsight MS Panel, (VRI FCU 2 Airbus is in the pipe) and many more that I don't use, lol. My interest atm mainly revolves around GF (MCP, RP48, GF166A VRP, GF-LGT II) and some others. Guys with GoFlight panels, if you've found this, ask me! I'll post my results for the latest scripts. Thanks again, Dirk.
  13. I've added 'Button On' case for Managed Heading mode selection to add to the "combined" event-driven lua: -- toggle FD button function toggleFD (joynum, button, downup) ipc.writeLvar( "L:AB_MPL_FD", 1 - ipc.readLvar("L:AB_MPL_FD") ) ipc.writeLvar( "L:SmallOverheadPushButtons", 1 ) end -- toggle ATHR button function toggleILS (joynum, button, downup) ipc.writeLvar( "L:AB_MPL_ILS", 1 - ipc.readLvar("L:AB_MPL_ILS") ) ipc.writeLvar( "L:SmallOverheadPushButtons", 1 ) end -- HDG mode selection managed function selectHDGmode (joynum, button, downup) ipc.writeLvar( "L:AB_AP_HDGmode", 1 ) ipc.writeLvar( "L:SmallOverheadPushButtons", 1 ) end -- register the buttons of your joystick triggering the functions -- replace joyletter by the actual used letter/number, also replace buttonX by the actual value event.button(175, 0, 1, "toggleFD") event.button(175, 1, 1, "toggleILS") event.button(149, 1, 1, "selectHDGmode") [/CODE] Another couple of examples more from kind Lua gurus like Reinhard and I believe everyone will be able to map their HID devices to AXE functions with its SDK http://forum.aerosof...attach_id=38337. For me it's just a matter of seeing similarities and patterns in the code without understanding it, unfortunately. Lua manual and Lua Library are really beyond my depth, or too much time to study. As I see it there are 2 more templates needed: [CODE] -- Heading inc fast if ipcPARAM == 25 then LVarSet = "L:AB_AP_HDG_Select" LVarGet = ipc.readLvar(LVarSet) ipc.writeLvar(LVarSet, LVarGet+10) end[/CODE] and [CODE] -- 55 HDGVS/TRKFPA button toggle if ipcPARAM == 55 then LVarSet = "L:AB_AP_HDGTRK" LVarGet = ipc.readLvar(LVarSet) val = 1 if ipc.readLvar(LVarSet) == 1 then val = 0 end ipc.writeLvar(LVarSet, val) ipc.writeLvar("L:SmallOverheadPushButtons", 1) end[/CODE] I'll repeat, that Reinhard (aua668) kindly suggested another concept of scripting of the "combined" lua file for the access to AXE's internal variables (in this particular case), other than the one previously made by guenseli (in AX Lua script v1.2) and others that I saw. The lua based on Reinhard's method will work better than the parts that I quoted above, when you start mapping your HID devices, as I think I've learnt a lot already without delving into programming. Just another couple of examples is needed. Thanks! Dirk.
  14. Yes, I've known about this problem since my first usb hubs 10+ yuears ago, therefore I've always had all usb connections fixed, photoed and written up in the notes, which takes a lot of time, of course, but still works. Now, assigning the letters in fsuipc.ini sounds much easier, thank you for the tip. Dirk.
  15. Reinhard, I badly need just one more piece of your code for control of the rotary, to substitue the following: -- Heading dec if ipcPARAM == 24 then LVarSet = "L:AB_AP_HDG_Select" LVarGet = ipc.readLvar(LVarSet) ipc.writeLvar(LVarSet, LVarGet-1) end If I get another example of your method for the above, I'll have everything to start building the complete lua for all my input devices. Thanks, Dirk.
  16. When there is no Toggle function, like when you turn HDG knob, what comes in place of toggleXXX? Much thanks, Dirk.
  17. Cool, it works. I see I don't need to assign any buttons in FSUIPC GUI all is done in the script. In my example: event.button(135, 0, 1, "toggleFD") where 135 is the number given by FSUIPC to one of my GF panels, and 0 is button #1 on it. Thanks! Dirk.
  18. I forgot one important thing: FSUIPC does not assign letters to my GoFlight panels, so I can use only joynumber for GoFlight. Do you know if "joyletter" in your code can be substituted by "joynumber" or smth similar? Thanks, Sabre10
  19. Reinhard, thanks, I'll try it now. If it works I'll be able to build up more on this example and some hacking. I know what you mean by using letters instead of numbers for the joysticks. At some point I used AutoAssignLetters=1 in FSUIPC.ini to name my joysticks by letters. But I did not understand the benefit, so I rolled back to Numbers. I have no obvious problems with numbering the joystics, are there any benefits with letters? Thanks, Dirk.
  20. Reinhard, thank you very much. I think I understand what you're saying regarding the event driven version. Good methods of doing things are always very important, of course. So I'll play with your code to make it work with a concrete hardware button or a knob, then I'll be able to switch completely to your version. I'm still missing how this part should look in a concrecte code: "joynum, button, downup". Could you give me a concrete example please, maybe from one of your lua's. Much thanks, Dirk.
  21. Reinhard, maybe you can figure this out: In AXE SDK among others there are 3 specific LVars for V/S - FPA knob, that are: AB_AP_VS_Select2 AB_AP_HDGTRK AB_AP_FPA_Select2 HDGTRK button switches mode between VS_Select2 and FPA_Select2 modes. I'm not sure if this can somehow be merged so that one V/S hardware wheel (or knob) could understand and control both VS or FPA, depending on the mode changed by HDGTRK button. What I mean is that now I can only map my hardware VS wheel either to VS_Select2 or FPA_Select2. Obviously pressing HDGTRK button immediately loses control of the currently mapped function (VS_Select2 or FPA_Select2 depending on the script used). So, how to make the script explain and hand over control of the next function (VS or FPA code) to my hardware wheel each time HDGTRK is pressed? Thanks. Dirk.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.