Jump to content
The simFlight Network Forums

John Dowson

Members
  • Posts

    13,254
  • Joined

  • Last visited

  • Days Won

    270

Everything posted by John Dowson

  1. As I said, not all simvars (a-type variables) are settable directly. The MSFS SDK lists the available simvars and their settable status, but this one is not documented, so is probably settable. This is why the presets only read this simvar and use the k-type variable, which is an event or control, to update. As simvars can also be updated by sending the appropriate event. instead of updating directly, why not use: ipc.execCalcCode("50 (>K:2:LIGHT_POTENTIOMETER_SET)") John
  2. In the first ini you posted, you had this: This will run SerialFP2 straight away which will grab the port and prevent FSUIPC from opening it - although I no longer see this in your latest ini. Please read the Appendix Handling VRInsight serial devices in FSUIPC in the Advanced User guide for details on setting up your VRInsight device. Ok, great - what was the issue? John
  3. I think such buttons can cause issues when assigned in MSFS as you would get continual button press events, but this shouldn't be a problem when assigned in FSUIPC as it handles repeat button presses differently - it will only repeat the press when asked and will repeat at the rate configured until a button release is seen. John
  4. I think the ButtonRepeat (and PollInterval) parameters are only read from the general (none-profile) section, as general button assignments are inherited (unless overwritten) in a profile. There can only be one repeat rate set for all button assignments. John
  5. There are two presets for this: A32NX_OH_INTEG_LIGHT_INC and A32NX_OH_INTEG_LIGHT_DEC. Why don't you use them? This is the calculator code for the inc: (A:LIGHT POTENTIOMETER:86,percent) 5 + 100 min 86 (>K:2:LIGHT_POTENTIOMETER_SET) So it using index 86 (not 84), and reading the value from the simvar but using the event to set it. See the HubHop site if you haven't already (https://hubhop.mobiflight.com/presets/). You can assign directly to MF presets in FSUIPC7. Make sure that you are using the latest version (7.3.23) as this has an additional facility/button (Find Preset) that makes finding presets a lot easier. Please see the Advanced User guide on using presets. And for the glareshield (which uses 84), these presets are available: A32NX_LIGHTS_GLARESHIELD2_INC, A32NX_LIGHTS_GLARESHIELD2_DEC, A32NX_LIGHTS_GLARESHIELD2_PERCENT The last one is output only, and just reads the simvar LIGHT POTENTIOMETER:84. John
  6. Your axis goes from 16383 to -16384, this code (in Revers Polish Notation, or RPN) '@ 16384 + 327.68 /' takes the input ('@'), adds 16384 ('@ 16384 +'), giving a range of 32768-0, and then divides the result by 327.68 ('327.68 /'), giving a range of 100-0. so it converts the range +16383 to -16384 to +100 to 0. You could try reversing the axis, i.e. add '-1 * ('@ -1 * 16384 + 327.68 /....'). What do you see in the outside view - can you see the spoilers extending and retracting with your lever? The movement will not be linear, as the preset sets the position according to those custom controls: down, arm, 50%, FLT_DET, Up. You can adjust the numbers in the preset code (5, 10, 50, 70, 95) to change the position for each of those positions. I have finished now - I can look into this further over the weekend if you are still having difficulties.
  7. This one is for 'having multiple if-statements in one file'.... I don't mind helping out with lua questions, but I am no lua expert. I support FSUIPC really, not lua. FSUIPC includes a lua interpreter, but for non-fsuipc related lua questions, you should refer to the available lua resources on the web. That is what I do when I get asked such questions... John
  8. Should be: speed = getnumbersfromtext(spdstate) You have to pass the text into the function... And you would normally define your functions at the top of the script.
  9. Note the preset is using the following PMDG custom controls via the ROTOR Brake method: #define EVT_CONTROL_STAND_SPEED_BRAKE_LEVER (THIRD_PARTY_EVENT_ID_MIN + 679) #define EVT_CONTROL_STAND_SPEED_BRAKE_LEVER_DOWN (THIRD_PARTY_EVENT_ID_MIN + 6791) #define EVT_CONTROL_STAND_SPEED_BRAKE_LEVER_ARM (THIRD_PARTY_EVENT_ID_MIN + 6792) #define EVT_CONTROL_STAND_SPEED_BRAKE_LEVER_50PCT (THIRD_PARTY_EVENT_ID_MIN + 6793) #define EVT_CONTROL_STAND_SPEED_BRAKE_LEVER_FLT_DET (THIRD_PARTY_EVENT_ID_MIN + 6794) #define EVT_CONTROL_STAND_SPEED_BRAKE_LEVER_UP (THIRD_PARTY_EVENT_ID_MIN + 6795) You can achieve the same as the preset by sending these custom controls when entering an axis range, using the right-hand side of the axis assignment dialog, if you prefer. See the FAQ section on how to use custom controls for PMDG aircraft. John
  10. Thats strange, as I can see it moving here. Note also that there is the Axis Spoilers Set control. However, this control doesn't work well for the spoilers in the PMDG 737, There is a preset available for assigning an axis to spoilers in the 737: PMDG B737 Spoiler Lever Set However, this preset is not in the events.txt file for some reason. You can add this to your myevents.txt file (create this file if it doesn't exist) and add this preset to this file: Note I have changed this from the MF preset as my axis goes from -16384 to +16383 - you can adjust these values to suit your axis range (highlighted in bold above) Once you have added this preset to the myevents.txt file, restart FSUIPC7. You can then assign to this preset by checking Send Preset to FS box and then selecting the preset from the drop-down.
  11. Could you explain what you are trying to achieve? Which aircraft and what function? Have you looked to see if there is already a preset available?
  12. But you don't have any flap detents configured (no FlapStarts and FlapEnds entries) although you have flap detents active, and why are you also sending flaps inc/dec controls in the flaps axis range: ? Your aileron and throttle assignments also have range settings which also seem strange... And I am still confused by this profile: ?
  13. Can you switch to using 'Send to FS as normal axis' and generate a log file with Axes Controls logging enabled, then load your aircraft and slowly move the assigned spoiler lever through its full range and back. Then exit FSUIPC7 and show me/attach your FSUIPC7.log and FSUIPC7.ini files. Do you have any assignments in MSFS? If so, please check if the spoilers are also assigned there,
  14. Slower, as that is 5 repeats per second as opposed to 8....the default is 20... From the Advanced User guide: If you want more control over the trim speed, you should use the trim offset, not change the repeat rate. See (for example): John
  15. See the following: Output: 1734078 LUA.15: SPD240: 240 1734094 LUA.15: MACH 0.78: 0.78 1734110 LUA.15: MACH 1.78: 1.78
  16. Do your only issue is the extraction of the number from the MACH string? As you have another topic on this issue (although I don't know why - seems strange looking at the the same script in two separate threads.,.,) I will respond there.
  17. This is because it contains a comma not a full stop - MACH 0,78 not MACH 0.78 - or was that a typo? If it is a comma, you could try replacing that with a full stop first.... And as with your other post, try adding some logging statements to determine what is happening.... John
  18. It is not necessary, as if string.find was true then the first test (string.find(spdstate, "---") and string.find(spdstate, "*")) would be have been true... Add some logging statements , e.g. If you test with the console window open, this should tell you what is happening.... I think the issue is that the * character has a special meaning (match 0 or more repetitions) and needs to be escaped - maybe string.find(spdstate, "%*")? John
  19. Both of the FSUIPC6.ini and FSUIPC6.log files are in the FSUIPC6 installation folder. If you don't know where that is, use the Open Folder button in the Logging tab. If you cannot see the extensions (.log, .ini), then you have windows explorer set to hide the extensions of known file types, and you need to change this. This is described in the Installation and Registration guide if you have any difficulties. No point in me looking at those files as I do not know which one is being used. Please just attach one .log and one .ini, both from your FSUIPC6 installation folder.
  20. You have multiple sections for various entries - Axes, JoyNames, AutoSave, ... Not sure why this happened but can cause issues as you do not know which section is being used. I have cleaned this up for you in the attached. Could you please download and use/check this (back-up/rename your current one first). For the AutoSave, you had two sections, one where active and one where disabled - I have kept the active one, so you may want to disable if not using this. I have also activated the JoyLetters facility to prevent issues if your joystick ids change. You have one profile that I am confused about: Is this for that specific variant only? If not, and you want to use this profile for all PMDG 777s then change this to: (I have not changed this!) You have a profile specific axes section for that profile, but your calibration is not profile-specific. Probably better to make this profile-specific if using the profile-specific axes. But the flap calibration does look ok on a first glance, so not sure what is going on. I will look further, but first can you try the attached ini, and make your calibration profile specific if using a profile for the 777. Then, activate logging for Axes Controls, and generate a short log file where you load the PMDG 777 and move the flaps lever through each of its detents, ending with full flaps. Then exit, show me/attach your FSUIPC7.ini and FSUIPC7.log files (the latter may need compressing/zipping) and tell me what you saw in the VC, i.e. if the flaps lever moved to the detent corresponding to your actual lever. Thanks. FSUIPC6.ini
  21. These controls don't work! To change the view, you have to update the CAMERA STATE and CAMERA SUBSTATE variables. The only way to do this in the current release is via using presets. However, in the next version I will make the CAMERA STATE offset 0x026D writeable, and I will also add CAMARE SUBSTATE to offset 0x026E as 1 (unsigned) byte CAMERA VIEW TYPE AND INDEX:0 to offset 0x026F as 1 (unsigned) byte CAMERA VIEW TYPE AND INDEX:1 to offset 0x0270 as 1 (unsigned) byte GAMEPLAY CAMERA FOCUS to offset 0x0271 as 1 (unsigned) byte all as writeable. I have attached a beta version, 7.3.24a, which contains this update. Using this version, you can assign a button to the control Offset Byte Set using offset 026D with a parameter of 3 (external/chase). You can then overload this button assignment (via editing the FSUIPC7.ini file) to also send a parameter of 2 (cockpit), and add an offset condition so that the correct parameter is send depending on the current value of offset 0x026D. The resulting assignments should look like the following (the index number. joystick letter and button number may be different): 9=B026D=2 PS,2,Cx0100026D,x03 -{offset byte set, offset 026D}- 10=B026D!2 PS,2,Cx0100026D,x02 -{offset byte set, offset 026D}- The button will then toggle between external and cockpit view. You can add more assignments if you want to cycle between more views, e,g, to also cycle between showcase mode (9): 9=B026D=2 PS,2,Cx0100026D,x03 -{offset byte set, offset 026D}- 10=B026D=3 PS,2,Cx0100026D,x09 -{offset byte set, offset 026D}- 11=B026D=9 PS,2,Cx0100026D,x02 -{offset byte set, offset 026D}- You can also change views/cameras using offsets 0x026E (CAMARE SUBSTATE) and 0x026F/0x0270 (CAMERA VIEW TYPE AND INDEX) - please see the SDK documentation on these variables: https://docs.flightsimulator.com/html/Programming_Tools/SimVars/Camera_Variables.htm Otherwise, check out the available MF presets, which use the CAMERA STATE and CAMARE SUBSTATE variables: CAMERA_ACTION_COCKPIT_VIEW_RESET CAMERA_ACTION_COCKPIT_VIEW_SAVE External_Quick_View_-_Quick_View_1 External_Quick_View_-_Quick_View_2 External_Quick_View_-_Quick_View_3 External_Quick_View_-_Quick_View_4 External_Quick_View_-_Quick_View_5 External_Quick_View_-_Quick_View_6 External_Quick_View_-_Quick_View_7 External_Quick_View_-_Quick_View_8 External_View_-_Default Fixed_Camera_ShowCase_-_Fin_View Fixed_Camera_ShowCase_-_Front_Cabin_Crew_Seat Fixed_Camera_ShowCase_-_Front_Left_Door_Enter Fixed_Camera_ShowCase_-_Front_Right_Middle_Seat Fixed_Camera_ShowCase_-_Left_Engine Fixed_Camera_ShowCase_-_Left_Wing_Window_ Fixed_Camera_ShowCase_-_Left_front_Window Fixed_Camera_ShowCase_-_Nose_gear Fixed_Camera_ShowCase_-_Passanger_Look_Aft Fixed_Camera_ShowCase_-_Passanger_look_Forward Fixed_Camera_ShowCase_-_Rear_Left_Middle_Seat Fixed_Camera_ShowCase_-_Rear_Top_View Fixed_Camera_ShowCase_-_Right_Engine Fixed_Camera_ShowCase_-_Right_Wing_Window Fixed_Camera_ShowCase_-_Right_front_Window Fixed_Camera_ShowCase_-_Underbelly_Close Fixed_Camera_ShowCase_-_Underbelly_Far Free_Camera_-_Camera_Drone Instrument_View_-_CB_WALL Instrument_View_-_Dual_MCDU_Cap___FO Instrument_View_-_EFB_CAPTAIN Instrument_View_-_EFB_FO Instrument_View_-_FCU_and_ECAM__Angled_ Instrument_View_-_MCDU_Captain Instrument_View_-_OVERHEAD__Angled_ Instrument_View_-_PEDESTAL__Angled_ Instrument_View_-_PFD_ND Instrument_View_-_UPPER_OVERHEAD Pilot_View_-_Close Pilot_View_-_Copilot Pilot_View_-_Landing Pilot_View_-_Normal Quick_View_-_Front__Zoom_in_ Quick_View_-_Left_120_Degree Quick_View_-_Left_45_Degree Quick_View_-_Left_90_Degree Quick_View_-_Rear_180_Degree Quick_View_-_Right_120_Degree Quick_View_-_Right_45_Degree Quick_View_-_Right_90_Degree John FSUIPC7.exe
  22. You can use 'if ( not( string.find...' - but you shouldn't need this o combine them: John
  23. Yes, sorry, missed that... That surprises me though, for the reasons previously mentioned...
  24. You can try assigning to the standard view controls: Next View, Prev View, View Mode, Next Sub View, Prev Sub View. There are also now quite a view presets available for setting specific views.:
  25. That is the type of the value you are setting, and should probably be Percent not Number in this case, i.e. ipc.execCalcCode("50 (>A:LIGHT POTENTIOMETER:84, Percent)"), or you could use Percent over 100 and adjust the parameter, e.g. ipc.execCalcCode("0.5 (>A:LIGHT POTENTIOMETER:84, Percent over 100)"). See the following page for a list of simulator variable units: https://docs.flightsimulator.com/html/Programming_Tools/SimVars/Simulation_Variable_Units.htm Note that it may not be possible to set this value directly for this particular variable, or it may be settable but setting this may not have the desired affect. You would normally use the control (or K-type variable)LIGHT_POTENTIOMETER_SET (with an appropriate index) to change this.. For example, this is the calculator code to increase the panel brightness in the Bonanza G36: (A:LIGHT POTENTIOMETER:3, Percent) 1 + 100 min 3 (>K:2:LIGHT_POTENTIOMETER_SET) You can refer to the SDK documentation to see if a variable is settable (as well as its type). However, some variables - including LIGHT POTENTIOMETER, don't seem to be documented.
×
×
  • 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.