DaveSCUSA
Members-
Posts
191 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Gallery
Downloads
Everything posted by DaveSCUSA
-
I use two instances of MSFS with the same user id on two different computers. On is a test machine for MSFS development, periferals and Lua coding. The other is the main flying server. I share files with a local ethernet network obtaining modified files from the client and moving them to the MSFS server. Is there any way of preventing MSFS from sharing files over the cloud between the two instances?
-
Thanks. Can global variables or LVars in Lua be shared between Air Manager logic (in Lua) and FSUIPC7 Lua. FSUIPC7 compiles on the fly. Air Manager compiles when a panel is shown (executed). Does not need the sim to be running. I can figure how to code to tell when both are running.
-
Thank you John, As I said, I am using Air Manager to detect switch positions delivered to MSFS from a keypad. The AM code is from a series of AM instruments for the Diamond DA62. They are available to purchase (AU$28). For consistency, I want to use the same MSFS variables, events in the Lua used to read the keypad with keypress combinations. There is a potentiometer control but I can't figure out how to tell the control which potentiometer (glareshield and instrument). Could you point out how? The MSFS indexes show which electrical connection. Thanks
-
I have been playing with Air Manager to place monitoring of switches to a tablet, such things as starter, fuel valve, master engine, etch. These switches are being set through either Honeycomb Alpha or Bravo and an HID device. The HID device has 2 rotary switches sending forward and backward pulses. I used the Key Assignment UI to check viability. The keys section in the FSUIPC7.ini shows: 7=49,13,66058,0 -{lalt+lshift+1: Press=PANEL_LIGHTS_SET }- 8=34,13,66058,0 -{lalt+lshift+PgDn: Press=PANEL_LIGHTS_SET }- 9=37,13,66974,0 -{lalt+lshift+Left: Press=GLARESHIELD_LIGHTS_SET }- 10=39,13,66974,0 -{lalt+lshift+Right: Press=GLARESHIELD_LIGHTS_SET }- As you well know, MSFS uses indexing which can be handled in FSUIPC7 by using the ipc.execCalcCode("A:LIGHT_POTENTIOMETER:3, Percent"). Air Manager can manipulate switches on a touch screen. It also shows the status of a switch using variable subscriptions. The Air Manager Lua code to do this is: fs2020_variable_subscribe("LIGHT POTENTIOMETER:3", "Percent", --instrument/panel "LIGHT POTENTIOMETER:5", "Percent", update) --glare Air Manager uses its event management to also manipulate the MSFS events: First it sets the knob positions based on the subscribe: function update(inst, flood) --show correct knob positions inst_dim_lvl = inst[2] flood_dim_lvl = flood[1] rotate(inst_lt_knob, inst_dim_lvl * 300 - 150) rotate(flood_lt_knob, flood_dim_lvl * 300 - 150) end The update function manipulates the image. If the image on the touch screen is used, the Air Manager defined image updates the events. The panel (inst image) is defined by: --instrument light dimmer inst_lt_knob = img_add("da62 dimmer knob.png", 34, 56, 112, 112) inst_lt = dial_add(nil, 34, 56, 112, 112, function(dir) local new_val = var_cap(inst_dim_lvl + dir * 0.05, 0, 1) fs2020_event("K:PANEL_LIGHTS_SET", 1, 1) fs2020_event("K:LIGHT_POTENTIOMETER_SET", 3, new_val * 100) end) In using my HID device and its knobs, I would like to accomplish the same, left to dim the light, right to brighten the light. I'm almost certain my code will work but have doubts about enlisting a variable in an ipc.execCalcCode("code"). Here is the code I want to use. event.key(49,13,1,"PANEL_LIGHTS_SET-") --{lalt+lshift+1: Press=PANEL_LIGHTS_SET -}- event.key(34,13,1,"PANEL_LIGHTS_SET+") --{lalt+lshift+1: Press=PANEL_LIGHTS_SET +}- function PANEL_LIGHTS_SET-() panelneg = ipc.execCalcCode("A:LIGHT_POTENTIOMETER:3, Percent") panelneg = (panelneg * -1) panelneg = panelneg - 3 ipc.execCalcCode("1 (>K:PANEL_LIGHTS_SET, Bool)") ipc.execCalcCode("panelneg (>K:LIGHT_POTENTIOMETER_SET:3, Percent)") end function PANEL_LIGHTS_SET+() panelneg = ipc.execCalcCode("A:LIGHT_POTENTIOMETER:3, Percent") panelneg = panelneg + 3 ipc.execCalcCode("1 (>K:PANEL_LIGHTS_SET, Bool)") ipc.execCalcCode("panelneg (>K:LIGHT_POTENTIOMETER_SET:3, Percent)") end I use the ipc.execCalcCode due to the indexing. The glareshield light uses ipc.execCalcCode("glareneg (>K:LIGHT_POTENTIOMETER_SET:5, Percent)"). Thanks for your time.
-
Situation - shut down FSUIPC7 while MSFS is running, delete logs, make .lua or .ini changes if necessary, restart flight, restart FSUIPC7. 1. Would the restart run FSUIPC7 as a clean run? Question 2: Is there a way to assign a logging function to a button or keypress to turn on or off? While debugging a button or key press. Turn on logging. Press lua button. Use mouse to exercise same switch in the virtual cockpit. Turn logging off. Compare event, inputevent and lua log. It can be cumbersome to use the UI. Thanks
-
Thank you
-
One more question, 3. Is there a way to compile an Lua plugin outside of MSFS?
-
Two questions please: 1. Can you point me to documentation or let us know what to do if we change an Lua program or change the FSUIPC7.ini to retetst the change? Must we restart MSFS from scratch? The changes don't seem to take effect on Flight Restart or creating a new flight from the Main Menu. Time consuming to start MSFS from scratch. 2. Is there a way to eliminate all Lua traces and still display ipc.log entries? If you need more info, please let me know. Thanks
-
Couldn't find any mention in the guides. Is there a way to assign a sleep or delay to a button press in the FSUIPC7.ini. I have also read the section on compound button press. I want to sleep for 750 ms between two button presses. Thanks
-
Just a quick one. Sorry if I didn't catch you in time. Can a keypress have 2 offset conditions? 1=B66C0>0, B66C1=1 xx,yy.....
-
Saw the holiday post previously. Highly appreciated your input. Happy Christmas!
-
Thanks, wouldn't have caught the keypress controls. Don't need to use the FSUIPC added controls. I assume if you don't need a shift code just leave it and the + sign off and just use the Keycode alone. Sorry, the question was implied, why the error? I guess the answer is that "K" is not valid with keypress assignments. PS What does "JsBk" mean?
-
I didn't receive an answer from the last post above. Can a key press assignment create a keypress?
-
Hello John, It all seems to work now (at least on my test MSFS), thanks. The first time I tried the button to keypress, I received errors in attempting to send a keypress. I set offset 0x66C0 to x04 and use it as a flag to input ATC responses. I tried to use a keypress to respond. It works from my PC keyboard but an error trying to perform a keypress from a button emulating a RAlt + 1 press. I have changed the key assignments to use the ATC controls. Not as consistent in MSFS as the actual number key. [Keys] 1=48,264,x010066C0,x04 -{ralt+0: Press=offset byte set to 4, offset 66C0 }- 10=B66C0>0 53,264,K52 << ERROR 24! Line ignored >> 11=B66C0>0 53,264,x010066C0,x00 -{ralt+5: Press=offset byte set to 0, offset 66C0 }- Changed to: 1=48,264,x010066C0,x04 -{ralt+0: Press=offset byte set to 4, offset 66C0 }- 10=B66C0>0 53,264,66175,1 -{ralt+5: Press=ATC_MENU_4 }- 11=B66C0>0 53,264,x010066C0,x00 -{ralt+5: Press=offset byte set to 0, offset 66C0 }- Thanks for your input
-
Wow, thanks
-
Sorry to bother you again but I'm a bit confused how to set an Offset, especially one I define. In the Advanced Users, to use offsets with keypresses, it states: "This is normally an FS control number (as in my lists), or a special FSUIPC number for additional controls. It can be in decimal, or, preceded by ‘x’ in hexadecimal. The additional FSUIPC controls range from 1000 to 3000, and also values xcc00zzzz in hexadecimal which encode the FSUIPC “Offset” controls. See list below for full details." A bit confused by "also values xcc00zzzz in hexadecimal which encode the FSUIPC “Offset” controls". In the Adding Offset Conditions, the example used is "31=P174,10,Cx510066C0,x00030001". Not sure what "Cx5100" is. In using the Key Assignments UI (see attached graphic), I selected Offset Byte Set using offset x66C0 and a parameter of 4, expecting: 1=49,24,x010066C0,4 Instead, FSUIPC7.ini contains (Choosing Tab+2 to set a control): [Keys] 1=49,24,x01000000,x00 -{tab+1: Press=offset byte set, offset 0000 }- 2=50,24,67187,0 -{tab+2: Press=BATTERY1_SET }- As you suggested, I wanted to use this offset as a condition: 1=49,24,x010066C0,4 - [tab+0: Keypress Press=offset byte set, offset 66C0}- sets use ATC response 2=B66C0>0 50,24,K1 -{tab+1: Enter 1}- as a response to ATC 3=B66C0=0 50,24,C67090,0 -{tab+1, Press=TOGGLE_EXTERNAL_POWER}- 4=50,24,x010066C0,0 - [tab+0: Keypress Press=offset byte set, offset 66C0}- reset to no ATC . . . . . . . . . . On to 10 other buttons. I have confused myself reading in different sections of the documentation. Appendix 1 doesn't mention keypresses. Thanks
-
Thanks. Seems complicated to add key press but if they are all "called" routines, it may not be terrible. I'll try offsets.
-
I have read the User and Advanced Guides including Appendix 1. Can one treat key presses with compound programming as with buttons? E.g. in a 12 button keypad sending key press combination (settable) to Windows: 1=48,256,C1003,13 Keys RAlt+0 set Flag 13 (Button 1) 2=(F+0,13)49,256,K49 Keys RAlt+1 and Flag 13 is set, send 1 (Button 2 send 1 to ATC) 3=(F+0,13)49,256,C1004,13 Keys RAlt+1 and Flag 13 is set, reset Flag 13 (Button 2) 4=(F-0,13)49,256,Cxxxx,1 RAlt+1 If Flag 13 not set, set control to turn Ext Power On (Button 2) 5=(F-0,13)49,256,LELECT_EXT_INPUT1,4 RAlt+1 If Flag 13 not set, send 4 to aircraft input event turn on Ext Power If I knew how to turn this 12 Button keypad into a joystick, I would. Thanks
-
Thanks to the new FSUIPC7 input event logging, I've discovered that the Citation Mustang C510 inputs a control event as well as an input event with most cockpit button/switch input. I have studied the compound button assignments. Am I right that a button or two can be dependent on a previous button press? Is there a way (haven't been able to find) to have a control and an input event exercised by a single button push without Lua? It seems that both aircraft I use (C510 & DA62) have a control and input event on the same switch. At your suggestion I used the UI to assign controls to the Alpha and Bravo.
-
Is the ability to add a parameter to an input event available in the UI Assignment for Buttons & Switches any time soon?
-
Thanks
-
I am continuing to receivethese in the Log: Found 57438 InputEvent found: 'LANDING_GEAR_Gear' with hash=16178909335228778991 [type=0] Continuously showing: 61750 InputEvent received: 'LANDING_GEAR_Gear', Value=1.000000 (param='') 61781 InputEvent received: 'LANDING_GEAR_Gear', Value=1.000000 (param='') 61813 InputEvent received: 'LANDING_GEAR_Gear', Value=1.000000 (param='') 61828 InputEvent received: 'LANDING_GEAR_Gear', Value=1.000000 (param='') 61860 InputEvent received: 'LANDING_GEAR_Gear', Value=1.000000 (param='') Entered in the [General] section of FSUIPC7.ini: DontLogThese=65700,66080,66172-66181,65962,66523,65568 DontLogTheseIE=LANDING_GEAR_Gear Should there be quotes around the input event?
-
The other reason I use Lua! Although I retired as an IT executive and business consultant, I find preogramming very relaxing and rewarding. Since retiring, I have completed projects in HTML/CSS, Python, VBA, FSX XML and now FSUIPC7 Lua. Next step, native Lua.