Jump to content

How to set up toggle switches (a tutorial)


Recommended Posts

Ah. The going out of sync may be a deal breaker. But it certainly seems like a capable program. Thanks for the detailed follow up. It'll help me get started and see which I prefer.

 

The sync is pretty much impossible to deal with unless the module supports a two or 3 way toggle with individual binds. At least I know no way of dealing with that via lua if for example there's a function like G for gear up G for gear down again with no option for separate binds in the modules default LUA.

 

There was a whole kerfuffle with mig21 some months back when 1.5 first arrived where they decided to nix all the individual binds and put in toggle keys for everything which caused me a great deal of grief (and led to a great deal of protesting by me on their board to put the separate binds back).


Edited by FeistyLemur
Link to comment
Share on other sites

I hear ya. A10 is great in that regard. I mostly fly the Huey and A10, though I own all the modules sans Migs.

hsb

HW Spec in Spoiler

---

 

i7-10700K Direct-To-Die/OC'ed to 5.1GHz, MSI Z490 MB, 32GB DDR4 3200MHz, EVGA 2080 Ti FTW3, NVMe+SSD, Win 10 x64 Pro, MFG, Warthog, TM MFDs, Komodo Huey set, Rverbe G1

 

Link to comment
Share on other sites

  • 2 weeks later...

Hi all,

I have a question about multiposition switches. For example in the Mirage the radar power selector has many positions (off/standby/warm up/on) and each one has its own key binding. This is not very handy unless you have a similar switch on your hardware, which I think is rarely the case.

 

My question is, if there is way to introduce a switch to make the dial go clockwise and counterclockwise so that all positions can be accessed by a simple (on)-off-(on) switch?

A warrior's mission is to foster the success of others.

i9-12900K | MSI RTX 3080Ti Suprim X | 128 GB Ram 3200 MHz DDR-4 | MSI MPG Edge Z690 | Samung EVO 980 Pro SSD | Virpil Stick, Throttle and Collective | MFG Crosswind | HP Reverb G2

RAT - On the Range - Rescue Helo - Recovery Tanker - Warehouse - Airboss

Link to comment
Share on other sites

Well, you can use rotary switches. It can have any number of positions that you can uniquely define. So as you dial it, it will activate the correct input.

hsb

HW Spec in Spoiler

---

 

i7-10700K Direct-To-Die/OC'ed to 5.1GHz, MSI Z490 MB, 32GB DDR4 3200MHz, EVGA 2080 Ti FTW3, NVMe+SSD, Win 10 x64 Pro, MFG, Warthog, TM MFDs, Komodo Huey set, Rverbe G1

 

Link to comment
Share on other sites

Guess this tuto could be used as well for the X55 slider, and the F86F airbrakes?

Though i still have to figure out how...

Favorite modules : Huey, F-86F, F14 and P-51D

Quest 2, RTX 3080, i7 10700K, 16 Gb of RAM, Pro Flight Trainer PUMA helicopter setup, Warthog HOTAS with two force sensitive stick, custom cockpit and a GS-Cobra dynamic seat.

Link to comment
Share on other sites

I don't have X55, but for joystick functions, you can just map it within the controller setup. That would be the easiest route. Switch boxes allow you to use three state switches (Master Arm, Master Safe, Master Train) for example. So it gives you more flexibility.

hsb

HW Spec in Spoiler

---

 

i7-10700K Direct-To-Die/OC'ed to 5.1GHz, MSI Z490 MB, 32GB DDR4 3200MHz, EVGA 2080 Ti FTW3, NVMe+SSD, Win 10 x64 Pro, MFG, Warthog, TM MFDs, Komodo Huey set, Rverbe G1

 

Link to comment
Share on other sites

In fact I have figured out how to do this just yesterday.

The slider is some kind of a button, button pressed when the slider is right, button released when the slider is left.

So I have setup the saitek profile so when the button is released, it types then release the keyboard shortcut for airbrake on, and when the button is pressed, it types then release the keyboard shortcut for airbrake off.

And it works fine...

Favorite modules : Huey, F-86F, F14 and P-51D

