Jump to content

Interesting toggle switch behavior using .lua mods.


Recommended Posts

Okay, not totally sure the title is going to help with this. So, I've been creating toggle commands in my input.luas using this awesome tutorial https://forums.eagle.ru/forum/english/dcs-world-topics/input-and-output/87627-how-to-set-up-toggle-switches-a-tutorial

It has worked beautifully on almost every module I have. I have, however, noticed a couple of switches that only function properly when the plane is cold and dark. Both the Launch Bar switch in the Hornet, and the Pitch A/P Switch in the Viper. I'm wondering if anyone else has seen something similar. When cold and dark the LB Switch works as advertised. I put the switch up, it goes up. Flip it down, down. When the plane is running, I have to toggle the switch like I would if it were on the standard binding. On the Viper's A/P Pitch I have all 3 positions mapped for a on-off-on 3 pos switch. When cold, it cycles perfectly. When hot, I can set the Alt hold on, and that's it. The other positions stop responding. So, is it just my setup or have others doing this had similar issues?

Why is the rum always gone!?!?!?!

Link to comment
Share on other sites

Those switches are solenoid-held. Keeping them in a particular position requires electricity or they leave that position due to a spring. How the switches respond due to your input depends on how they are coded and what your input is.

 

The launch bar switch should only stay on if electricity and computer logic allows. If you've bound that to something with a constant output then what's happening is your pilot finger is holding that switch against the spring forever. It's possibly better whenever you can to map a "pulse" to turn that switch on and let it fall off if the solenoid doesn't hold.

 

The -16 AP pitch switch for example would need to be told to move to the middle position. Releasing the non-neutral position input isn't sufficient for the switch to fall off unless the solenoid is deenergized (e.g. battery off or the other computer logic that deenergizes).

 

It would help to know exactly what controller and button you are using for input.

Link to comment
Share on other sites

Of course, that makes sense. Thanks. I'm using a normal Single Pole/Single Throw for the LB switch and an SP/Double Throw for the AP switch. Both are wired to a GPWiz 40 joystick encoder board as normal dx inputs. The only one that is really annoying is the AP switch. If all else fails I'll just bind them to some buttons I have on my switch box instead of switches if I can't find a command combo that will work.

Why is the rum always gone!?!?!?!

Link to comment
Share on other sites

I have added these 2 lines of code to "default.lua" and the 3-position switch works both "cold" and "hot".

{down = control_commands.ApPitchAlt_EXT, up = control_commands.ApPitchAlt_EXT, cockpit_device_id = devices.CONTROL_INTERFACE, value_down = 1.0, value_up = -1.0, name = _('Autopilot PITCH Switch ALT HOLD/OFF'), category = {_('Instrument Panel'), _('FLCS')}},
{down = control_commands.ApPitchAtt_EXT, up = control_commands.ApPitchAlt_EXT, cockpit_device_id = devices.CONTROL_INTERFACE, value_down = -1.0, value_up = -1.0, name = _('Autopilot PITCH Switch ATT HOLD/OFF'), category = {_('Instrument Panel'), _('FLCS')}},

F/A-18C launchbar :

{down = gear_commands.LaunchBarSw, up = gear_commands.LaunchBarSw, cockpit_device_id = devices.GEAR_INTERFACE, value_down =  -1.0, value_up = 1.0,    name = _('Launch Bar Control 2-Pos Switch RETRACT/EXTEND'), category = {_('Left Vertical Panel')}},

 

Note I posted a tutorial document here: https://forums.eagle.ru/forum/englis...47#post4199747

LeCuvier

Windows 10 Pro 64Bit | i7-4790 CPU |16 GB RAM|SSD System Disk|SSD Gaming Disk| MSI GTX-1080 Gaming 8 GB| Acer XB270HU | TM Warthog HOTAS | VKB Gladiator Pro | MongoosT-50 | MFG Crosswind Pedals | TrackIR 5

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...