Jump to content
The simFlight Network Forums


  • Content Count

  • Joined

  • Last visited

Community Reputation

1 Neutral

About Masterius

  • Rank

Profile Information

  • Gender
  • Location
  1. OK, I'm admitting I've no idea what I'm doing. I've torn apart every .lua existing in the various folders, and after having done so I've no idea how DspShow is defined. I've specifically looked for "Fthr" to see where and how that is defined, and simply can't find it. I'm at a loss here. I've also read all the support manuals and instructions and have exhausted Google, and again come up short with an explanation for DspShow. Care to take pity on an ignoramous?
  2. I've found the issue, but no idea how to fix it. I get this error when trying to run it: [E] *** LUA Error: ...am\steamapps\common\FSX\Modules\B17_Eng1_restart.lua:61: attempt to call global 'DspShow' (a nil value) It runs fine in LINDA, but I suspect that's because it's run within the larger file lib-user.lua function B17_Eng1_restart () ipc.writeLvar("L:Feather1Switch", 0) DspShow("Fthr", "1 off") ipc.sleep(500) ipc.clearbitsUB("2434", 1) ipc.sleep(2000) ipc.writeLvar("L:FuelValvesSafe",1) ipc.sleep(750) ipc.writeLvar("L:Eng1FuelCutOffSwitch",1) ipc.sleep(1500) ipc.writeLvar("L:FuelValvesSafe",0) ipc.sleep(750) ipc.writeLvar ("L:MixtureLock",0) ipc.sleep(1500) ipc.writeLvar("L:MixtureRatioLever1Position", 2) ipc.sleep(1500) ipc.setbitsUB("3125", 1) DspShow("Pump", "1on") ipc.sleep(1500) ipc.writeLvar ("L:MixtureLock",1) ipc.writeSB("0892", 3) ipc.sleep(750) restartIfNeeded1 () ipc.sleep(30000) ipc.writeLvar ("AutoCoPilotCowl", 1) end function restartIfNeeded1 () n = ipc.readLvar("Eng1_RPM") if n<=250 then B17_InertStart_show1 () else end end function B17_InertStart_show1 () ipc.writeLvar("L:Starter12Start", 0) Inert = round(ipc.readLvar("L:StarterInertiaSoundVolume")/2.5) if _MCP1 () then DspShow("Inrt", Inert .."%") elseif _MCP2 () then DspMed1("InrtStrt") DspMed2(" " .. Inert .."%") end B17_Engine1_Mesh () end function B17_EngineMesh_stop () ipc.writeLvar("L:Starter12Mesh", 1) ipc.writeLvar("L:Starter34Mesh", 1) DspMed1("") DspShow("stop", "") end function B17_Engine1_Mesh () ipc.sleep(12000) ipc.writeLvar("L:Starter12Mesh", 0) end DspShow("Mesh", " " .. 1 .. " ")
  3. Oddly enough, had I searched for Lua in controls, I highly doubt I would have asked this question. Since I was going to be conditionally programming the .lua, and as you can't directly assign that through the GUI interface but are required to manually program that, I was trying to do so using the instructions found in pages 18 thru 28 of the FSUIPC4 for Advanced Users.pdf. The examples used there for control definitions are the typical Cxxxxx format, such as C65570. I'm familiar with that, and extensively use them in my scripts. I hadn't encountered the "CL" definition before, and since I was so focused on manually writing the script, it never occurred to me to use the GUI to get the script started. My bad. Thank you for the answer. Update: Having added the .lua as described, using the button does nothing. However, if I assign the .lua to the same button using LINDA it then runs. The buttons that aren't working are 14-17. Here is the code: [Buttons.B-17] 0=RA,32,C65734,0 -{PAN_UP}- 1=RA,34,C65672,0 -{PAN_RIGHT}- 2=RA,36,C65735,0 -{PAN_DOWN}- 3=RA,38,C65671,0 -{PAN_LEFT}- 4=PA,10,C1003,10 -{BUTTON FLAG Set: Joy 0 Button 10}- 5=UA,10,C1004,10 -{BUTTON FLAG Clear: Joy 0 Button 10}- 6=PA,9,C1003,9 -{BUTTON FLAG Set: Joy 0 Button 9}- 7=UA,9,C1004,9 -{BUTTON FLAG Clear: Joy 0 Button 9}- 8=PA,8,C1003,8 -{BUTTON FLAG Set: Joy 0 Button 8}- 9=UA,8,C1004,8 -{BUTTON FLAG Clear: Joy 0 Button 8}- 10=CP(F+A,9)A,1,C66507,101 ;//OpenPanel101-DBG -{PANEL_ID_OPEN}- 11=CP(F+A,9)A,1,C66507,1064 ;//OpenPanel1064-Norden -{PANEL_ID_OPEN}- 12=CP(F+A,10)A,1,C66508,101 ;//ClosePanel101-DBG -{PANEL_ID_CLOSE}- 13=CP(F+A,10)A,1,C66508,1064 ;//ClosePanel1064-Norden -{PANEL_ID_CLOSE}- 14=PA,21,CL12:R,0 -{Lua B17_Eng1_restart}- 15=PA,22,CL13:R,0 -{Lua B17_Eng2_restart}- 16=PC,6,CL14:R,0 -{Lua B17_Eng3_restart}- 17=PC,7,CL15:R,0 -{Lua B17_Eng4_restart}- [LuaFiles] 1=Lua KillAll 2=A2AB17_MixAdj 3=A2AB17_Mixture 4=A2AB17_Turbo 5=B-17_Heater 6=B17_Mechanic 7=Calc_Track 8=ipcReady 9=linda 10=pucker 11=fuelcheckAll 12=B17_Eng1_restart 13=B17_Eng2_restart 14=B17_Eng3_restart 15=B17_Eng4_restart [Auto.B-17] 1=Lua KillAll 2=Lua B-17_Heater 3=Lua B-17_Windows_both 4=Lua Calc_Track 5=Lua A2AB17_Turbo 6=Lua A2AB17_Mixture 7=Lua A2AB17_MixAdj 8=linda 9=Lua fuelcheckAll 10=Lua B17_Eng1_restart 11=Lua B17_Eng2_restart 12=Lua B17_Eng3_restart 13=Lua B17_Eng4_restart I've no idea why it runs in LINDA but not FSUIPC.
  4. Can a button be programmed to run a .lua? It appears that buttons can be programmed for keypresses, controls, and macros, but not a .lua.
  5. Bulls-eye!! Dead in the black. That problem's been vexing me for a while now. Thanks a heap!
  6. I'm running registered copy of FSUIPC4, v4975a, along with LINDA, v3.1.1.854. I usually have no difficulty programming buttons, keys, axis, etc, either through FSUIPC, LINDA, or lua scripts. But I'm encountering a problem with button programming using conditional flags for the Saitek Pro Flight Yoke mode switch. The mode switch is seen and recognized both by FSUIPC (as axis A, buttons 8, 9, and 10) and by LINDA (where I can set UNSHIFTED, SHIFTED ONE and SHIFTED TWO). Here is the relevant section of fsuipc4.ini: [Buttons.B-17] 0=RA,32,C65734,0 -{PAN_UP}- 1=RA,34,C65672,0 -{PAN_RIGHT}- 2=RA,36,C65735,0 -{PAN_DOWN}- 3=RA,38,C65671,0 -{PAN_LEFT}- 4=PA,10,C1003,10 -{BUTTON FLAG Set: Joy A Button 10}- 5=UA,10,C1004,10 -{BUTTON FLAG Clear: Joy A Button 10}- 6=PA,9,C1003,9 -{BUTTON FLAG Set: Joy A Button 9}- 7=UA,9,C1004,9 -{BUTTON FLAG Clear: Joy A Button 9}- 8=PA,8,C1003,8 -{BUTTON FLAG Set: Joy A Button 8}- 9=UA,8,C1004,8 -{BUTTON FLAG Clear: Joy A Button 8}- 10=CP(F+A,9)PA,1,C66507,101 ;//OpenPanel101-DBG 11=CP(F+A,9)PA,1,C66507,1064 ;//OpenPanel1064-Norden 12=CP(F+A,10)PA,1,C66508,101 ;//ClosePanel101-DBG 13=CP(F+A,10)PA,1,C66508,1064 ;//ClosePanel1064-Norden The intention is that when the mode switch is set to "MODE 2" and yoke button 1 is pressed, then panels #101 and 1064 open, and when the mode switch is set to "MODE 3" and yoke button 1 is pressed, then the panels will close. Unfortunately, that's not what happens...which is nothing at all. Any help will be appreciated!
  7. Thanks for the quick response, John! I do use the 'Joyletters', and have since almost Day 1. I think I understand things correctly, so here goes: Controller 1 is a Saitek Flight Yoke, and has assigned to it Letter "A". The ailerons and elevators for that are associated with "A". Controller 2 is a Saitek X52 H.O.T.A.S., whose stick is assigned as 'B'. The ailerons and elevators for that are associated with "B". So although the .ini file might show multiple iterations of "aileron", "elevator", "throttle", etc, each of those iterations will be associated with their respective controllers. The same would occur for button and key assignments as well. Correct? ~Masterius
  8. While I have found variations to this question, I haven't seen anything specific regarding my query . . . so . . . here goes: At the moment I am using FSX:SE with FSUIPC4 and LINDA. My equipment is: (All Saitek) Flight Yoke System (with one throttle quadrant), two additional throttle quadrants, pro flight rudder pedals, switch panel, and radio panel. I would like to, at times, remove the yoke and three throttle quadrants and replace them with the Saitek X52 H.O.T.A.S. Is there a way of doing this without losing key/button/axis/calibrations? I realize that those assignments will not directly carry over from one to another. I just don't want to lose all the programming and calibrations and have to redo those each and every time I swap out controller groups. I guess I have several questions, actually. One is how do I (assuming it is possible; I do seem to recall reading something about having multiple .ini files and/or profiles that allow for discrete controller selections) define one controller group (flight yoke, and three throttle quadrants) independent of the second (H.O.T.A.S)? The other is how do I (again, assuming it is possible) prevent the assignments from getting lost or reset? And lastly, what is necessary to avoid, and to prevent, controller assignments from getting scrambled between disconnection/re-connection? I use the joystick lettering, as advised, but even so, when I'd added the third throttle quadrant several months ago, both FSUIPC4 and LINDA recognized the older, second quadrant as the third, and the newer, third quadrant as the second. I'd rather not go through that again. 😩 Any advice, help and/or suggestions will be greatly appreciated! ~Masterius
  9. I didn't think it had. Negative to both. I'll try and record that. I also use LINDA, which permits real-time observation of button executions. I could see the button operating, see the execution of the script, but not see the Lvar change. However, when I manually switched the magnetos in-game, I could see the Lvar values change. Al
  10. I'm running FSX Steam Edition on Windows 7 using FSUIPC4, Version 4.974 and LINDA Version, and have been for some time now. Never really had any problems before, except for a little glitch with LINDA at setup over my throttle quadrants. I've been writing my own lua scripts, and they've been running just fine up until the middle of last week. Now, however, if a newly-created function attempts to write to, or read from, a Lvars, nothing happens. I can see the function called, I can trace the button as it is activated and deactivated, but the LVar value itself does not change. As well, if I remove a function that has been working, make and save any changes to the user.lib, and then paste that function back inside, it no longer works. For example, this function had been working, until I removed it for a revised version. When the revised version didn't work, I deleted it and pasted the original back, but now that one no longer works, either. The function actually runs, because it takes 6 seconds to complete and permit subsequent functions to execute. function All_Magnetos_Off_a () ipc.writeLvar("L:Magnetos1Switch",0) ipc.sleep(1500) ipc.writeLvar("L:Magnetos2Switch",0) ipc.sleep(1500) ipc.writeLvar("L:Magnetos3Switch", 0) ipc.sleep(1500) ipc.writeLvar("L:Magnetos4Switch",0) ipc.sleep(1500) end I've no idea what's up, but it's intensely frustrating.
  11. Perhaps I did not explain better. What I meant was, how do I have certain controls, like mixtures, turbo, fuel pump, etc, start at pre-defined positions? For example, start off with turbo at zero, mixture levers at idle cutoff (zero). Basically, have an .ini file to preset offsets and Lvars.
  12. Thank you both for your replies. I've spread the axis across the board, giving space between them (ex. using 66C1, 66C4, 66C7, etc) and that seems to have fixed the overlapping writes. Now I just need to figure out how to start the offsets at certain values (for instance, mixture at idle cutoff, turbo at zero . . . that sort of thing). Thanks again! Al
  13. Up until this week I've had no difficulties using the offsets 66C0 thru 66FF (although I've only used about 10 so far). However, now it seems I can no longer write values to the unused ones, and in tracking down possible reasons I've also noticed the unused offsets holding values, and also responding to other assigned axis. For instance, I have one axis assigned to 0x66C1, but 0x66C2 also responds, but not not identically: the axis outputs the value of -16383 to 16383 to 0x66C1, but -293 to 63 to 0x66C I'm running both LINDA 3.0.12 and FSUIPC4 4.974 on Windows 7.
  14. I've used "List Local Panel Vars" quite a bit, but didn't think to try Event Logging. It looks as if it might be [VOR1_OBI]. Going to experiment with that now. Update: VOR1_OBI worked!
  15. That is the instrument in question, and the knob that adjusts the heading. Tried them ; didn't work. Or, at least, didn't work how I tried using them (as macros). I really do try and make use of the 14 or so documents that you've provided. It's rather rude and disrespectful to you if I don't take advantage of the large amount of documentation and instructions you've provided. Thanks again for such a rapid, and insightful, reply. I'll keep on working at this. ~Al
  • 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.