Jump to content

Warthog Throttle TARGET Script with DX Outputs for All Switch and Rocker Off States


ReflexArc

Recommended Posts

After a lot of searching, I found enough information to make this profile and couldn't find a premade version. Contrary to popular belief and as mentioned in this thread , DX supports up to 120 buttons plus 8-way POV. So I used that file (required in your Thrustmaster TARGET Scripts folder) to create my script which assigns a DX button output for each switch position instead of the default of sending DX outputs only for the "on" positions. As currently configured, the buttons, 4-way switches, and speed brake on the throttle quadrant itself give default behavior outputs (hold = more output) while all of the boat and other rocker switches give a "pulse" output (send the event once despite being "held" in position.) If you want to change this behavior, just remove "PULSE+" from the appropriate line.

 

Hope this helps someone else.

 

Edit: Additional "installation" instructions.

 

1. Download targetdx128.zip from this thread

2. extract the zipped file to <Program Files (x86)\Thrustmaster\TARGET\scripts\> (or wherever your TARGET\scripts\ folder is located.)

3. download my file, WarthogThrottleALLSwitchPos.tmc.txt.

4. Change the name of the file to WarthogThrottleALLSwitchPos.tmc (remove .txt).

5. Open either TARGET GUI or TARGET Script Editor and run WarthogThrottleALLSwitchPos.tmc.

 

Now your warthog throttle will send a unique direct-x button for every switch state (up/middle/down instead of just up and down).

 

Quick disclaimer about the China hat and any other temporary state switches (MOTOR L/R IGN). "China Hat Middle" is also an available button but people generally use the china hat as a two-button switch. When you go to bind the china hat, hold it in the desired position until you've pressed "OK" on the binding. If you press it forward and let go, it'll instead bind the "china hat middle" state. Similarly, with Motor L IGN (up), hold it in the up/forward position until done binding, as NORM is also a potential button state.

 

Edit 5/9/2020: Attaching the most recent version of the script that I've been using with the following peripherals attached: Warthog Throttle, Warthog Joystick, 3x Falcon MFD's, and T-Rudders

WarthogThrottleALLSwitchPos.tmc.txt


Edited by ReflexArc
Attach Newest Version

Member of TAW-North America.

Practices Thursdays at 2045 Eastern. Missions Sundays at 1945 Eastern.

F/A-18C | A-10C | AV-8B | M2000C | Huey | KA-50

Link to comment
Share on other sites

I was asked to clarify some after posting this to reddit, I'm copying my explanation here:

 

By default, two-state switches like the Master ARM switch are only sent as one direct X button (Master Arm/up=Button 1; Master Safe/down=nothing/off) and three-state switches are two direct X buttons (Flaps UP/up=button 1; Flaps MVR/middle = nothing/off; Flaps DN/down = button 2). This requires custom HOTAS options which rely on button states and combinations of button states (button 1 On / button 1 Off = Flaps Auto / Flaps Half + button 2 On / Button 2 Off = Flaps Full / Flaps Half) but those state-dependent bindings aren't available for every plane in the game or for planes/spaceships in other games. My script makes two-state switches into two buttons (up = button 1 and down = button 2) and three-state switches into three buttons (up = button 1 middle = button 2 down = button 3). Virtually all planes have available bindings for discrete functions (Flaps Auto, Flaps Full, Flaps Half) which you can then bind to your now three button switch that you couldn't bind before (because it was only two buttons).

 

I wrote all of the following before my better TL;DR above but I'm keeping it because it includes some additional info.

 

If you're flying just the A-10C you're probably not missing anything. DCS includes bindings like "Master Arm On/Off HOTAS" which work correctly. But by default the master arm switch only sends a signal to the game every time you switch it to ARM ("On"). When you switch it to SAFE ("Off") it turns off that On signal but doesn't actually send any other info.

 

My script is useful for other planes which typically have options for three states: Master Arm On/Off (Toggle), Master Arm On (ARM), and Master Arm Off (SAFE). With planes like that, a typical assignment would be to assign your master switch to the Toggle version. When you do that, the switch will only toggle between On and Off each time you flip the physical switch to Arm. (So switch up to turn on but switch down then up again to turn off.)

 

If you use my Target Script, switching to ARM sends a signal and switching to SAFE also sends a separate signal. So then you can bind switch up and switch down to ARM and SAFE.

 

