Release Thrustmaster Warthog Script Sharing (For advanced Warthog User CMDR's with HCS Keybinds)

Hi Touille,

Good and bad news here (bad is my fault) - good news is the rudder pedals work perfectly giving 3 axis on the pedals and a combined axis (marked throttle).

The bad news is a got my buttons mixed up, know wonder you thought putting secondary fire on S1 was awkward. What I should have said is how easy to swap S2 and S3 (NSB) allowing use of the little finger to fire the secondary.

Really sorry about that, know you went and changed that fast, as we are all different I can see 3 possible locations for secondary S2, S3 and S4 may look at defining there function in settings.

Also no problem no using my photos, I can give you links to ones without the copyright if you want. Also another Cmdr (CMDR Atik) I know also does Astrophotography which is how we know each other and just spoken to him and happy for me to post a link to his photos http://www.astrobin.com/users/julianr/
 
Last edited:
Hi Touille,

Good and bad news here (bad is my fault) - good news is the rudder pedals work perfectly giving 3 axis on the pedals and a combined axis (marked throttle).

The bad news is a got my buttons mixed up, know wonder you thought putting secondary fire on S1 was awkward. What I should have said is how easy to swap S2 and S3 (NSB) allowing use of the little finger to fire the secondary.

Really sorry about that, know you went and changed that fast, as we are all different I can see 3 possible locations for secondary S2, S3 and S4 may look at defining there function in settings.

Also no problem no using my photos, I can give you links to ones without the copyright if you want. Also another Cmdr I know also does Astrophotography which is how we know each other and just spoken to him and happy for me to post a link to his photos http://www.astrobin.com/users/julianr/
In ED+HCS v2.2.tmc
Find
Code:
SetShiftButton(&Joystick, S3, &Throttle, APPAT, APALT);
Replace with
Code:
SetShiftButton(&Joystick, S2, &Throttle, APPAT, APALT);
Find
Code:
	MapKey (&Joystick, S2, EXEC("initFire();"));
	MapKeyR(&Joystick, S2, EXEC("initFire();"));
Replace with
Code:
	//MapKey (&Joystick, S2, ;")); 	// Modifier S2 don't touch this
Find
Code:
	//MapKey(&Joystick, S3, 0);	// Modifier S3 don't touch this
Replace with
Code:
	MapKey (&Joystick, S3, EXEC("initFire();"));
	MapKeyR(&Joystick, S3, EXEC("initFire();"));

in ALL the files (ED+HCS...)
Find all
Code:
Joystick[S3]
Replace with
Code:
Joystick[S2]
Find all
Code:
!Joystick[S3]
Replace with
Code:
!Joystick[S2]
Find all
Code:
Joystick[S2]
Replace with
Code:
Joystick[S3]
Find all
Code:
!Joystick[S2]
Replace with
Code:
!Joystick[S3]
And you should be OK.
Take care with all the Joystick stuff. suggest to change [S3] to [S2x] and [S2] to [S3x] and after all are changed, change [S2x] to [S2] and [S3x] to [S3]. you can easily messed up with all the stuff all around if you change without midle change (sry hard to explain with my english skill)
If you know notepad++, i suggest to use it to change all the Joystick[S3] and !Joystick[S3] in no time ^^
you will need to take note of all the function working with S3 in chart and readme will work with your chosen key (S2?)
If you got some problem, PM me. Will try to solve the problem outside thread

About the rudders : you use last beta? have you tried to change curve? If that work i will add curve's setting in settings file, and make the curve able to be changed on the fly. (in in ED+HCS v2.2_Functions_Hardware.tmh / initSetTFRPCurves(), check target script manual p27/60 to see how that work)

About your photos and your friend Photos link, thanks a lot. give him a [up] from me :). i'm Ok with the copyright :p (but will accept your link without)
 
Last edited:
I first tested the S1S2 beta and the pedals gave me the additional throttle axis on the combined, just switched to the beta and that axis is no longer present as expected.

Used to use Nopepad++ but switched to Ultraedit a few years back, costs though. Will test the curves now.

Thanks
 
All Axis from rudder still work? (can't test myself sorry)
You can Use what you want, (I just suggest ;) ) that will still be faster than search and replace in target script editor one by one ;)
 
Last edited:
Hi,

Some feedback - in device analyser for the device Thrustmaster Combined there are 8 axis X,Y...to Throttle, using the S1S2 beta the last axis (Throttle) is active and responds to both pedals being depressed, in the beta version this mapping is no longer present and nothing is mapped to Throttle.

In device analyser there is T-Rudder device which has 3 Axis, X, Y and Z (Right, Left pedal and centre twist) - all these can be mapped to the game though not 100% sure what you would use the combined throttle axis for.