Quest 2, RTX 3080, i7 10700K, 16 Gb of RAM, Pro Flight Trainer PUMA helicopter setup, Warthog HOTAS with two force sensitive stick, custom cockpit and a GS-Cobra dynamic seat.

Link to comment
Share on other sites

  • 2 weeks later...
There is a lot of posts with questions about the subject "how to achieve 2-position or 3-position control with 1 resp. 2 switches". And a lot of people waste their time explaining the same things over and again, albeit not always at the level of detail that might be required. I have done a few modifications in the last few months and I have documented what I learned. I'm posting this document for use by anybody who might benefit.

I'll be happy to receive suggestions for improvement or additional items.

 

I have been following along with your pdf document and I must say it is very well formatted and concise. I did run into a bit of trouble however and I am not sure if I managed to misunderstand something, or if there is something I am trying to do that is not doable.

 

I am trying to bind the "Tail Wheel Lock" system to JOY_BTN7 on my TM warthog such that when the switch is activated the tail wheel is locked and when it is not activated the tail wheel is unlocked. I have added the following code to the 'default.lua' in the Bf-109K-4:

       -- Sporn / Tail Wheel Lock
       {   down = device_commands.Button_21, cockpit_device_id = devices.CONTROLS, value_down = 1.0, name = _('Tail Wheel Lock LOCKED'), category = _('Systems')},
       {   down = device_commands.Button_21, cockpit_device_id = devices.CONTROLS, value_down = 0.0, name = _('Tail Wheel Lock FREE'), category = _('Systems')},
       {   down = device_commands.Button_22, cockpit_device_id = devices.CONTROLS, value_down = 1.0, name = _('Tail Wheel Lock (toggle)'), category = _('Systems')},
       {   down = device_commands.Button_21, up = device_commands.Button_21, cockpit_device_id = devices.CONTROLS, value_down = 1.0, value_up = 1.0, name = _('Tail Wheel Lock 2-Pos On/Off'), category = _('Systems')},

 

The last line is the new one I have added.

 

I then bound Button-7 on the TM Warthog Throttle to the new command "Tail Wheel Lock 2-Pos On/Off"

 

In game I can verify that pressing the button will activate the tail wheel lock but releasing the button does not deactivate the tail wheel lock. It just leaves it on.


Edited by Maulkin

--Maulkin

 

 

Windows 10 64-bit - AMD Ryzen 9 5900X @ 3.7 GHz - 32 GB DDR4 3600MHz RAM - EVGA FTW3 RTX 3080 - Asus Crosshair VIII Hero motherboard - Samsung EVO Pro 1 TB SSD - TrackIR 4 Pro - Thrustmaster Warthog - Saitek rudder pedals - Lilliput UM-80/C with TM Cougars

Link to comment
Share on other sites

In game I can verify that pressing the button will activate the tail wheel lock but releasing the button does not deactivate the tail wheel lock. It just leaves it on.

 

value_up needs to be 0 instead of 1. Right now, you enable the tail wheel lock when the button is pressed, then enable it again when the button is released.

Link to comment
Share on other sites

Ian;2904071']value_up needs to be 0 instead of 1. Right now' date=' you enable the tail wheel lock when the button is pressed, then enable it again when the button is released.[/quote']

Omg you right! I'm blind! Thanks so much!

--Maulkin

 

 

Windows 10 64-bit - AMD Ryzen 9 5900X @ 3.7 GHz - 32 GB DDR4 3600MHz RAM - EVGA FTW3 RTX 3080 - Asus Crosshair VIII Hero motherboard - Samsung EVO Pro 1 TB SSD - TrackIR 4 Pro - Thrustmaster Warthog - Saitek rudder pedals - Lilliput UM-80/C with TM Cougars

Link to comment
Share on other sites

  • 2 months later...

I just read the tutorial by Hans-Werner Fassbender, provided here in the forum and some entries in this thread. So i tried to assign a 2-way-toogle-switch of my warthog throttle to the gears of the Fw190D9. This is what i figuered out:

 

