Jump to content

Warthog Toggle Switches 2018+


Elphaba

Recommended Posts

Hi

 

I know there isn't official support (why not?!) and I have spent hours this morning going through the following threads:

 

 

https://forums.eagle.ru/showthread.php?t=124480

https://forums.eagle.ru/showthread.php?t=124480&page=4

https://forums.eagle.ru/showpost.php?p=2185329&postcount=1

 

Firstly, there is so much information in these threads, some wrong, some contradictory, and most of it confusing, secondly, the tool by 'karls' no longer exists on OneDrive and thirdly, none of the information seems to work for the current DCS build as of Jan 2018.

 

So, if Eagle don't do the right thing in DCS 2.5 (add a toggle switch option when binding a DX button), then can someone, please, once and for all, simply and fully explain how to do this.

 

Specifically, as an example, make the Huey Governor switch bind to the Warthog Throttle APU physical switch.

Link to comment
Share on other sites

So, I'm still strugging...

 

I've edited the default.lua for the Huey, to add this line and comment out the old line:

 

--{down = device_commands.Button_16, cockpit_device_id  = devices.ENGINE_INTERFACE, value_down = 0.0, name = _('Governor Auto/Emer'), category = _('Pedestal')},
{down = device_commands.Button_16, up = device_commands.Button_16, cockpit_device_id = devices.ENGINE_INTERFACE, value_down = -1.0, value_up = 0.0, name = 'Toggle Governor Switch', category = _('Pedestal')},

 

I've now got this new option appearing in the OPTIONS / CONTROLS menu, but all the joysticks and the keyboard are greyed out such that I can't bind the control to anything.

 

w0kRT2m.png

Help?

Link to comment
Share on other sites

Your choice is to not use Target scripting, correct? If you're willing to read up on it (it sounds like you are) Go to here:

https://forums.eagle.ru/showpost.php?p=2874444&postcount=101

 

And read the next 20 or so posts. It should get you going.

 

The problem is that DCS changed how the LUA file works when they introduced the diff.lua files. I never could get it to work like some of the posts you mentioned. And went back to modifying the lua files under "...DCS World\Mods\aircraft\A-10C\Input\A-10C\joystick" for example.

 

And of course, you can just map switches within DCS, but it won't natively work like it does in A10 (Master Arm, Train, Safe) using SPDT switches. That requires lua modifications for other birds.


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

The problem with what you're trying to do IIRC, is the Huey is one of the modules that also has a lua for the TMWH. You need to add the command you want to that file, else it will not be mappable to the TMWH. You can also just delete the TMWH lua file, but it will reappear after every update.

Intel 9600K@4.9GHz, Asus Z390, 32GB DDR4, EVGA RTX 3070, Custom Water Cooling, 970 EVO 1TB NVMe

34" UltraWide 3440x1440 Curved Monitor, 21" Touch Screen MFD monitor, TIR5

My Pit Build, VKB Gunfighter Pro w/WH Grip, TMWH Throttle, MFG Crosswinds W/Combat Pedals, Cougar MFDs, Custom A-10C panels, Custom Helo Collective, SimShaker with Transducer

Link to comment
Share on other sites

If only someone made software to use with this joystick that made basic functions like this an extreme non issue ;)

 

If you mean TARGET then you're mistaken. It's a horrifically over complicated and annoying piece of software; take for example my requirement. One button to be make to work in both switch states. To do that I have to program the entire throttle and wipe out it's memory for all the other buttons, so instead of just making one button work differently I have to spend hours re-making all the other buttons do what they did before I changed just one of them.

 

That's retarded. It's even worse when I want to quickly switch between aircraft.

 

I've even emailed Thrustmaster and complained about this, and they didn't have a better solution.

 

It DOES make more sense for a game like DCS to be able to have an option that allows a DX button to trigger on both or all 3 states. It's obviously possible as they understand all this LUA nonsense and all the ever changing configuration patterns.


Edited by Elphaba
  • Like 1
Link to comment
Share on other sites

Elphaba, that's not how Target works. But I get that it can be complicated.

 

Have you checked out HomeFries scripts? Also, here's one that you may find interesting

 

https://forums.eagle.ru/showpost.php?p=2563187&postcount=1

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

