Jump to content

On-On Switches


iVVChewy9141VVi

Recommended Posts

On-on you can use without editing lua, but you can use only 16 with BU0836X (each switch connected to two BU0836X inputs, one for on position second for off position + ground).

 

I strongly recommend to use on-of system and editing lua, look here for details. You can use all 32 inputs with this system...

 

btw. for on-off you can use switches what you already had, but connected only to one input :)

[sIGPIC][/sIGPIC]

Building FW190D pit ,,To Dora with love" http://forums.eagle.ru/showthread.php?t=132743

Link to comment
Share on other sites

  • 8 months later...

Not for SPST (on/off) switches. It just takes one, plus ground. But the OP was talking about DPST on-off-on switches. For DCS to use that, you have to use up two (for both on's) and ground. And you have to edit the LUA files to make use of it.

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

You nod not need need to edit lua files for leobodnar boards to work with dcs.just connect wires between switches and boards and assign Keyes to dcs.That I ask is if I can with one switch on-off open and close apu(for example) so I do not need to use to two slots from leobodnar.Cause if I have on/on switches I have 16 buttons not 32.and I am trying to find a way to take advantage of the 32 buttons.

[sIGPIC][/sIGPIC]

Link to comment
Share on other sites

You nod not need need to edit lua files for leobodnar boards to work with dcs.just connect wires between switches and boards and assign Keyes to dcs.That I ask is if I can with one switch on-off open and close apu(for example) so I do not need to use to two slots from leobodnar.Cause if I have on/on switches I have 16 buttons not 32.and I am trying to find a way to take advantage of the 32 buttons.

 

I believe we are saying the same thing. Except you do need to edit LUA if you want to use on-off-on and have it act like a three position switch MASTER ARM, SAFE, TRAIN (in A10). DCS has to be told that the "off" in the middle of on-off-on DPST switch should act like SAFE.


Edited by hansangb

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

That I ask is if I can with one switch on-off open and close apu(for example) so I do not need to use to two slots from leobodnar.

 

No, because BU0836 firmware only send commands when a (ON-OFF) switch change status from OFF to ON, not when change from ON to OFF.

 

Then you need, or edit LUA adding command for 0 state of controls or use an external 3rd part keympapper with "mapped on press" and "mapped on release" ability. E.g.

 

Joy2key

Joystick Gremlin

SVMapper

XPadder

Link to comment
Share on other sites

No, because BU0836 firmware only send commands when a (ON-OFF) switch change status from OFF to ON, not when change from ON to OFF.

 

Then you need, or edit LUA adding command for 0 state of controls or use an external 3rd part keympapper with "mapped on press" and "mapped on release" ability. E.g.

 

Joy2key

Joystick Gremlin

SVMapper

XPadder

 

 

 

So where I can find more informations about all that???To find a guide to make a on-off switch to act like an on-on switch.

[sIGPIC][/sIGPIC]

Link to comment
Share on other sites

So where I can find more informations about all that???To find a guide to make a on-off switch to act like an on-on switch.

 

Depends on what program you use to set your keybindings. Basically you just use one of those programs to set the keybindings for the Bodnar board - instead of setting them inside DCS. You just set keyboard commands - and the program will convert your Bodnar toggle switches to keyboard presses.

 

I personally use X Padder - mainly because it's fairly easy to use, it can differentiate between left & right Ctrl/Shift/Alt and you can also set signal OFF commands. Among other things I have used it to set keys for TM Hotas throttle - as most of the toggle switches are ON-OFF so they need a program to make them more useful. It costs 8 euros and can be bought from the website https://www.xpadder.com/ You might wanna explore free options first to see if something works for you though.

A-10C Warthog | AJS-37 Viggen | F-5E Tiger II | Mig-15bis | MiG-19P Farmer

Link to comment
Share on other sites

You problem is not in hardware (the switch), is in software (Bu0836 firmware), you can't change this.

 

Maybe LynX Cub firmware for Arduinos do what you want, see features there:

 

https://forums.eagle.ru/showpost.php?p=2984894&postcount=156

http://lynx.dk/cub-firmware/

 

MMJoy2 for Arduino (ATMEGA43u4) can press a button when switch OFF>ON and another when switch ON>OFF, but this double button usage.


Edited by Sokol1_br
Link to comment
Share on other sites

No, because BU0836 firmware only send commands when a (ON-OFF) switch change status from OFF to ON, not when change from ON to OFF.

 

Then you need, or edit LUA adding command for 0 state of controls or use an external 3rd part keympapper with "mapped on press" and "mapped on release" ability. E.g.

 

Joy2key

Joystick Gremlin

SVMapper

XPadder

 

 

Thanks for these, I'm now using Joystick Gremlin. I like it better for on-off switches than my custom lua.

Link to comment
Share on other sites

You really don't want to use keyboard maps for controls in a system. There are unwanted complications when doing this, especially when using shifted keys. You also don't want to waste two inputs for a two-position switch or three inputs for a three position switch.

 

LUA editing is a hassle, because everytime a new patch is applied it moves your edited version to a backup folder and replaces it with the current stock version. I always perform file compares and manually copy over my scripts from the backup to the new file. This prevents breaking a patch by using an obsolete control map. You would be surprised how often I have caught changes while doing this. Sometimes I am pleasantly surprised to find the stock file now includes the functionality the script is supposed to provide. However, for all the work, the LUA scripts provide exactly the functionality you need for the minimum wiring and use of digital inputs.

 

However, there is one advantage to using two inputs and ON-ON switches for two-position switches: synchronization between the game and the real-world switch positions. But this can also be a disadvantage. You need to remember the default positions for starting in the air or you may find yourself missing some key system.

 

ON-OFF switches placed in the OFF position won't affect the initial position of switches when starting a mission: useful of you are jumping around between aircraft types and the switches have different functions assigned. I check all of my switches to be in default "off" positions on my Warthog before starting a mission. They will sync up when placed to the on position: if they were already on, they stay on, if they were already off, they will now be on. I have gotten used to this and really appreciate how easy it makes it for me to start a mission no matter what aircraft I am flying or whether I am starting on the ground or in the air.

 

There is an argument for using momentary switches, i.e. 3-position switches that spring back to the center for momentary ON, maintained OFF, momentary ON. It has some of the benefits of ON-ON switches and some of the benefits of ON-OFF switches. My experience with the Thrustmaster Cougar MFDs have frequently demonstrated the flexibility of momentary switches. Like ON-ON switches, it chews up more inputs, but has the benefit of no disturbing default switch positions when starting a mission. But the cost is that you can't feel or see what the current position is via the real-world switch, you have to look in the virtual cockpit.

 

But after considering everything and having a lot of experience, ON-OFF switches (or ON-OFF-ON for three positions) are my preferred solution with the only real downside being the sense of dread about having to copy over the scripts every time I see a new patch is available.

 

In the end, all that matters is that you are happy with the results. It may be worth it for you to experiment with each possible solution to really get a feel for what works best for you:

1. ON-OFF switches with 3rd party key mapping software

2. ON-OFF switches with LUA scripting

3. ON-ON switches

4. ON-OFF-ON momentary switches (functionally identical to using the keyboard, but with directX inputs)

5. ON-OFF momentary switches using the in-game toggle function mapped to a single directX input.


Edited by streakeagle

[sIGPIC][/sIGPIC]

Link to comment
Share on other sites

Joytokey.com

[sIGPIC][/sIGPIC]

Primary Computer

ASUS Z390-P, i7-9700K CPU @ 5.0Ghz, 32GB Patriot Viper Steel DDR4 @ 3200Mhz, ZOTAC GeForce 1070 Ti AMP Extreme, Samsung 970 EVO M.2 NVMe drives (1Tb & 500 Gb), Windows 10 Professional, Thrustmaster Warthog HOTAS, Thrustmaster Warthog Stick, Thrustmaster Cougar Throttle, Cougar MFDs x3, Saitek Combat Rudder Pedals and TrackIR 5.

 

-={TAC}=-DCS Server

Gigabyte GA-Z68XP-UD3, i7-3770K CPU @ 3.90GHz, 32GB G.SKILL Ripjaws DDR3 @ 1600Mhz, ZOTAC GeForce® GTX 970.

Link to comment
Share on other sites

Thank you guys for your answers.I understand some things.But what is the lua?where I can find it?and how I program it?So with leobodnar is impossible to have a on-off switch do two things.What board I need?i get confused now.
No need for Lua.

 

With Bodnar you can have on-off switch do two things - just use one of those programs suggested.

 

Lähetetty minun EVA-L09 laitteesta Tapatalkilla

A-10C Warthog | AJS-37 Viggen | F-5E Tiger II | Mig-15bis | MiG-19P Farmer

Link to comment
Share on other sites

Joy2key

 

Joystick Gremlin

 

SVMapper

 

XPadder

 

 

 

One of them?

Yes. Haven't personally checked all those programs - but they all should be able to do what you want.

 

Lähetetty minun EVA-L09 laitteesta Tapatalkilla

A-10C Warthog | AJS-37 Viggen | F-5E Tiger II | Mig-15bis | MiG-19P Farmer

Link to comment
Share on other sites

The joystick input "default.lua" is found in the main DCS directory under each aircraft mod. For example the Hornet's is found here: {Your drive}\Eagle Dynamics\DCS World OpenBeta\Mods\aircraft\FA-18C\Input\FA-18C\joystick\default.lua

 

 

Like they said, this file is overwritten on each update. So you either have to keep a backup of the modified lua or use a mod manager (like JSGME). I've done both and currently use JSGME.

 

 

An example of modified inputs in the lua:

[color=#000000][font=Consolas][color=#000000]{ down [/color][color=#000000]=[/color][color=#000000] iCommandPlaneGearUp, up [/color][color=#000000]=[/color][color=#000000] iCommandPlaneGearDown, name [/color][color=#000000]=[/color][color=#000000] _([/color][color=#a31515]'Custom Landing Gear Control Handle'[/color][color=#000000]), category [/color][color=#000000]=[/color][color=#000000] {_([/color][color=#a31515]'Left Vertical Panel'[/color][color=#000000])}},[/color]
[color=#000000]{ down [/color][color=#000000]=[/color][color=#000000] ctrl_commands.FlapSw, up [/color][color=#000000]=[/color][color=#000000] ctrl_commands.FlapSw, cockpit_device_id [/color][color=#000000]=[/color][color=#000000] devices.CONTROL_INTERFACE, value_down [/color][color=#000000]=[/color][color=#09885a]1.0[/color][color=#000000], value_up [/color][color=#000000]=[/color][color=#09885a]0.0[/color][color=#000000], name [/color][color=#000000]=[/color][color=#000000] _([/color][color=#a31515]'Custom FLAP Switch - AUTO'[/color][color=#000000]), category [/color][color=#000000]=[/color][color=#000000] {_([/color][color=#a31515]'Left Vertical Panel'[/color][color=#000000])}},[/color]
[color=#000000]{ down [/color][color=#000000]=[/color][color=#000000] ctrl_commands.FlapSw, up [/color][color=#000000]=[/color][color=#000000] ctrl_commands.FlapSw, cockpit_device_id [/color][color=#000000]=[/color][color=#000000] devices.CONTROL_INTERFACE, value_down [/color][color=#000000]=[/color][color=#000000]-[/color][color=#09885a]1.0[/color][color=#000000], value_up [/color][color=#000000]=[/color][color=#09885a]0.0[/color][color=#000000], name [/color][color=#000000]=[/color][color=#000000] _([/color][color=#a31515]'Custom FLAP Switch - FULL'[/color][color=#000000]), category [/color][color=#000000]=[/color][color=#000000] {_([/color][color=#a31515]'Left Vertical Panel'[/color][color=#000000])}},[/color]
[color=#000000]{ down [/color][color=#000000]=[/color][color=#000000] gear_commands.HookHandle, up [/color][color=#000000]=[/color][color=#000000] gear_commands.HookHandle, cockpit_device_id [/color][color=#000000]=[/color][color=#000000] devices.GEAR_INTERFACE, value_down [/color][color=#000000]=[/color][color=#09885a]0.0[/color][color=#000000], value_up [/color][color=#000000]=[/color][color=#09885a]1.0[/color][color=#000000], name [/color][color=#000000]=[/color][color=#000000] _([/color][color=#a31515]'Custom Arresting Hook Handle'[/color][color=#000000]), category [/color][color=#000000]=[/color][color=#000000] {_([/color][color=#a31515]'Right Vertical Panel'[/color][color=#000000])}},[/color]
[/font][/color]

**Note you have to create a new and uniquely named command.

 

 

 

The gear and hook are on-off and the flaps is on-off-on

 

 

I've since begun to switch to joystick Gremlin, because I found I can get someone of the functionality of on-on switches without using up more inputs on my GP-Wiz40

Link to comment
Share on other sites

The joystick input "default.lua" is found in the main DCS directory under each aircraft mod. For example the Hornet's is found here: {Your drive}\Eagle Dynamics\DCS World OpenBeta\Mods\aircraft\FA-18C\Input\FA-18C\joystick\default.lua

 

 

Like they said, this file is overwritten on each update. So you either have to keep a backup of the modified lua or use a mod manager (like JSGME). I've done both and currently use JSGME.

 

 

An example of modified inputs in the lua:

[color=#000000][font=Consolas][color=#000000]{ down [/color][color=#000000]=[/color][color=#000000] iCommandPlaneGearUp, up [/color][color=#000000]=[/color][color=#000000] iCommandPlaneGearDown, name [/color][color=#000000]=[/color][color=#000000] _([/color][color=#a31515]'Custom Landing Gear Control Handle'[/color][color=#000000]), category [/color][color=#000000]=[/color][color=#000000] {_([/color][color=#a31515]'Left Vertical Panel'[/color][color=#000000])}},[/color]
[color=#000000]{ down [/color][color=#000000]=[/color][color=#000000] ctrl_commands.FlapSw, up [/color][color=#000000]=[/color][color=#000000] ctrl_commands.FlapSw, cockpit_device_id [/color][color=#000000]=[/color][color=#000000] devices.CONTROL_INTERFACE, value_down [/color][color=#000000]=[/color][color=#09885a]1.0[/color][color=#000000], value_up [/color][color=#000000]=[/color][color=#09885a]0.0[/color][color=#000000], name [/color][color=#000000]=[/color][color=#000000] _([/color][color=#a31515]'Custom FLAP Switch - AUTO'[/color][color=#000000]), category [/color][color=#000000]=[/color][color=#000000] {_([/color][color=#a31515]'Left Vertical Panel'[/color][color=#000000])}},[/color]
[color=#000000]{ down [/color][color=#000000]=[/color][color=#000000] ctrl_commands.FlapSw, up [/color][color=#000000]=[/color][color=#000000] ctrl_commands.FlapSw, cockpit_device_id [/color][color=#000000]=[/color][color=#000000] devices.CONTROL_INTERFACE, value_down [/color][color=#000000]=[/color][color=#000000]-[/color][color=#09885a]1.0[/color][color=#000000], value_up [/color][color=#000000]=[/color][color=#09885a]0.0[/color][color=#000000], name [/color][color=#000000]=[/color][color=#000000] _([/color][color=#a31515]'Custom FLAP Switch - FULL'[/color][color=#000000]), category [/color][color=#000000]=[/color][color=#000000] {_([/color][color=#a31515]'Left Vertical Panel'[/color][color=#000000])}},[/color]
[color=#000000]{ down [/color][color=#000000]=[/color][color=#000000] gear_commands.HookHandle, up [/color][color=#000000]=[/color][color=#000000] gear_commands.HookHandle, cockpit_device_id [/color][color=#000000]=[/color][color=#000000] devices.GEAR_INTERFACE, value_down [/color][color=#000000]=[/color][color=#09885a]0.0[/color][color=#000000], value_up [/color][color=#000000]=[/color][color=#09885a]1.0[/color][color=#000000], name [/color][color=#000000]=[/color][color=#000000] _([/color][color=#a31515]'Custom Arresting Hook Handle'[/color][color=#000000]), category [/color][color=#000000]=[/color][color=#000000] {_([/color][color=#a31515]'Right Vertical Panel'[/color][color=#000000])}},[/color]
[/font][/color]

**Note you have to create a new and uniquely named command.

 

 

 

The gear and hook are on-off and the flaps is on-off-on

 

 

I've since begun to switch to joystick Gremlin, because I found I can get someone of the functionality of on-on switches without using up more inputs on my GP-Wiz40

 

So value 0,0 is off on switch and value 1,0 is on???can you show indefault lua and what modification you do on it to work an on-off switch?

[sIGPIC][/sIGPIC]

Link to comment
Share on other sites

For an on-off switch, just look at the first one, the gear input.

 

 

down = switch "On" (down = iCommandPlaneGearUp)

 

up = switch "Off" (up = iCommandPlaneGearDown)

 

 

The original command, found in the same lua, didn't have an "up" part - I added that.

 

 

The commands for the flaps on-off-on were derived from the original flaps commands found in the lua.

 

 

You have to search in the file to find the inputs your looking for, then copy and paste them anywhere, I put mine near the top to be able to find them quickly, and modify them while giving them a unique name.

Link to comment
Share on other sites

Ok if you can help me.

 

{down = device_commands.Button_3, cockpit_device_id = devices.FUELSYS_INTERFACE, value_down = 0.0, name = _('Main Fuel Switch'), category = _('Pedestal')}

 

that is the stantar on default lua.On the main fuel switch.

 

what i must change?

[sIGPIC][/sIGPIC]

Link to comment
Share on other sites

That command says essentially, "when switch is pressed down (or turned to "on") set the value of device_commands.Button_3, called "Main Fuel Switch, of devices.FUELSYS_INTERFACE to a value of 0.0"

 

So if you have an on-off switch you need to add an "up" or off parameter to the command so that DCS knows what to do when you turn the switch off. This is for a two position ingame switch.

 

If a DCS command, like this one, uses a numerical value_down parameter, then you need to add a value_up parameter, which range is typically values of 1.0, 0.0, -1.0, but referring to the existing commands in the lua help you know exactly which one to use.

 

So the modified command for and on-off switch becomes (changes are in bold):

{down = device_commands.Button_3, [b]up = device_commands.Button_3[/b], cockpit_device_id = devices.FUELSYS_INTERFACE, value_down = 0.0, [b]value_up = 1.0[/b], name = _('[b]Modified[/b] Main Fuel Switch'), category = _('Pedestal')}

 

Notice that I also changed the name of the command because it must have a new unique name. I didn't look at the lua to see if 1.0 is the off value for the main fuel switch, but it likely is, might be -1.0.


Edited by Razi
Link to comment
Share on other sites

  • Recently Browsing   0 members

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