Screenshot of the device analyser https://1drv.ms/i/s!Al9zKxDEar4LwXm67iDDgJS580mV

I would back out part of the changes applied to beta to allow the the 3 T-Rudder axis and the additional throttle axis when pressing both pedals simultaneously as gives the most options.

The curve should be applied to the Z-Axis of the T-Rudder.

I will have a play with the curves setup.
 
Hey guys, I just posted on Aussiedroid's steam page, I prepared some scripts to combine the toe brakes on a single axis while also allowing the game to see the trudder as a physical controller. This way I can map the toebrakes a vtrust (for example) and each toe independently as srv accel / brake. It allows for two basic modes (merge or greatest as vjoy) and you can curve it if you want, but it only applies to the virtual controller.

I also moved the majority of the code outside of eventHandler (only the combination happens there, the rest is default mapping). Take a look at https://github.com/TarodBOFH/ThrustmasterTARGETScripting

I would appreciate some help understanding the layers... I don't understand them so well... I've seen scripts with conditionals on the execs but also mentions to layers and I would like to know the difference.

Kind regards!,

CMDR Tarod Ararthin
 
Hi CMDR Tarod Ararthin

Will check your code after work, thanks for sharing :)

About the layer you can check the Script editor manual p20-p22.
Layer : select the layer you want to use by an action on a “master button”, Layer can be used only through Mapkey : MapKeyUMD, MapKeyIO, MapKeyIOUMD.
As I use a lot of command with the same modifier ( [S3] ) in this script I chose this way
Code:
SetShiftButton(&Joystick, H4P , &Throttle, APPAT, APALT); // Joystick H4P IO modifier, Throttle APPAT APALT UM modifier they don't do anything in next code (MapKeyIO)
Code:
MapKeyIO( &Joystick, TG1, EXEC("initSetCombinedFire(1);"), EXEC("ActKey(KEYON+DOWN+PrimaryFire);") );
Conditionals : can be used where you need in the code
Code:
MapKey(&Joystick, TG1, EXEC("
if(!Joystick[H4P]) ActKey(KEYON+DOWN+PrimaryFire); 
if(Joystick[H4P]) initSetCombinedFire(1);
"));
Both of the previous example should give you "same result"


..I can see 3 possible locations for secondary S2, S3 and S4 may look at defining there function in settings.
Thinking about defining this in settings to ... so everyone can use the script without much trouble (small hand, used to,...)

In device analyser there is T-Rudder device which has 3 Axis, X, Y and Z (Right, Left pedal and centre twist) - all these can be mapped to the game though not 100% sure what you would use the combined throttle axis for.

I would back out part of the changes applied to beta to allow the the 3 T-Rudder axis and the additional throttle axis when pressing both pedals simultaneously as gives the most options.
Try this
Comment this line
Code:
GameOutput(&o, TRPRIGHT, Differential_Toe);
Launch script and game : try to bind "axis when pressing both pedals simultaneously" in ED.
If you can Bind , close game and script, uncomment the same line, relaunch both and try ingame

And Thanks for the feedback :)

Edit:
Monoceros and CMDR Tarod Ararthin : If you want, I can give you acces to this github and add some branch to let you make some try/change (Btw, i'm still noob on github stuff..). Since i don't have Trudders and MFD, I can't make test on them. I will appreciate your help for this (and, also, for other part of the code : As I said in readme, " I'm sorry for my English, as it is not my native language. You are Welcome to help me on my English Skill, and, obviously, with my Coding Skill (it is, also, not my native language) ;)" ).

We can combine our strength (and weakness), and make this script better
 
Last edited:
Thinking about defining this in settings to ... so everyone can use the script without much trouble (small hand, used to,...)
I went though the scripts last night and added defines for S1, S2 and S3 so I could mess around with the best shift button location for me, personally now played with this setup may swap the shift with PTT.

Was considering a small GUI app for the settings side of things, will also allow for sanity checking if expanded to allow for swapping of some keys.


Try this
Comment this line
Code:
GameOutput(&o, TRPRIGHT, Differential_Toe);
Launch script and game : try to bind "axis when pressing both pedals simultaneously" in ED.
If you can Bind , close game and script, uncomment the same line, relaunch both and try ingame

And Thanks for the feedback :)
Will give this a go later today, have a 1/2 day.

Edit:
Monoceros and CMDR Tarod Ararthin : If you want, I can give you acces to this github and add some branch to let you make some try/change (Btw, i'm still noob on github stuff..). Since i don't have Trudders and MFD, I can't make test on them. I will appreciate your help for this (and, also, for other part of the code : As I said in readme, " I'm sorry for my English, as it is not my native language. You are Welcome to help me on my English Skill, and, obviously, with my Coding Skill (it is, also, not my native language) ;)" ).