You might also notice this when using the flaps switch, which has two On modes (up and down) and one Off mode (middle). Some planes will have Flaps Auto/Half (On/Off) and Flaps Full/Half (On/Off), which should work without using my script. Other planes will only have Flaps Auto, Flaps Half, and Flaps Full. By default, you can not bind all three options because only Switch Up and Switch Down send a Direct X button input to the game. With my script, Switch Up, Switch Middle, AND Switch Down all send button input to the game. So now you can bind all three flaps states to the switch. This is a similar issue with the pinky switch and lighting states.

 

The reason I mentioned LUA scripting is that you can make "HOTAS" style bindings like in the A-10C yourself, but it requires a decent amount of easy but time-consuming LUA programming and you would have to remake all of those "HOTAS" style options for each plane that you fly. If you use my script, you don't need to make workarounds, because "Off" states actually send their own Direct X button, so you don't need custom LUA "Off/On" bindings (since only "On" states send button input by default but my script sends On and Off states as a button).

  • Like 1

Member of TAW-North America.

Practices Thursdays at 2045 Eastern. Missions Sundays at 1945 Eastern.

F/A-18C | A-10C | AV-8B | M2000C | Huey | KA-50

Link to comment
Share on other sites

Hi ReflexArc, the first time I tried running the script it gave:

 

Compile Error: Symbol not found: TBTN1 in targetdx128.tmh at line 867

 

I'm really excited to get this working! Some of the .luas are very annoying for a lug like me.

Hmm honestly I'm not a pro at this overall. Just to make sure, you installed targetdx128 in your scripts folder? It looks like line 867 has to do with TWCS throttle mapping and so TBTN1 is probably referencing a button on that throttle. You could try commenting out that line by using // in front of int TWCS etc. and see if it works. Also, just to check, you don't happen to also be using a TWCS throttle at the same time? (Although I don't know if that would actually make a difference.)

 

I'll upload the version I'm using in case something was changed for some reason.

targetdx128.zip


Edited by ReflexArc

Member of TAW-North America.

Practices Thursdays at 2045 Eastern. Missions Sundays at 1945 Eastern.

F/A-18C | A-10C | AV-8B | M2000C | Huey | KA-50

Link to comment
Share on other sites

Hmm honestly I'm not a pro at this overall. Just to make sure, you installed targetdx128 in your scripts folder? It looks like line 867 has to do with TWCS throttle mapping and so TBTN1 is probably referencing a button on that throttle. You could try commenting out that line by using // in front of int TWCS etc. and see if it works. Also, just to check, you don't happen to also be using a TWCS throttle at the same time? (Although I don't know if that would actually make a difference.)

 

I'll upload the version I'm using in case something was changed for some reason.

 

Oh, you know what? I have one of the upgraded slews, so I don't have a mini-stick that pushes in like the original. I bet that's the issue. I'll try commenting out that line and I bet it works.

 

So all the TBTNs in that line caused an error. Removing them brought up another error:

 

Runtime Error: Index out of bounds for: joy0 in MapKey ( line 348 in targetdx128.tmh )

 

so I am guessing my slew mod is messing with it somehow. Oh well, back to the luas for me unless someone more clever can figure it ;)

 

Still, a great thing you have done for those it works for.

Link to comment
Share on other sites

Oh, you know what? I have one of the upgraded slews, so I don't have a mini-stick that pushes in like the original. I bet that's the issue. I'll try commenting out that line and I bet it works.

 

So all the TBTNs in that line caused an error. Removing them brought up another error:

 

Runtime Error: Index out of bounds for: joy0 in MapKey ( line 348 in targetdx128.tmh )

 

so I am guessing my slew mod is messing with it somehow. Oh well, back to the luas for me unless someone more clever can figure it ;)

 

Still, a great thing you have done for those it works for.

 

That's really interesting, I wonder if somehow TARGET knows that the TDC no longer has a push button. I'll probably end up having to troubleshoot this when I get my slew mod. You may actually need to comment out the TDC button, but I'm about to go to bed so can't figure out its proper name at this very moment, will follow up when I next have time.

Member of TAW-North America.

Practices Thursdays at 2045 Eastern. Missions Sundays at 1945 Eastern.

