Control of 2-way switches in DCS World

With much of The Hangar interior now decorated I have (at last!) been able to work on the HFS Spitfire prototype cockpit again. It has been hugely satisfying to see her come back to life. It’s also gratifying to know that the move from South Africa by road and on the high seas, with a further 8 months in storage, have not had a detrimental effect. Everything still works beautifully!

My first task last week was to change the two Arduino Mega boards to two Leo Bodnar Joystick (LB) cards. Previously I had used the two Arduino’s to run DCSbios. That program works very nicely but exclusively with DCS World. The LB’s are necessary to give the flexibility to run the simulator cockpit in other simulation programs, notably the HFS/FlyingIron Spitfire in X-Plane and MSFS2020.

The co-developed HFS / FlyingIron Spitfire in MSFS2020

For this I had to redo the wiring from the terminal block in the front to go into their assigned positions on the LB’s. What I had not anticipated was the 2 way switches, which I had managed to get working so nicely in DCSbios, were no longer being seen properly. It is unfortunately the case that DCS World cannot judge by itself whether a switch is on or off. It requires a signal to tell it that something has happened. This means that when a switch is ON and then turned OFF, nothing happens. Only when a switch is turned from OFF to ON will it pick up the change. So if you start up the simulator in “Cold and dark” format with for instance the Magneto switch in the ON position, it will show the switch as Off. Now if you switch the switch OFF, it will still show Off in the sim. Switch to ON and the sim now knows the switch is On. Switch it OFF and the sim still shows ON. In order to show the switch as OFF you now need to switch to ON again and so forth. HORRIBLE!

In order to cure this I tried various offerings, including vJoy which creates a virtual joystick which then needs to be controlled by something else again for the correct keypresses, in my case I tried Joystick Gremlin. In spite of some excellent tutorials in the DCS World user groups, for which I am very grateful, and some careful programming, I could not get it to work properly.

I am therefore most grateful to Avantar for having created RS Mapper! It runs in the background and recognises the current switch position and provides a very simple way of assigning keyboard presses to the change of a switch status. In DCS World it is possible to assign keyboard commands for say that magneto switch used in the example above. So within RS Mapper I would set Button 7 on the Leo Bodnar card 1 to [RCtrl-R] when the button is released (the switch is switched OFF) and [RCtrl-T] when the switch is switched to ON. In DCS World for the Spitfire control settings I would assign (RCtrl-R] to the keyboard action of “Magneto No.1 OFF” and [RCtrl-T] to the keyboard actions of “Magneto No.1 ON”.

As you can see you still need an action to determine the key position within DCS World. So if the switch is OFF and you do a cold and dark start the switch is also off in DCS. Turn the switch ON and you will see it turn On in DCS. If the switch happens to be OFF when you start off in flight, the switch will be On in DCS. If you then switch ON the switch will at least remain On in DCS and from there get back into sync.

Hopefully someday EagleDynamics will be able to take the hint and have a chat with Avantar to ask him how he did his code, it would be so much nicer having the functionality built into the sim than always having to find workarounds. In the meantime, I hope this helps others.

That said, it’s great to be back in the air in the HFS Simulator!

Leave a Reply

Your email address will not be published. Required fields are marked *

2 × two =

This site uses Akismet to reduce spam. Learn how your comment data is processed.