Jump to content

How to set up toggle switches (a tutorial)


Recommended Posts

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.

As I wrote in my tutorial, you don't need to include the "combos = {{key= xxx}} in the added line in the .lua file. Just leave this out and let the added line start with {down = 3002,...}. Then bind the new command to a button using the Options / Controls screen. That's my preferred method and it continues to work for me.

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

Hello,

 

Is it possible to create a 'category' so that all your modded switches are listed in one location (in DCS control setup). I use "xxxxxxxxxx" at the end of my lines to make them easier to see, but I still have to go to all the different categories to assign them. For example: "My Cockpit" could show them all at once.

 

Sorry if I asked prematurely, I'll have a look and see how it is structured after a couple coffees.


Edited by JG14_Smil
Link to comment
Share on other sites

Yes, that is easily possible. Just change the category name at the end to what you want it to be, e.g.

{down = device_commands.Button_5, cockpit_device_id  = devices.CONTROL_SYSTEM, value_down = 1.0, name = _('Landing Gear Retraction'), [b]category = _('My Cockpit')[/b]},

It is also possible to use more than one category so that it appears in "My Cockpit" and other useful places.

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

Yes, that is easily possible. Just change the category name at the end to what you want it to be, e.g.

{down = device_commands.Button_5, cockpit_device_id  = devices.CONTROL_SYSTEM, value_down = 1.0, name = _('Landing Gear Retraction'), [b]category = _('My Cockpit')[/b]},

It is also possible to use more than one category so that it appears in "My Cockpit" and other useful places.

It is possible as the category is only a means for grouping commands in the Options / Controls screen. I tried it for the Bf-109 and it worked. But there is no guarantee that this won't cause a problem in the future, depending on how this software evolves. Therefore I don't create new categories.

  • Like 2

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

But there is no guarantee that this won't cause a problem in the future, depending on how this software evolves. Therefore I don't create new categories.

I see no particular problem in changing the name of the category.

If ED decides to significantly change the way the input commands are handled, very little of what is presented in this thread is gonna work. The categories will be the least of our problem. But I don't see that happening any time soon.

  • 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

Hi All

I am currently feeling really stupid as I am not understanding this thread to well.

I want to use the warthog Autopilot Path/ALT/HDG/ALT switch for AutoPilot ORBIT, AutoPilot LEVEL FLIGHT and AutoPilot ATTITUDE HOLD in the Huey but can't seem to get it working by editing the .lua

 

Any help would be appreciated

 

Thanks

Link to comment
Share on other sites

I want to use the warthog Autopilot Path/ALT/HDG/ALT switch for AutoPilot ORBIT, AutoPilot LEVEL FLIGHT and AutoPilot ATTITUDE HOLD in the Huey but can't seem to get it working by editing the .lua

Good choice, I have it mapped there, too ;)

Here are the settings for your "Throttle - HOTAS Warthog.lua"

{down = device_commands.Button_28, up = device_commands.Button_29, cockpit_device_id = devices.WEAPON_SYS,          value_down = 1.0,  value_up = 1.0,  name = _('AutoPilot Attitude/Level'), category = _('_My Buttons')},
{down = device_commands.Button_30, up = device_commands.Button_29, cockpit_device_id = devices.WEAPON_SYS,          value_down = 1.0,  value_up = 1.0,  name = _('AutoPilot Orbit/Level'), category = _('_My Buttons')},

Hope it helps!

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

Gear Lever A10-C on BTN24

 

TMWH 'EAC' left bottom button, made to Toggle

 

My 2 cts (I did this first with TARGET but lost FPS, so that's no good)

A10C default input file

"X\..\DCS\Mods\aircraft\A-10C\Input\A-10C\joystick\Throttle - HOTAS Warthog.lua"

 

find and delete or comment out (EAC) line with {key = 'JOY_BTN24'}

 

 -- Autopilot
 ..
 {combos = {{key = 'JOY_BTN24'}}    , down = iCommandPlane_EAC_ARM     , up = iCommandPlane_EAC_OFF       , name = _('EAC Arm/Off')               , category = _('LASTE Control Panel')},
 

add line

category = _('Landing gear panel')}

name = _('GEAR on BTN24')

as in:

 

 {combos = {{key = 'JOY_BTN24'}}               , down = iCommandPlaneGearUp     , up = iCommandPlaneGearDown      , name = _('GEAR on BTN24')                                           , category = _('Landing gear panel')},
 

'GEAR on BTN24' now shows in DCS Control with BTN24 as ‘default’ setting

 

attached

JSGME_MODS ready

A10C Gear UpDown on TMWH EAC.zip

| VR goggles | Autopilot panel | Headtracker | TM HOTAS | G920 HOTAS | MS FFB 2 | Throttle Quadrants | 8600K | GTX 1080 | 64GB RAM| Win 10 x64 | Voicerecognition | 50" UHD TV monitor | 40" 1080p TV monitor | 2x 24" 1080p side monitors | 24" 1080p touchscreen |

Link to comment
Share on other sites

  • 2 weeks later...

I am trying to get work battery switch on FW 190D, but without succes (not releasing the button), same code based on tutorial is working on MW 50 switch without problems. Can someone please help me.

 

down = device_commands.Button_12, cockpit_device_id = devices.ELEC_INTERFACE, value_down = 1.0, name = _('CB Battery On'), category = _('Electric System')},