F/A-18C | A-10C | AV-8B | M2000C | Huey | KA-50

Link to comment
Share on other sites

Oh, you know what? I have one of the upgraded slews, so I don't have a mini-stick that pushes in like the original. I bet that's the issue. I'll try commenting out that line and I bet it works.

 

So all the TBTNs in that line caused an error. Removing them brought up another error:

 

Runtime Error: Index out of bounds for: joy0 in MapKey ( line 348 in targetdx128.tmh )

 

so I am guessing my slew mod is messing with it somehow. Oh well, back to the luas for me unless someone more clever can figure it ;)

 

Still, a great thing you have done for those it works for.

This is a bit of an educated guess, but I looks like line 348 is the first step in the function that maps peripheral buttons. I wonder if the index error is because somehow TARGET recognizes that there is no longer an installed SC (TDC depress). Please try the attached file with the original targetdx128 (all I did was remove the SC assignment.)

WarthogThrottleALLSwitchPosNOTDC.tmc.txt

Member of TAW-North America.

Practices Thursdays at 2045 Eastern. Missions Sundays at 1945 Eastern.

F/A-18C | A-10C | AV-8B | M2000C | Huey | KA-50

Link to comment
Share on other sites

Tried that, got:

 

Runtime Error: Index out of bounds for: joy0 in MapKey ( line 348 in targetdx128.tmh )

 

again. Also, fwiw, when I edited line 867 I first just deleted TBTN1, and it flagged TBTN2, so I deleted that, and it his TBTN 3 and 4, so I deleted the whole line which got me to the line 348 error.

Link to comment
Share on other sites

Hi ReflexArc, the first time I tried running the script it gave:

 

Compile Error: Symbol not found: TBTN1 in targetdx128.tmh at line 867

 

I'm really excited to get this working! Some of the .luas are very annoying for a lug like me.

 

 

Same error here and no mods to the throttle.

There is no targetdx128.tmh reference file.

 

There a target.tmh file though.

Link to comment
Share on other sites

Catseye, it sounds like you didn't put targetdx128.tmh in the target /scripts folder?

 

Actually, re-reading sedenion's thread (he's the one who figured out the 128 buttons thing), I wonder if you're using old versions of TARGET--that was the issue for a poster who was running into the same error a couple of years ago.


Edited by ReflexArc

Member of TAW-North America.

Practices Thursdays at 2045 Eastern. Missions Sundays at 1945 Eastern.

F/A-18C | A-10C | AV-8B | M2000C | Huey | KA-50

Link to comment
Share on other sites

Catseye, it sounds like you didn't put targetdx128.tmh in the target /scripts folder?

 

Actually, re-reading sedenion's thread (he's the one who figured out the 128 buttons thing), I wonder if you're using old versions of TARGET--that was the issue for a poster who was running into the same error a couple of years ago.

 

 

Hmmm, yes but I'll double check what I may have done wrong.

Thanks.

Link to comment
Share on other sites

  • 2 weeks later...

Nicely done! You played around with rolling the Stick into this script? Looks like you exclude it, wasn't sure if you had hit any issues implementing it as well. My dream has always been to throw a modifier key in (like ctrl or shift) on the stick instead of using layers. This might be able to realize my dream.

Link to comment
Share on other sites

what do you mean when you say the stick, is the idea to make the stick more dynamically responsive kind of like the real one?

SYSTEM SPECS: Hardware Intel Corei7-12700KF @ 5.1/5.3p & 3.8e GHz, 64Gb RAM, 4090 FE, Dell S2716DG, Virpil T50CM3 Throttle, WinWIng Orion 2 & F-16EX + MFG Crosswinds V2, Varjo Aero
SOFTWARE: Microsoft Windows 11, VoiceAttack & VAICOM PRO

1569924735_WildcardsBadgerFAASig.jpg.dbb8c2a337e37c2bfb12855f86d70fd5.jpg

Link to comment
Share on other sites

  • 1 year later...

Helly guys,

 

Thanks it is very helpfull!

 

Nevertheless I tried to create a combined profile for the Warthog throttle and the joystick but I did not succeed.

 

I did take the targetdx128.tmh and WarthogThrottleALLSwitchPos.tmc files and I tried to modify the WarthogThrottleALLSwitchPos.tmc file in which I have added the axis and the buttons of the Joystick but it does not work, I have attached an example.

 