{down = device_commands.Button_5, cockpit_device_id  = devices.CONTROL_SYSTEM, value_down = 1.0, name = _('Landing Gear Retraction'), category = _('Systems')},
{down = device_commands.Button_7, cockpit_device_id  = devices.CONTROL_SYSTEM, value_down = 1.0, name = _('Landing Gear Extending'), category = _('Systems')},
{combos = {{key = 'JOY_BTN24'}}, cockpit_device_id = devices.CONTROL_SYSTEM, down = device_commands.Button_7, value_down = 1.0, up = device_commands.Button_5, value_up = 0.0, name = _('Fahrwerk 2-Wege-Schalter'), category = _('Systems')},

 

Unfortunatly it doesnt work. Line 1 and 2 are default. The 3rd line is mine. Any ideas how to fix that?


Edited by PicksKing

[sIGPIC][/sIGPIC]

 

Gainward RTX 2080 OC | i7 8700K OC | 32GB G.Skill RipJaws V DDR4 3600 MHz | MSI Z370-A PRO | Samsung 970 EVO 500GB

Link to comment
Share on other sites

I just read the tutorial by Hans-Werner Fassbender, provided here in the forum and some entries in this thread. So i tried to assign a 2-way-toogle-switch of my warthog throttle to the gears of the Fw190D9. This is what i figuered out:

 

{down = device_commands.Button_5, cockpit_device_id  = devices.CONTROL_SYSTEM, value_down = 1.0, name = _('Landing Gear Retraction'), category = _('Systems')},
{down = device_commands.Button_7, cockpit_device_id  = devices.CONTROL_SYSTEM, value_down = 1.0, name = _('Landing Gear Extending'), category = _('Systems')},
{combos = {{key = 'JOY_BTN24'}}, cockpit_device_id = devices.CONTROL_SYSTEM, down = device_commands.Button_7, value_down = 1.0, up = device_commands.Button_5, value_up = 0.0, name = _('Fahrwerk 2-Wege-Schalter'), category = _('Systems')},

Unfortunatly it doesnt work. Line 1 and 2 are default. The 3rd line is mine. Any ideas how to fix that?

I would try "value_up=1". Because Button_5 needs a value of 1 to raise the landing gear. (not at my PC so I cannot test it).

A warrior's mission is to foster the success of others.

i9-12900K | MSI RTX 3080Ti Suprim X | 128 GB Ram 3200 MHz DDR-4 | MSI MPG Edge Z690 | Samung EVO 980 Pro SSD | Virpil Stick, Throttle and Collective | MFG Crosswind | HP Reverb G2

RAT - On the Range - Rescue Helo - Recovery Tanker - Warehouse - Airboss

Link to comment
Share on other sites

I would try "value_up=1". Because Button_5 needs a value of 1 to raise the landing gear. (not at my PC so I cannot test it).

 

This was what I had in the first place. Makes even sense to me but didnt help either.

[sIGPIC][/sIGPIC]

 

Gainward RTX 2080 OC | i7 8700K OC | 32GB G.Skill RipJaws V DDR4 3600 MHz | MSI Z370-A PRO | Samsung 970 EVO 500GB

Link to comment
Share on other sites

This was what I had in the first place. Makes even sense to me but didnt help either.

That is strange! Is any button moving when you flip your toggle switch back and forth?

(And just to make sure, did you retract the safety cover? I sometimes forget that ;))

A warrior's mission is to foster the success of others.

i9-12900K | MSI RTX 3080Ti Suprim X | 128 GB Ram 3200 MHz DDR-4 | MSI MPG Edge Z690 | Samung EVO 980 Pro SSD | Virpil Stick, Throttle and Collective | MFG Crosswind | HP Reverb G2

RAT - On the Range - Rescue Helo - Recovery Tanker - Warehouse - Airboss

Link to comment
Share on other sites

That is strange! Is any button moving when you flip your toggle switch back and forth?

(And just to make sure, did you retract the safety cover? I sometimes forget that ;))

 

No switches are moving. Thats what I try to make work. If they would, I wouldnt have any problem :)

 

When I set value_up = 1.0, the regarding line in control menu is marked red. So even the software has trouble with the syntax.

[sIGPIC][/sIGPIC]

 

Gainward RTX 2080 OC | i7 8700K OC | 32GB G.Skill RipJaws V DDR4 3600 MHz | MSI Z370-A PRO | Samsung 970 EVO 500GB

Link to comment
Share on other sites

