jaxx Posted September 4, 2020 Report Posted September 4, 2020 Here is my solution to map all toggle switches on the Honeycomb Alpha via FSUIPC to prevent the bugs that happen when always-on switches are bound in the game itself. Landing lights and strobes can be mapped directly to on/off, all other toggles require special handling in the lua script. Some notes on the special handling: State of a single battery can not be read. Only the master state which is 1 when at least one battery is on. This means if the switch is in the off position and at least one battery is on, switching the switch on will not switch the remaining batteries on. But after one on/off cycle the switches should be synced. Alternator should work correctly, toggling only those which are not already in the new state. For avionics 1+2 there are no separate controls, so 4 keyboard keys must be mapped in the sim itself for 1&2 and on&off and then the lua script will send those buttons when the switch is pressed. The lights beside landing & strobes need to be set via offset. Setting them via the FS controls leads to a race condition between reading the offsets and executing the controls when switching the toggle switch very fast. As half of the magneto states are out of the standard 32-button range the remaining states have to be polled via the lua script. But putting those and virtual buttons and then just mapping those and the real buttons to the controls does not work correctly. There will be a race condition where, when quickly switching from the virtual button part to the real button part the virtual button will be registered later putting it in the wrong position (e.g. quickly turn from "BOTH" to "R", the dial will in some cases jump back to "L", because the virtual button of "L" is registered or handled after the real button of "R"), even when polling every 1ms. Because of that instead of mapping directly to the pressed button I only register a magneto change and then determine which button is currently in the pressed state, starting with the real buttons to avoid the race condition. FSUIPC7.ini (partial) AlphaToggles.lua 1
Pete Dowson Posted September 4, 2020 Report Posted September 4, 2020 3 hours ago, jaxx said: Here is my solution to map all toggle switches on the Honeycomb Alpha via FSUIPC to prevent the bugs that happen when always-on switches are bound in the game itself. It might be worth posting this on the User Contributions subforum, as a worthwhile reference. You'd need to amend the title to indicate MSFS specifically though, for clarity! Thanks! Pete
John Dowson Posted September 4, 2020 Report Posted September 4, 2020 4 hours ago, jaxx said: State of a single battery can not be read. Only the master state which is 1 when at least one battery is on. This means if the switch is in the off position and at least one battery is on, switching the switch on will not switch the remaining batteries on. But after one on/off cycle the switches should be synced. Yes - the same issue occurs with avionics 1/2. 4 hours ago, jaxx said: For avionics 1+2 there are no separate controls, so 4 keyboard keys must be mapped in the sim itself for 1&2 and on&off and then the lua script will send those buttons when the switch is pressed. For avionics, the Avionics Master Set control works, but the toggle control not. I have updated the relevant offset to use the set control (but not yet released). There is a separate post on this issue. 4 hours ago, jaxx said: Setting them via the FS controls leads to a race condition between reading the offsets and executing the controls when switching the toggle switch very fast. This sounds strange. I will take a look. 4 hours ago, jaxx said: all other toggles require special handling in the lua script. Shouldn't be necessary really. I'll take a look and see whats happening... Thanks for the report. John
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now