We can combine our strength (and weakness), and make this script better
I am open to this, will need to load up TortoiseGit again, see if can get my head round it.
 
Hi CMDR Tarod Ararthin
Monoceros and CMDR Tarod Ararthin : If you want, I can give you acces to this github and add some branch to let you make some try/change (Btw, i'm still noob on github stuff..). Since i don't have Trudders and MFD, I can't make test on them. I will appreciate your help for this (and, also, for other part of the code : As I said in readme, " I'm sorry for my English, as it is not my native language. You are Welcome to help me on my English Skill, and, obviously, with my Coding Skill (it is, also, not my native language) ;)" ).

We can combine our strength (and weakness), and make this script better
So basically a Layer should be used whenever more than a few bindings are using the same modifier. Got it.

Thanks for the offering... but I'm lacking time =/

I had to replace my broken X-56 (sent via warranty on a X-55) and I got my TM last week... still have not launched the game... still setting it up heh.

What's your native language? I can speak French fluently (worked during 4 years half of my time at Lille), and so far you're not having much problems with English it seems.

I got lost in the conversation when you talk about beta... what's that beta you're talking about? Is it a TARGET beta I should be aware? is it 2.3 beta or is it your own macros beta version? (drop me a couple of links, no need to dedicate time reexplaining everything)

Fly safe, CMDRs
 
Thanks for the offering... but I'm lacking time =/ ...
What's your native language? I can speak French fluently (worked during 4 years half of my time at Lille), and so far you're not having much problems with English it seems.
I got lost in the conversation when you talk about beta...
Anityme, if you want to join, let me know : We are all lacking time :)

French, I'm from Lille (close to) . Taken some holidays in UK (Canterbury and London (3 weeks)) when I was young, and can't speak English fluently :D

The beta we talk about , it's the github beta branch of the script (check first post or click here )

Edit: As requested, Pushed New beta with possibility to change some key in settings file : (Modifier key, FA key, Secondary Fire key, Toggle Hardpoint Key). Didn't tested yet still @ work :(
 
Last edited:
First post Updated with new link for 2.3 Commander compatible version (beta : will start to work on it this weekend).

Going forward, I will update the first Post as required, so check it once in a while

o7 CMDR's
 
Hey, just registered to the forums to say nice job on a great profile, and thanks for the shout out! I'll put up a link on my site for any ED players that wander by looking for a HOTAS profile that works.

Maybe I can play ED now! I seriously never tried it because I dreaded coding up a whole new mapping! I'll use this profile instead :)

Cheers,
Solarfly
 
When you said for advanced Warthog User you wern't kidding

Hi CMDR Touille,

I recently bought a Warthog Throttle and Stick and have been using a TARGET GUI profile until I could learn enough of the Scripting Language to build a script.
I just finished a script this evening that compiles and runs without errors. It's pretty simple, although it does use macro's and a couple of CHAINed events.
While researching gaping holes in the TARGET script manual, I noticed what appeared to be evidence that many Warthog users advise against using TARGET scripts and suggest that people just use default DirectX bindings. I was shocked, without TARGET I don't think they will even be able to use all of their buttons/hats/switches. People have said that TARGET is useless and even some who use it, recommend using as many DX buttons as possible on the Throttle as otherwise they say the keyboard buffer overflows and Elite misses commands (I am willing to bet that this is due to poor scripting).
I must say I feel really sad that people are missing out on the potential of their wonderful hardware.
I promised myself that I would try and help as many people as possible either by providing scripts if people don't want to write their own or just help with scripting problems otherwise.
I hadn't seen your thread at that time. I just had a quick look at your code and I was amazed. I am definitely going to have to spend a significant amount of time studying it and I will try it out as well.
I have very little experience posting on forums and I wondered if you had any advice about starting a thread to fulfill my above stated goals?

P.S.
I have been a Thrustmaster fan for the last 25 years having owned an F16 FLCS, a HOTAS Cougar throttle and stick and now a Warthog.
I also have some experience coding in a PC environment in Python, Java (I hate Java) and C. I have also used C to program Atmel micro controllers.

Regards,

CMDR Burnt Phoenix
 
Apologies about necro-ing this thread (sorry, not sorry!)

@Touille I stumbled across your github and version 3.3 today and wow!
Yeah, I know you haven't been active here for a while but hoping you see this and maybe answer a question or two I have.

Your script serves as both inspiration and motivation but also shows just how crap my TARGET Script coding skills are!
(looks like I do things the hard+wrong way!)

So, question...I see you use the ability to send data over TCP to TARGET.
I'm interested to understand if it works on a pseudo interrupt basis.
Can I assume your C++ code sends the data periodically across TCP and Target simply listens, grabs the return code and assigns to your "Flags" variable?

Cheers
Clicker
 
Top Bottom