If you mean TARGET then you're mistaken. It's a horrifically over complicated and annoying piece of software; take for example my requirement. One button to be make to work in both switch states. To do that I have to program the entire throttle and wipe out it's memory for all the other buttons, so instead of just making one button work differently I have to spend hours re-making all the other buttons do what they did before I changed just one of them.

 

That's retarded. It's even worse when I want to quickly switch between aircraft.

 

I've even emailed Thrustmaster and complained about this, and they didn't have a better solution.

 

It DOES make more sense for a game like DCS to be able to have an option that allows a DX button to trigger on both or all 3 states. It's obviously possible as they understand all this LUA nonsense and all the ever changing configuration patterns.

 

Oh and the last point is a DX limitation. It only understands on or off. LUA (or Target) is needed to do more. Check out that second link.

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

Hi

 

I know there isn't official support (why not?!) and I have spent hours this morning going through the following threads:

 

 

https://forums.eagle.ru/showthread.php?t=124480

https://forums.eagle.ru/showthread.php?t=124480&page=4

https://forums.eagle.ru/showpost.php?p=2185329&postcount=1

 

Firstly, there is so much information in these threads, some wrong, some contradictory, and most of it confusing, secondly, the tool by 'karls' no longer exists on OneDrive and thirdly, none of the information seems to work for the current DCS build as of Jan 2018.

 

So, if Eagle don't do the right thing in DCS 2.5 (add a toggle switch option when binding a DX button), then can someone, please, once and for all, simply and fully explain how to do this.

 

Specifically, as an example, make the Huey Governor switch bind to the Warthog Throttle APU physical switch.

 

Some time ago I posted a how-to document on the subject- In case you have the patience to read it, here is a link to the post: https://forums.eagle.ru/showpost.php?p=2862001&postcount=214

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

If only someone made software to use with this joystick that made basic functions like this an extreme non issue ;)

It's not a joystick issue but the devs which:

1. don't create an approporiate commands

2. don't offer a 2-3 way switches key binding for their module even if the commands are there

 

As for the first point the problem is that there are quite often only a single, toggle command implemented in the module - basically the same key that will go on/off (up/down) depending on how many times it's pressed. There are no separate actions defined to put a switch into up or down position. In such case sorry but it's almost a dead end, this will not work 100% correctly with an up/down or a 3-position switch (2xup/down).

 

Second point is just the devs saving time and transfering the effort to the community. Eventually after the community creates a list of switches they'll just go and put it into the module (see M-2000C for instance). Still this means that usually only the most often used - popular switches have a 2/3 way switch bindings while other are missing.

 

Being fully honest, every module should have a complete list of bindings for every single 2 or 3 way switch in the cockpit created by the devs.

I'm really tired about the fact that for every single module that I get I have to go to the lua file to create those list by myself. Then I find out that some switches have only a toggle action instead of up/down representation. On top of that I have to pay attention if the updates didn't change a action binding that I used.

 

There is no issue with the TM Worthog. It's one of the most populare HOTAS and it should be considered as a standard.

It also has been working with A-10C in DCS since many years. It's the devs that are not dedicating enough attention to make the support out of the box :thumbdown::thumbdown:

F/A-18, F-16, F-14, M-2000C, A-10C, AV-8B, AJS-37 Viggen, F-5E-3, F-86F, MiG-21bis, MiG-15bis, L-39 Albatros, C-101 Aviojet, P-51D, Spitfire LF Mk. IX, Bf 109 4-K, UH-1H, Mi-8, Ka-50, NTTR, Normandy, Persian Gulf... and not enough time to fully enjoy it all

Link to comment
Share on other sites

I have a generic target script that I use for all modules. It simply assigns all DX buttons possible to the throttle, plus some common DCS keybinds for the remaining functions.

 

Then I just run the script and use the throttle as a normal assignable controller in DCS.

 

I'm happy to share if people are interested.

PC Specs / Hardware: MSI z370 Gaming Plus Mainboard, Intel 8700k @ 5GHz, MSI Sea Hawk 2080 Ti @ 2100MHz, 32GB 3200 MHz DDR4 RAM

Displays: Philips BDM4065UC 60Hz 4K UHD Screen, Pimax 8KX