No switches are moving. Thats what I try to make work. If they would, I wouldnt have any problem :)

Well, at least the extend "aus'" button should work (when it is not depressed), because your line is essentially the same as the original in that regard.

When I set value_up = 1.0, the regarding line in control menu is marked red. So even the software has trouble with the syntax.

That is also strange. I had many times the wrong value in my code at first but never saw that this is causing the corresponding line to be marked red :dunno:

  • Like 1

A warrior's mission is to foster the success of others.

i9-12900K | MSI RTX 3080Ti Suprim X | 128 GB Ram 3200 MHz DDR-4 | MSI MPG Edge Z690 | Samung EVO 980 Pro SSD | Virpil Stick, Throttle and Collective | MFG Crosswind | HP Reverb G2

RAT - On the Range - Rescue Helo - Recovery Tanker - Warehouse - Airboss

Link to comment
Share on other sites

Well I found the solution for the gears of the Dora9:

 

{down = device_commands.Button_5, cockpit_device_id  = devices.CONTROL_SYSTEM, value_down = 1.0, name = _('Landing Gear Retraction'), category = _('Systems')},
{down = device_commands.Button_7, cockpit_device_id  = devices.CONTROL_SYSTEM, value_down = 1.0, name = _('Landing Gear Extending'), category = _('Systems')},
{down = device_commands.Button_7, up = device_commands.Button_5, cockpit_device_id = devices.CONTROL_SYSTEM, value_down = 1.0, value_up = 1.0, name = _('Fahrwerk 2-Wege-Schalter'), category = _('Systems')},

 

Now it works as long as the security cover is opened. Now I will try to combine both commands (gear up and cover open) in one single command.

  • Like 1

[sIGPIC][/sIGPIC]

 

Gainward RTX 2080 OC | i7 8700K OC | 32GB G.Skill RipJaws V DDR4 3600 MHz | MSI Z370-A PRO | Samsung 970 EVO 500GB

Link to comment
Share on other sites

I just read the tutorial by Hans-Werner Fassbender, provided here in the forum and some entries in this thread. So i tried to assign a 2-way-toogle-switch of my warthog throttle to the gears of the Fw190D9. This is what i figuered out:

 

{down = device_commands.Button_5, cockpit_device_id  = devices.CONTROL_SYSTEM, value_down = 1.0, name = _('Landing Gear Retraction'), category = _('Systems')},
{down = device_commands.Button_7, cockpit_device_id  = devices.CONTROL_SYSTEM, value_down = 1.0, name = _('Landing Gear Extending'), category = _('Systems')},
{combos = {{key = 'JOY_BTN24'}}, cockpit_device_id = devices.CONTROL_SYSTEM, down = device_commands.Button_7, value_down = 1.0, up = device_commands.Button_5, value_up = 0.0, name = _('Fahrwerk 2-Wege-Schalter'), category = _('Systems')},

Unfortunatly it doesnt work. Line 1 and 2 are default. The 3rd line is mine. Any ideas how to fix that?

 

value_up for device_commands.Button_5 must be = 1.0. So the added line should read:

{combos = {{key = 'JOY_BTN24'}}, cockpit_device_id = devices.CONTROL_SYSTEM, down = device_commands.Button_7, value_down = 1.0, up = device_commands.Button_5, value_up = 1.0, name = _('Fahrwerk 2-Wege-Schalter'), category = _('Systems')},

 

I didn't have a chance to try, but it should work.

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

Well I found the solution for the gears of the Dora9:

 

{down = device_commands.Button_5, cockpit_device_id  = devices.CONTROL_SYSTEM, value_down = 1.0, name = _('Landing Gear Retraction'), category = _('Systems')},
{down = device_commands.Button_7, cockpit_device_id  = devices.CONTROL_SYSTEM, value_down = 1.0, name = _('Landing Gear Extending'), category = _('Systems')},
{down = device_commands.Button_7, up = device_commands.Button_5, cockpit_device_id = devices.CONTROL_SYSTEM, value_down = 1.0, value_up = 1.0, name = _('Fahrwerk 2-Wege-Schalter'), category = _('Systems')},

Now it works as long as the security cover is opened. Now I will try to combine both commands (gear up and cover open) in one single command.

