Jump to content
The simFlight Network Forums


  • Content Count

  • Joined

  • Last visited

  • Days Won


spokes2112 last won the day on February 12

spokes2112 had the most liked content!

Community Reputation

17 Good

1 Follower

About spokes2112

  • Rank
    Advanced Member
  • Birthday 04/03/1967

Contact Methods

  • Website URL

Profile Information

  • Gender
  • Location
  • Interests
    FS Programming, Electronics, Vintage Radios

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. spokes2112

    Cannot read LVAR correctly

    A shameless plug 😞 .. You could always use this little kit, nothing more than a mod of Pete's included lua examples. Just monitor the L:Var you want - if it is not there the lua will die gracefully, otherwise if the var is there a window will show it's status. Basically all you need is the "LVAR_SPECIFIC" portion of the kit since you know the L:Var name.. Assign a key to start it repeatedly until you get a value. Roman
  2. Gene, You could, as an option, use the available "LuaValue <my lua name>" assignment under "Type of action required" field on the left side of the "Axis Assignment" tab of the FSUIPC user interface. Basically you are assigning the values of the slider to be applied to the lua. Any slider value change is caught by the event facilities in the lua library and sent to the called function. BTW, the event facilities are the "cats meow" . 👍😸 Have the lua be autostarted via [Auto], preferably in profiles. Then, in the lua - function carbHeatAxis(val) val = val --[[plus any required math to get the correct values]] ipc.writeLvar("Eng1_CarbHeatSwitch", val) end event.param("carbHeatAxis") Hope this helps, Roman
  3. Ummm.. OK :) Favorite album of all time... In high school, my locker was #112 on the second floor During a very long hospital stay, many moons ago, i was on floor 2, room 11, bed 2. O - U - BETCHA! RE: problems.. I always try for the single lua. Saying that, you may want to take a look at the COM functions in the lua library.. Using those to "pre-run" a script to get everything synched to your switches, followed by another lua to detect switch changes after the "pre-run" synch. Never used the COM functions so it is way above my pay grade. Using a loop to actively check the states of your hardware, all the time, would probably be out of the question, bringing flight sim to a stuttering crawl. BTW.. when is spring? hehe
  4. In the FSUIPC dialog you can type in search params in the dropdown text box to get you where you need in the drop down. IIRC it takes the first 3, maybe 4, max letters typed in - "lua" - gets you to the root lua listings "luat" - may get you to the root of lua toggle listings
  5. spokes2112

    EVENT Automatically Running

    Hi all, 3 of the 4 lua's I wrote or helped, 2 are hardware interfaces to specific aircraft where L:Vars are necessary to interface (E2CECU.lua, DC_F14D_CMDS.lua) and 1 is a selectable axis via a button. (MAxisThrottle.lua) The rest of the log is all from poor, very poor, gauge coding.. Flooding the sim with commands. They should be getting the current state before writing a new state. In pseudo XML syntax they are doing -- blah blah blah if{ 12 (>K:FUEL_SELECTOR_SET) } when they should be doing -- blah blah blah (A:FUEL TANK SELECTOR 1, number) 12 != and if{ 12 (>K:FUEL_SELECTOR_SET) } Being Captain Sim, it is likely (don't know, don't have) that nothing can be done as they usually use C++ type gauges. A2A is another company that floods the sim quite often. A shame.. Roman
  6. spokes2112

    Spot view P3D

    Nothing that you would like.. Either you can have have F11 (or whatever) as a spot view or as a pedestal view, not both. The reason is that AS is using the STOCK "spot view" ( "View Camera Select 3" ) as the pedestal view, overriding the stock spot view. This is also hard coded in the view select window as you showed. Clicking on the pedestal (#8 picture) provides the command "View Camera Select 3". Either have a button/key for spot view and use the "Sim" view menus for a pedestal view - or- keep AS's view setup and use the "Sim" view menus for spot view. There is one way to get both to work but it will globally change your entire sim. Not worth it. Another way is to recode the AB_Panelbar gauge (the view select window) to use the only (they used 9 of the possible 10) unused view command - "View Camera Select 4" and reconfigure the pedestal camera definition to - Hotkeyselect= 4. Doing this may render another unknown stock view command useless too. Did these tests using my friend's sim, sorry, cannot help anymore. 😞 Definition #s do not apply to the "view select #" commands, the definition entry "Hotkeyselect=#" does this. On the other hand, Definition #s do provide the order in the sim's view menu. Roman
  7. spokes2112

    Spot view P3D

    As John mentioned the camera definitions in the aircraft.cfg override any of the same/similar global camera definitions when the aircraft is loaded. If you can live without the F11 command for the pedestal view then - 1) The AB 320/321 not loaded in sim 2) in the aircraft.cfg find the camera definition for the "pedestal view" and comment out the HotKeySelect line as shown below - //HotKeySelect=3 (NOTE - this COULD be HotKeySelect=2, do not have the 320 and the P3D SDK somewhat conflicts with the FSX SDK) 3) Load the AB 320/321 up in the sim 4) Use the FSUIPC command "View Camera Select 3" You will now have your spot view but lose the pedestal view. You could get them both back but it would require good knowledge of the camera system and the use of HotKeySelect & View Camera Select #. https://www.prepar3d.com/SDKv4/sdk/cameras/camera_configuration.html
  8. In most cases, for a turboprop type flight model, the mixture commands apply to the condition levers. Have you tried those? The Q400 is a different animal altogether so it may not work, worth giving it a try.
  9. Rustam, Just gave it a go using the keyboard for a quick test. It looks like NEXT_VIEW (65827) & PREV_VIEW (65828) may be either pre-FSX commands or for use with 2D cockpits. The following seem to work in FSX - 16=97,8,65567,0 -{Num1: Press=VIEW_MODE }- 17=98,8,65749,0 -{Num2: Press=VIEW_MODE_REV }- Keep in mind that in order to cycle thru views like this that the following camera.cfg entry must be "No" for each of the cameras you want to be included for the view mode changes using the commands above. CycleHidden=No Roman
  10. spokes2112

    LVars for C47 Start Switch

    Tom, Did you get it work? If not, this may help. Many times there is logic involved within the visual model on the clickspot. When using the FSX or greater SDK to compile the model the XML animation / logic code is visible using a hex editor. This is the case for the C-47, below is the retrieved code. (comments on engine 1) Note that 0 = OFF & 50 = ON for the starter switch. Looks like he combined the animation and logic together. <!-- STARTER 1 --> <!-- TURN STARTER OFF AND QUIT ALL FURTHER CODE --> (L:Starter switch:1, enum) 0 != if{ 0 (>L:Starter switch:1, enum) 0 (>L:Starterturn1, rpm) quit } <!-- TURN STARTER ON BUT IF THERE IS NO POWER QUIT ALL FURTHER CODE --> 50 (>L:Starter switch:1, enum) (A:Circuit general panel on, bool) ! if{ quit } <!-- IF ENGINE ACTUALLY FIRES (USING SOME SLOW START CODE) QUIT ALL FURTHER CODE --> (A:PROP RPM:1, rpm) 0 > if{ quit } <!-- INITIALIZE THE SLOW START VISUAL CODE --> (L:slowprop, rpm) (>L:Starterturn1, rpm) <!-- STARTER 2 --> (L:Starter switch:2, enum) 0 != if{ 0 (>L:Starter switch:2, enum) 0 (>L:Starterturn2, rpm) quit } 50 (>L:Starter switch:2, enum) (A:Circuit general panel on, bool) ! if{ quit } (A:PROP RPM:2, rpm) 0 > if{ quit } (L:slowprop, rpm) (>L:Starterturn2, rpm) This may be a good candidate for lua but because of the "quit" the coding would have to be done carefully. May give it a try after some thought. EDIT - decided to give it a go.. Here is a lua as a direct copy of the VC starter code - tested, seems good. Note - during testing it was found that there are a few obscure bugs dealing with power supplied and the starter logic. I kept any corrections out of it to keep the intentions of Manfred true. Code below and attached. --[[ 1) With FS Closed, copy this code into a blank text file located in /modules and name it "MJC47_START.lua" 2) To use starter one, use the FSUIPC command "Lua MJC47_START" with a parameter of 1 3) To use starter two, use the FSUIPC command "Lua MJC47_START" with a parameter of 2 ]] local startSw = 0 local propSlow = 0 local propRpm = 0 local pnlPwr = 0 -- STARTER 1 if ipcPARAM == 1 then startSw = ipc.readLvar("Starter switch:1") if startSw ~= 0 then -- TURN OFF STARTER ipc.writeLvar("Starter switch:1", 0) -- PHYSICALLY MOVE SWITCH TO OFF POSITION ipc.writeLvar("Starterturn1", 0) else -- TURN ON STARTER ipc.writeLvar("Starter switch:1", 50) -- PHYSICALLY MOVE SWITCH TO ON POSITION propRpm = ipc.readDBL(0x2400) pnlPwr = ipc.readDBL(0x2840) if propRpm == 0 and pnlPwr ~= 0 then -- QUIT IF ACTUAL PROPS TURN BY FS CONTROLLED ENGINE OR NO PANEL POWER propSlow = ipc.readLvar("slowprop") ipc.writeLvar("Starterturn1", propSlow) -- SLOW PROP TURNING INI end end end -- STARTER 2 if ipcPARAM == 2 then startSw = ipc.readLvar("Starter switch:2") if startSw ~= 0 then -- TURN OFF STARTER ipc.writeLvar("Starter switch:2", 0) -- PHYSICALLY MOVE SWITCH TO OFF POSITION ipc.writeLvar("Starterturn2", 0) else -- TURN ON STARTER ipc.writeLvar("Starter switch:2", 50) -- PHYSICALLY MOVE SWITCH TO ON POSITION propRpm = ipc.readDBL(0x2500) pnlPwr = ipc.readDBL(0x2840) if propRpm == 0 and pnlPwr ~= 0 then -- QUIT IF ACTUAL PROPS TURN BY FS CONTROLLED ENGINE OR NO PANEL POWER propSlow = ipc.readLvar("slowprop") ipc.writeLvar("Starterturn2", propSlow) -- SLOW PROP TURNING INI end end end Roman MJC47_START.lua
  11. spokes2112

    Problem with ipc.display

    Quite possibly your display window may be off screen if undocked and set there once before. In FSX this display location is saved in a saved flight file. Maybe try setting a new location and also give it a display duration in case it is clearing too quick. Also try in windowed mode if you are full screen. ipc.setowndisplay("My Lua Display Test", 48, 2, 4, 0) -- this will relocate the window top dead center in the fs main window ipc.display("HI", 5) -- 5 second display duration ref = sound.play("GearUpCall") Roman
  12. Good deal... 😄 My apologies on the L:Var, and good find! Took a closer look at the A321 in FSX (boxed) and sure enough, there is a long standing bug! Never noticed because I've never flown the A321. An example of the ECAM controller buttons for ECAMS2 popup. (ECAMS 1 has no controller) [Window11] Background_color=0,0,0 size_mm=1024,768 position=0 visible=0 ident=503 gauge01=Airbus_A321!popup_ecams_screen_bezel, 683,415,341,353 <-- Stock example below gauge02=Airbus_A321!ecams2, 707,441,289,289 <-- Stock example below popup_ecams_screen_bezel - ... <Script> (M:Event) 'LeftSingle' scmp 0 == if{ 1 (&gt;G:Var1) 0 (&gt;L:ECAMS Display, number) } (M:Event) 'LeftRelease' scmp 0 == if{ 0 (&gt;G:Var1) } </Script> ... <Script> (M:Event) 'LeftSingle' scmp 0 == if{ 2 (&gt;G:Var1) 1 (&gt;L:ECAMS Display, number) } (M:Event) 'LeftRelease' scmp 0 == if{ 0 (&gt;G:Var1) } </Script> ... <Script> (M:Event) 'LeftSingle' scmp 0 == if{ 3 (&gt;G:Var1) 2 (&gt;L:ECAMS Display, number) } (M:Event) 'LeftRelease' scmp 0 == if{ 0 (&gt;G:Var1) } </Script> ecams2 - ... <Visibility>(L:ECAMS2 Display,number) 0 == (A:CIRCUIT GENERAL PANEL ON, bool) &amp;&amp;</Visibility> ... <Visibility>(L:ECAMS2 Display,number) 1 == (A:CIRCUIT GENERAL PANEL ON, bool) &amp;&amp;</Visibility> ... <Visibility>(L:ECAMS2 Display,number) 2 == (A:CIRCUIT GENERAL PANEL ON, bool) &amp;&amp;</Visibility> ... As you can see.. The Controller cannot even control ECAMS 2! 1 (&gt;L:ECAMS Display, number) <!-- VERSUS --> (L:ECAMS2 Display,number) 1 == Again my apologies 😥 but glad it is working for you. 👍 Roman
  13. Tom, Ahh, I see now.. I believe you will need to monitor all 3 buttons with conditions on all 3. First off, need to change the CP (compound press) to CU (compound unpress / release) then have three conditional button monitors on 3 (not 4 buttons) EX - 24=CU(-B,0)(-B,6)B,12,C65927,0 25=CU(-B,0)(-B,12)B,6,C65927,0 26=CU(-B,6)(-B,12)B,0,C65927,0 Even better, but may not work if real speedy movements are made with the rotary switch. Magneto order, with pseudo example button #s - OFF (none) --> L Mag (#1) --> R Mag (#2) --> Both (#3) --> Start (#4) So if turning things off (right to left) then all you need to monitor the unpress of #1 and make sure #2 doesn't get pressed to trigger the Mag Off. 24=CU(-B,2)B,1,C65927,0 Any of the above could be dependant on the rotary switch types - "make before break" or "break before make" and the polling speed of your hardware, just needs testing.. Roman
  14. The document needed is Modules\FSUIPC Documents\FSUIPC Lua Library.pdf with the command needed on page 10 at the top. For any lua scripting in FSUIPC this will be the "go-to" document with others as references. (... List of FSX and P3D Controls & ... Offsets Status are the main ones) If... And only if this is the only operation you want done via lua then you can get away with a "run once, self killing" lua script with no major consequences. A plus? 1 line. ipc.writeLvar("ECAMS Display", ipcPARAM) 1) copy the above code and save as 321ECAMS.lua in the modules folder 2) use the command "Lua 321ECAMS" and then the number (shown above) of the display wanted in the parameter field of the FSUIPC dialog
  15. Tom, Pete or John may intervene if I flub this up.. I believe you are getting confused in the FSUIPC document. You have his example definitions as actual code. EX.. (-jB,b0) The "-" signifies that the button is unpressed, + is pressed The jB signifies the device. If you have AutoAssignLetters=Yes then this will be a single letter, otherwise will be a number. The b# signifies the button on the said device, will be a number. Also, the last definition is the trigger, not the conditions(s) and shouldn't be in parentheses. Given AutoAssignLetters=Yes and your device is letter "D" the code, using buttons 0 & 6 as conditions (both unpressed) and 12 as the trigger - 24=CP(-D,0)(-D,6)D,12,C65927,0 Not using AutoAssignLetters and your device is number "3" the code, using buttons 0 & 6 as conditions (both unpressed) and 12 as the trigger - 24=CP(-3,0)(-3,6)3,12,C65927,0 Good luck.. Roman

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.