Controllers / Peripherals: VPC MongoosT-50, Thrustmaster Warthog HOTAS, modded MS FFB2/CH Combatstick, MFG Crosswind Pedals, Gametrix JetSeat

OS: Windows 10 Home Creator's Update

Link to comment
Share on other sites

I have a generic target script that I use for all modules. It simply assigns all DX buttons possible to the throttle, plus some common DCS keybinds for the remaining functions.

 

Then I just run the script and use the throttle as a normal assignable controller in DCS.

 

I'm happy to share if people are interested.

 

 

NO! You can't make me do it! I'd rather spend 10x longer just to have half the functionality and still need to rebind my controls for every plane every time there is a patch wipe or I reinstall! >:o

 

;)

Link to comment
Share on other sites

I really wish people would STOP trying to shove that totally crappy TARGET software option down peoples throats when they ask about switch files. TARGET sucks...it has ALWAYS sucked.. and unless Thrustmaster changes management and support completely it will continue to suck. If you cant answer the original post question then for pity's sake just don't post at all. Now in answer to your Original question there are two things you can look up that make the switch LUA's editing very clear.. First is a you-tube vid at this link

and second is a PDF which I will try to link ..

How to Edit Control Binding Files by

Hans-Werner Fassbender

https://forums.eagle.ru/attachment.php?attachmentid=161709&d=1493988359

I have been trying to make sense of this esoteric black-magic art for years but these two docs make it all clearer.

Also when you edit the default.lua file in the a/c input folder you must also add the change to ANY OTHER lua files in that folder ..Even if you do not have the controller those files are for or they will conflict with each other.

Link to comment
Share on other sites

Guys, there is a very simple solution to the problem. Not only dx "down" commands should be captured by the keybinder, but also, "up" commands. It's been very elegantly done by "Alternative launcher" in another sim.

 

TARGET is something we don't really need. All we need as some love applied to the keybindings in DCS.

My controls & seat

 

Main controls: , BRD-N v4 Flightstick (Kreml C5 controller), TM Warthog Throttle (Kreml F3 controller), BRD-F2 Restyling Bf-109 Pedals w. damper, TrackIR5, Gametrix KW-908 (integrated into RAV4 seat)

Stick grips:

Thrustmaster Warthog

Thrustmaster Cougar (x2)

Thrustmaster F-16 FLCS

BRD KG13

 

Standby controls:

BRD-M2 Mi-8 Pedals (Ruddermaster controller)

BRD-N v3 Flightstick w. exch. grip upgrade (Kreml C5 controller)

Thrustmaster Cougar Throttle

Pilot seat

 

 

Link to comment
Share on other sites

...

Also when you edit the default.lua file in the a/c input folder you must also add the change to ANY OTHER lua files in that folder ..Even if you do not have the controller those files are for or they will conflict with each other.

@TonyZ: I'm the author of that .PDF document you mentioned, and I have done lots of mods in the default.lua (and equivalent files), plus some in the "clickabledata.lua". And I cannot confirm what you say in your last statement.

When I make a mod for use in my TM Warthog throttle then I only add it in the file "Throttle - HOTAS Warthog.lua" (if there is one). And this has never caused any problem. Of course, if I wanted to be able alternatively to bind the modded command to my TM WH joystick, then I would have to add the mod to the file "Joystick - HOTAS Warthog.lua" as well.

If I had to add mods to all control input files that would be a large task in some cases. The A-10C for example has 7 device-specific files in addition to the default.lua. That would be a maintenance nightmare!

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

  • 11 months later...

Gents,

 

I've watched that YouTube linked video that TonyZ posted, but sadly its out of date. Using a default.lua doesnt work for the Warthog that I'm seeing.

 

I'm specifically trying to create a 2-step function for toggle switches 24 and 25 on the TM Warthog Throttle. I'd like to control my Gear and Hook to free up some buttons.

 

Here is what I'm seeing in the Throttle Lua