{down = device_commands.Button_25, up = device_commands.Button_25, cockpit_device_id = devices.ELEC_INTERFACE, value_down = 1.0, value_up = 0.0, name = _('CB Battery Off'), category = _('Electric System')},

-- adde by me

{down = device_commands.Button_12, cockpit_device_id = devices.ELEC_INTERFACE, value_down = 1.0, name = _('CB Battery On'), category = _('Electric System')},

{down = device_commands.Button_12, up = device_commands.Button_12, cockpit_device_id = devices.ELEC_INTERFACE, value_down = 1.0, value_up = 0.0, name = _('CB Battery On/Off'), category = _('Electric System')},

[sIGPIC][/sIGPIC]

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

Link to comment
Share on other sites

This is how it works for me:

{down = device_commands.Button_12, [b]up = device_commands.Button_25[/b], cockpit_device_id = devices.ELEC_INTERFACE, value_down = 1.0, value_up = 0.0, name = _('CB Battery On/Off'), category = _('_My Buttons')},

For "up" you have to use button 25.

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

This is how it works for me:

{down = device_commands.Button_12, [b]up = device_commands.Button_25[/b], cockpit_device_id = devices.ELEC_INTERFACE, value_down = 1.0, value_up = 0.0, name = _('CB Battery On/Off'), category = _('_My Buttons')},

For "up" you have to use button 25.

 

Thanks working :thumbup:

[sIGPIC][/sIGPIC]

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

Link to comment
Share on other sites

Hi

I am trying to get the warthog L Engine switch to act as a on off for the Mater arm in the M2000C. I have played with the settings in the LUA but am unable to get it working any ideas ?

Thanks

I tried to assign the left throttle switch to "Master Arm Toggle", but when I clicked OK to save the change my screen went black. I had to kill the "DCS" task with task manager. Repair did not fix that. Anyway, the Master Arm command is a "toggle" command and you cannot set it up as a true On/Off command. Also from a practical point of view, using the throttle switch means that you cannot use the throtlle for any axis command.

Actually I'm not sure: do you mean the engine cut-off switch or the ENG OPER (IGN or MOTOR)?

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

Sorry i meant the left engine fuel flow switch. The top left one next to the 5 leds.

I tried to assign it in the Open Alpha version of the M2000C and got the black screen as well so I have the feeling that there is a bug in the M2000. Does it work ok for you (apart from not getting the desired result)?

Note:

The Fuel flow switch is a true ON/OFF switch while the Master Arm command is programmed as a toggle command. I can see a way to use a ON/OFF switch with a toggle command; but that is a bit tricky: If the mission starts with Master Arm ON but your switch is in the OFF position (or vice versa) then you will always have a "synchronization" problem with that switch in that mission.

Progress:

I have completed the re-install of M2000C and tried to assign a throttle switch to Master Arm, but I get the black screen again and therefore I cannot try my solution.


Edited by LeCuvier

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

Master Arm ON/OFF Switch working now

 

Hi Bouncer,

I found the thread where the black screen was reported and there is a work-around. So I made a little addition to the "default.lua" file:

    {down = iCommandSwitchMasterArm,    name = _('Master Arm TOGGLE'),   category = _('Weapons Management')},
   --added HWF 1 line below 01-JAN-2017
   {down = iCommandSwitchMasterArm, up = iCommandSwitchMasterArm,    name = _('Master Arm ON/OFF'),   category = _('Weapons Management')},

the code above shows 3 lines. The first one is the original line for "Master Arm TOGGLE". Don't delete that line!

The second line is a comment line that helps me find my changes.

The third line is the new code for "Master Arm ON/OFF".

I then started DCS and from the first screen of a mission I hit [ESC] and went to Options / Controls and bound the left Fuel switch to the new command "Master Arm ON/OFF". Then I saved and let the mission start and tried the switch. It works better than I expected. I did not have any synchronization issue.

I recommend you try this. But before anything else, remove any binding to Master Arm!


Edited by LeCuvier

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

Sorry for the late response i have been out with the family most of the day.

 

Yes i found that you need to start a mission and then make changes to the controls from there as going to the controls in the menu does cause the black screen.

 

Thank you for the code i will give it a try shortly

Link to comment
Share on other sites

Currently to extend full flaps in the P-51, the pilot must toggle the FLAPS EXTEND switch 5 times. Is there any way to make the Warthog throttle FLAPS switch function like the Speedbrake switch, that is when the switch is toggled to the ON position, it continuously pulses FLAPS EXTEND commands until toggled off? I apologize in advance if I missed this issue in the 28 pages of this thread. Search yielded no results.

Link to comment
Share on other sites

Currently to extend full flaps in the P-51, the pilot must toggle the FLAPS EXTEND switch 5 times. Is there any way to make the Warthog throttle FLAPS switch function like the Speedbrake switch, that is when the switch is toggled to the ON position, it continuously pulses FLAPS EXTEND commands until toggled off? I apologize in advance if I missed this issue in the 28 pages of this thread. Search yielded no results.

 

You could do this with the Target editor from Thrustmaster by creating a "chain" that sends the same command 5 times. That's the easiest way I know. You could also create a macro but that's far more complex. I have created macros for the F-5E and the A-10C, and the same method would probably work for the P-51. But many Multi-Player missions require "Pure Clients", and if you have macros then you cannot play in those.

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...
  • Recently Browsing   0 members

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