I'm curious. What made it work in the end? The line you quote now is essentially the same as before with the exception that the combos part is removed and value_up=1. Was your joystick button 24 already assigned to some other command? If so that might explain that the new command was highlighted red.

Anyway, great that it is working now! :thumbup:

A warrior's mission is to foster the success of others.

i9-12900K | MSI RTX 3080Ti Suprim X | 128 GB Ram 3200 MHz DDR-4 | MSI MPG Edge Z690 | Samung EVO 980 Pro SSD | Virpil Stick, Throttle and Collective | MFG Crosswind | HP Reverb G2

RAT - On the Range - Rescue Helo - Recovery Tanker - Warehouse - Airboss

Link to comment
Share on other sites

value_up for device_commands.Button_5 must be = 1.0. So the added line should read:

{combos = {{key = 'JOY_BTN24'}}, cockpit_device_id = devices.CONTROL_SYSTEM, down = device_commands.Button_7, value_down = 1.0, up = device_commands.Button_5, value_up = 1.0, name = _('Fahrwerk 2-Wege-Schalter'), category = _('Systems')},

 

I didn't have a chance to try, but it should work.

 

Already found the solution. thx :)

 

 

 

I'm curious. What made it work in the end? The line you quote now is essentially the same as before with the exception that the combos part is removed and value_up=1. Was your joystick button 24 already assigned to some other command? If so that might explain that the new command was highlighted red.

Anyway, great that it is working now! :thumbup:

 

No its not. This time I excluded the "combos".

I am pretty new in this topic and I bet I wouldnt even get a "hello world" from c++ if somebody put a gun on my head but I guess the combos-command is not made for all cases.

 

I tried "combos" for the throttle start/idle position and it worked perfectly fine.

[sIGPIC][/sIGPIC]

 

Gainward RTX 2080 OC | i7 8700K OC | 32GB G.Skill RipJaws V DDR4 3600 MHz | MSI Z370-A PRO | Samsung 970 EVO 500GB

Link to comment
Share on other sites

The "combos" part was not the problem. If you include it you define a default control binding (in this case the "EAC") to the command. You can override that assignment in the control bindings screen. If you don't include the combos statement you need to define a control binding for it.

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

  • 2 weeks later...

really great stuff; to bad it is not working anymore. you would think that since this is a game made for hard core pilots, you will be able to use your high end throttle and stuff. I really hope ED will consider looking in to this issue sometime soon.

[sIGPIC][/sIGPIC]

i7 5820K, 32GB DDR4, 3x250GB SSD RAID0, nVidia GTX 1080, Thrustmaster Warthog Throttle, Virpil WarBird base with Thrustmaster Warthog grip, MFG Crosswind rudder pedals - 2484.

Link to comment
Share on other sites

What's not working anymore? It's working here. If you updated to the latest version of 1.5 without precaution, of course all modified files are overwritten with the original data.

I use OvGME to back out the modified files before an update, and then push them back in after the update.

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

no, i had a clean install got some new modules to celebrate my return to the game, and I wanted to map some switches for L39, Mig21 but nothing works. The reason for that is because now they count "1" for joybtn_20 down for example, and there is no input for joybtn_20 up to map "0" to anything. If I try to use something like {combos = {{key = "JOY_BTN20"}, }, down = 3002, up = .... etc, game will not see the file as working lua file, so I use whatever I can from my warthog, but it is really a missed opportunity, and I hope they will give us a way to map switches in the future.


Edited by Cotoi

[sIGPIC][/sIGPIC]

i7 5820K, 32GB DDR4, 3x250GB SSD RAID0, nVidia GTX 1080, Thrustmaster Warthog Throttle, Virpil WarBird base with Thrustmaster Warthog grip, MFG Crosswind rudder pedals - 2484.

Link to comment
Share on other sites

Cotoi,

 

Try adding new commands at start of list, create a "Alternate xxx" category

 

 

--return {

keyCommands={

--Alternate Gear (example)

Add new command there

 

New install of 1.55 there too and no success in edit exiting commands be know methods, game don't recognize the added part an remove all keys mapped in this category, example

"GEARS, G. Brakes and Drag chute ".

 

Create new command (unique name) under "Alternate" work.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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