Unfortunately I am very new and bad with Thrusmaster Script, do you have any idea of what I did wrong?

 

(FYI I did changed the extensions to *.txt to upload them)

targetdx128.tmh.txt

WarthogThrottleALLSwitchPos.tmc.txt

Example.tmc.txt

Link to comment
Share on other sites

Helly guys,

 

Thanks it is very helpfull!

 

Nevertheless I tried to create a combined profile for the Warthog throttle and the joystick but I did not succeed.

 

I did take the targetdx128.tmh and WarthogThrottleALLSwitchPos.tmc files and I tried to modify the WarthogThrottleALLSwitchPos.tmc file in which I have added the axis and the buttons of the Joystick but it does not work, I have attached an example.

 

Unfortunately I am very new and bad with Thrusmaster Script, do you have any idea of what I did wrong?

 

(FYI I did changed the extensions to *.txt to upload them)

 

You are excluding your joystick from the script so I guess it won't work.

Remove "Configure(&Joystick, MODE_EXCLUDED);" at line 5.

 

I advise you to add a line for all the device and simply comment with two slash // the line of the device you want to include.

So in your case it would be :

// Configure(&Joystick, MODE_EXCLUDED);

Configure(&JoystickF18, MODE_EXCLUDED);

Configure(&HCougar, MODE_EXCLUDED);

 

Configure(&T16000L, MODE_EXCLUDED);

Configure(&T16000, MODE_EXCLUDED);

 

Configure(&LMFD, MODE_EXCLUDED);

Configure(&RMFD, MODE_EXCLUDED);

 

Configure(&TFRPHARudder, MODE_EXCLUDED);

Configure(&TFRPRudder, MODE_EXCLUDED);

 

// Configure(&Throttle, MODE_EXCLUDED);

Configure(&TWCSThrottle, MODE_EXCLUDED);

 

Not a must, be cleaner, you won't see this kind of stuff in your log :

No USB HID devices - device "VID_044F&PID_0404" cannot be found

No USB HID devices - device "VID_044F&PID_0403" cannot be found

No USB HID devices - device "VID_044F&PID_B68F" cannot be found

...

 

 

The rest looks good to me. Btw, are you johntarr on the Hotas Discord? Hon0 here :v:

Link to comment
Share on other sites

  • 2 weeks later...

Running script: C:\Users\fulvi\Documents\TARGET Profiles\Nuova cartella\WarthogThrottleALLSwitchPos.tmc

Compile Succeeded.

Physical USB HID devices managed by script!

Currently plugged USB HID devices[3]:

1: "F16 MFD 1" - "USB\VID_044F&PID_B351&REV_0100"

2: "Throttle - HOTAS Warthog" - "USB\VID_044F&PID_0404&REV_0100"

3: "F16 MFD 2" - "USB\VID_044F&PID_B352&REV_0100"

USB HID device "Throttle - HOTAS Warthog"(USB\VID_044F&PID_0404\6&217C136&0&4) selected

Script stopped!

 

Runtime Error: Incorrect parameters number for: sprintf in GetIndexJoy ( line 179 in targetdx128.tmh )

 

i tried to run the script but i got this error, any idea?

thanks

Link to comment
Share on other sites

I have no idea, maybe someone else will be more at ease with this topic.

 

The only proposal I can do is to test with my files, just before running them make sure to:

  1. Open Throttle_ALL_SwitchPos.tmc with Notepad++ or juste Notepad
  2. Make sure you have the "//" only in front of the devices you want to use.
    //Configure(&Throttle, MODE_EXCLUDED);
    //Configure(&Joystick, MODE_EXCLUDED);
    Configure(&LMFD, MODE_EXCLUDED);
    Configure(&RMFD, MODE_EXCLUDED);
    Configure(&HCougar, MODE_EXCLUDED);
    Configure(&T16000, MODE_EXCLUDED);
    Configure(&TWCSThrottle, MODE_EXCLUDED);
    Configure(&TFRPRudder, MODE_EXCLUDED);
    Configure(&T16000L, MODE_EXCLUDED);
    Configure(&TFRPHARudder, MODE_EXCLUDED);
    Configure(&JoystickF18, MODE_EXCLUDED);
  3. If necessary modify as needed and save.

 

 