["d3002pnilu3002cd6vd1vpnilvu0"] = {

["added"] = {

[1] = {

["key"] = "JOY_BTN24",

},

},

["name"] = "Probe Control Switch - EXTEND/RETRACT",

["d3013pnilunilcd5vd1vpnilvunil"] = {

["added"] = {

[1] = {

["key"] = "JOY_BTN25",

},

},

["name"] = "Arresting Hook Handle - Cycle",

 

Whats the trick? Thanks!

Link to comment
Share on other sites

You are looking at the "...diff.lua" file which captures the key binds that you have made under Options/Controls.

Don't try to edit those files manually! A it won't solve your problem and B you are very likely to create a mess.

If you want to create new command options you need to do that in the "default.lua".

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

Gents,

 

I've watched that YouTube linked video that TonyZ posted, but sadly its out of date. Using a default.lua doesnt work for the Warthog that I'm seeing.

 

I'm specifically trying to create a 2-step function for toggle switches 24 and 25 on the TM Warthog Throttle. I'd like to control my Gear and Hook to free up some buttons.

 

Here is what I'm seeing in the Throttle Lua

["d3002pnilu3002cd6vd1vpnilvu0"] = {

["added"] = {

[1] = {

["key"] = "JOY_BTN24",

},

},

["name"] = "Probe Control Switch - EXTEND/RETRACT",

["d3013pnilunilcd5vd1vpnilvunil"] = {

["added"] = {

[1] = {

["key"] = "JOY_BTN25",

},

},

["name"] = "Arresting Hook Handle - Cycle",

 

Whats the trick? Thanks!

 

 

As LeCuvier said. The default.lua you want is

C:\Program Files\Eagle Dynamics\DCS World\Mods\aircraft\A-10C\Input\A-10C\joystick

 

There are a few default.lua's so make sure you don't make the mistake I made - mod'ing the wrong lua file :D

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

Gents,

 

I've watched that YouTube linked video that TonyZ posted, but sadly its out of date. Using a default.lua doesnt work for the Warthog that I'm seeing.

 

I'm specifically trying to create a 2-step function for toggle switches 24 and 25 on the TM Warthog Throttle. I'd like to control my Gear and Hook to free up some buttons.

 

Here is what I'm seeing in the Throttle Lua

["d3002pnilu3002cd6vd1vpnilvu0"] = {

["added"] = {

[1] = {

["key"] = "JOY_BTN24",

},

},

["name"] = "Probe Control Switch - EXTEND/RETRACT",

["d3013pnilunilcd5vd1vpnilvunil"] = {

["added"] = {

[1] = {

["key"] = "JOY_BTN25",

},

},

["name"] = "Arresting Hook Handle - Cycle",

 

Whats the trick? Thanks!

 

 

BTW, which switch is 24 and 25? The actual label on the throttle? Is it a three position switch or a two position switch?

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

Thanks gents. I'll find the Default LUA I'm after and have a go.

And buttons 24 and 25 are the two lower left 2-way toggles on the TM Warthog Throttle.

 

If mucking with LUA gets old (you have to remove it, update it, reapply it etc) there is a universal target option. Gizzy's script will send DX codes for every switch on the throttle. So you configure it in the game and all positions of all switches are unique. Making it very simple to assign things like three position flap switch in any aircraft.

 

https://forums.eagle.ru/showpost.php?p=2563187&postcount=1

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

I'm sure someone will say once again to stop suggesting TARGET for this, but I have to ask, if you are willing to edit LUA scripts in DCS (which can change with every release), why not instead just use TARGET, which doesn't change constantly, and works without changes over multipole minor as well as major DCS releases.

 

I mean LUA and TARGET are both programming languages. I understand both well enough to use either, but I use TARGET for the simple reason that the DCS LUA scripts are not really intended to be edited by the end user, and hence often change radically, breaking your customizations - which is much of the complaint expressed in this forum topic.

 

For TARGEt, yes, if you program one button in TARGET, all buttons disable instead of retaining their original DX button capability. Also, since TARGET combines controllers (if you do that), you can't assign all buttons on the stick and throttle because you run out of DX buttons. But there are solutions to these issues:

 

1) To keep everything defaulting to their original DX buttons using TARGET, set up a TARGET script to program only the throttle (because the Throttle has 3 way toggles and the stick does not - so "exclude" the stick). Assign the stick in DCS entirely using it's default DX buttons.

 

Then edit the script for the Throttle so that it assigns all buttons/switches as their default Throttle DX button functions. You only have to create this script once and it works for all applications (not just DCS, but all games). Now for those rare cases where you need to make a minor change (e.g. make a 3 way switch work in all 3 positions) you can with minimal effort. Certainly less pain then editing a LUA script over and over due to DCS updates.

 

2) Or, to allow programming the stick and the throttle so that all buttons/switches have DX buttons, you have a problem. DirectX maxes out at 32 DX buttons and there are more than 32 buttons on the throttle and stick when combined. Or even with just the throttle alone, if you want DX button states for the center position of all Throttle 3 way switches, you run out of DX buttons. But there is a way you can change the TARGET target.tmh file to enable up to 128 DX buttons. It is not commonly known, but DirectX supports up to 128 buttons. See here:

 

https://forums.eagle.ru/showthread.php?t=226594

 

This involves editing the target.tmh (and defines.tmh file I believe) which is not something you would normally edit. If a new release of TARGET comes out, you'll have to re-apply the target.tmh/defines.tmh edits again. But that is easy to do as TARGET doesn't change much with new releases, and changes these days are to enable new hardware (like the latest releasee just added the new TPR rudder pedals). So you can ignore the updates to TARGET for a long time with no detriment. You can't do that with DCS.

 

Now, again, create a single script that assigns all stick and throttle buttons to DX buttons (there are examples in the above post I believe), and only edit that script for those rare cases where it matters. Or even better, make the script, by default, create DX button presses for the middle position for all 3 way toggles. Then you never have to edit the script. Just assign DX buttons in DCS.

 

 

Now the issue still exists that you have to assign all those DX buttons in DCS, which is why I assume people are editing LUA scripts - to make it easier to make changes. So ya, no ideal solution here. But with the 128 DX button mod to TARGET, you don't have to use LUA scripting to handle the center position of the 3 way switches. You only edit the LUA scripts to assign DX buttons - a much easier edit, and much easier to transfer to new game controller LUA scripts in the future I assume.

 

 

 

Personally, I never use DX button assignments. I use TARGET to program the buttons to press keyboard keys and I use all the default key bindings in DCS. This method takes no more effort to create in TARGET than it takes to edit DCS LUA scripts, but once done, my scripts which I created years ago still work today through multiple major and minor revisions of DCS. I'm still using my original KA-50 TARGET script, and even scripts from LOMAC and Flaming Cliffs for the A-10A and other pre-DCS aircraft which I created for the Cougar (TARGET supports the Cougar). I only had to make minor changes to re-map them to the Warthog Throttle when finally bought one, and the stick programming is the same between the Cougar and the Warthog stick.

 

Sorry I can't offer any advice on LUA programming since I don't use it to solve these issues. But give TARGET consideration. The big advantage being once you create a TARGET script, it works, period, for years to come even if DCS completely changes the LUA scripts. And if you still absolutely hate TARGET, then use AutoHotKeys or Joystick Gremlin, two other programmable tools which can achieve the same result, but AHK or Joystick Gremlin support all game controllers, not just Thrustmaster products.


Edited by Drakoz
Link to comment
Share on other sites

...I have to ask, if you are willing to edit LUA scripts in DCS (which can change with every release), why not instead just use TARGET, which doesn't change constantly, and works without changes over multipole minor as well as major DCS releases.

Very simple reason: I got rid of my TM Warthog base and bought a VPC base. Plus I use a DSD button box. So TARGET now could only be useful with my TM WH throttle. With the .lua editing I can cover all bases. Plus, it's absolutely not true that the .lua files change over time. I have done a lot of .lua editing and in my experience that's a very stable environment.

Actually I gave up on using TARGET when I still used the TM WH stick. That was because I had frequent conflict between my TrackIR and TARGET.

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

LeCuvier, thanks. Yes, if moving outside of the Thrustmaster realm, I completely understand and agree. I would like to transition to something like AutoHotKeys or Joystick Gremlin to solve that issue, or I might just create my own program to allow programming all game controllers, not just TM.

 

Thanks for clarifying about LUA scripts. I've seen a lot of posts from people having nothing but frustration with game controller LUA scripts changing on them so I may have gotten the wrong impression. People have difficulty with TARGET too, but that is usually a matter of not taking the time to learn it - which I also don't blame people for that. It can be complicated.

 

I am curious to know more about the TrackIR and TARGET issues you experienced.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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