Edit: if you do not have the error message anymore let me know exactly which devices you are using as the file will have to be edited to match them.

Throttle_ALL_SwitchPos.zip


Edited by terega
I forgot an information.
Link to comment
Share on other sites

  • 4 weeks later...

Hey all, I know this thread is old, but trying to get this script to work for my Warthog and ran into this error message...seems to not like my rudder pedals? Can anyone help me out with what I might need to do to make the throttle script work? Thanks much!

 

Mapped plugin module "C:\Program Files (x86)\Thrustmaster\TARGET\Plugins\sys.dll"

Physical USB HID devices managed by script!

Currently plugged USB HID devices[3]:

1: "Joystick - HOTAS Warthog" - "USB\VID_044F&PID_0402&REV_0100"

2: "Throttle - HOTAS Warthog" - "USB\VID_044F&PID_0404&REV_0100"

3: "T-Rudder" - "USB\VID_044F&PID_B679&REV_0110"

Installing filter driver to VID_044F&PID_0404. Please Wait...Script stopped!

Done!

Error: (internal) cannot associate a filter with the selected USB HID device "VID_044F&PID_0404"

 

Runtime Error: STOP request received while running main on line 12 in "C:\Program Files (x86)\Thrustmaster\TARGET\scripts\WarthogThrottleALLSwitchPos.tmc"

Error: Script run timed out!

[sIGPIC][/sIGPIC]

Website:https://cvw-8.enjin.com/

Discord:https://discord.gg/b8AgE5m

Link to comment
Share on other sites

the problem is with your throttle

 

1: "Joystick - HOTAS Warthog" - "USB\VID_044F&PID_0402&REV_0100"

2: "Throttle - HOTAS Warthog" - "USB\VID_044F&PID_0404&REV_0100"

3: "T-Rudder" - "USB\VID_044F&PID_B679&REV_0110"

Installing filter driver to VID_044F&PID_0404. Please Wait...Script stopped!

 

, i must admit i dont map my rudder in Target (when i still had a thrustmaster rudder) and i do remember it giving me an error when i tried ...

 

try adding in

//Exclude unused devices 
	Configure(&HCougar, MODE_EXCLUDED);
	Configure(&T16000, MODE_EXCLUDED);
	Configure(&T16000L, MODE_EXCLUDED);
	Configure(&LMFD, MODE_EXCLUDED);
	Configure(&RMFD, MODE_EXCLUDED);
	Configure(&TFRPRudder, MODE_EXCLUDED);
	Configure(&TWCSThrottle, MODE_EXCLUDED);
	Configure(&TFRPRudder, MODE_EXCLUDED);

 

to the top of your file after int main() {

SYSTEM SPECS: Hardware Intel Corei7-12700KF @ 5.1/5.3p & 3.8e GHz, 64Gb RAM, 4090 FE, Dell S2716DG, Virpil T50CM3 Throttle, WinWIng Orion 2 & F-16EX + MFG Crosswinds V2, Varjo Aero
SOFTWARE: Microsoft Windows 11, VoiceAttack & VAICOM PRO

1569924735_WildcardsBadgerFAASig.jpg.dbb8c2a337e37c2bfb12855f86d70fd5.jpg

Link to comment
Share on other sites

Actually, looking at it now, it looks like it might be some problem with the throttle...weird. I'm running the latest version of TARGET and firmware is updated.

[sIGPIC][/sIGPIC]

Website:https://cvw-8.enjin.com/

Discord:https://discord.gg/b8AgE5m

Link to comment
Share on other sites

try excluding the TPR and see what happens

 

&TFRPHARudder

 

for tpr rudders


Edited by speed-of-heat

SYSTEM SPECS: Hardware Intel Corei7-12700KF @ 5.1/5.3p & 3.8e GHz, 64Gb RAM, 4090 FE, Dell S2716DG, Virpil T50CM3 Throttle, WinWIng Orion 2 & F-16EX + MFG Crosswinds V2, Varjo Aero
SOFTWARE: Microsoft Windows 11, VoiceAttack & VAICOM PRO

1569924735_WildcardsBadgerFAASig.jpg.dbb8c2a337e37c2bfb12855f86d70fd5.jpg

Link to comment
Share on other sites

  • Recently Browsing   0 members

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