Guide / Tutorial Get your Basic TARGET Script - PIPs and Curves here.

Hi @epoch5 ,

I do not address this within the script in this thread.
If you have a WARTHOG, you can use the coolie switch on the throttle (for example) as a digital yaw.
(ie it’s either ON or OFF with no in-between)...not ideal but is do-able)

If you have started using my script and want to add yaw via the coolie (or other unused switch) and need help coding it, let me know and I’ll be happy to assist.

Another option is to take a look at Aussiedroid’s very comprehensive script...he has both pedal support and coolie switch support for yaw already coded in.

Clicker
Thanks
 
Thanks for the script and the tutorials, they've been helpful.

The only issue I've had (T16000) is that certain joystick inputs duplicate strokes in the ED Settings, which prevents them from being mapped to alternate functions (HAT down produces two strokes meaning you can't assign it to landing thrust overrides or the nav menu whereas left, up, right work after adding the TEMPO script. I tried reproducing that script for HAT down, but it produces 'Compile Error: Syntax error: ; in edscript.tmc at line 47'. Similarly, the other stick buttons produce (JOY1 + JOY1), (JOY2 + JOY2), etc.
 
Hi @Alithian ,

Use the keyboard in ED settings and not the joystick to bind things....especially the hat.
Remember, you must have the script running before loading the game or else it will not save your bindings and therefore will not work in game.

If you want the hat to do more than one function, take a look at my tutorial on "Layers".
This is the best method for the HAT if you wish to keep the PIPManagement AND use it for lateral and vertical thrusters.
If you run into issues, let me know and I'll try to help you out.

Your issue with the hat in nav menu is possibly solved by using R_SHIFT+Arrow for the pip management stuff instead of just the arrow.

Regarding the "compile error", this error usually means you've left out a closing ")" ... so check that first.

I'm not 100% sure I follow what you mean about 'other stick buttons produce (JOY1 + JOY1)..." etc....can you explain what you are trying to do and which buttons you are trying to use?

If you get stuck, come back here and ask and I'll be happy to help.

Clicker
 
Last edited:
Commander Maenden, you really need to mow your lawn first...... :)

I had issues using the arrow keys for navigating the panels using Clicker's script. Below is what Clicker advised:

Sounds a bit like an issue I had some time back when I wanted to use the arrows for panel navigation as well as pip management...if this what you are saying then my solution is to use "RightShift+Arrow" for pip management and bind non-shifted arrows to panel nav.

In the EDGlobalVars.tmh file, change:

define PowerEng USB[0x52] // UP Arrow
define PowerWep USB[0x4F] // RIGHT Arrow
define PowerSys USB[0x50] // LEFT Arrow
define BalancePower USB[0x51] // DOWN Arrow

to:

define PowerEng R_SHIFT+USB[0x52] // RSHIFT+UP Arrow
define PowerWep R_SHIFT+USB[0x4F] // RSHIFT+RIGHT Arrow
define PowerSys R_SHIFT+USB[0x50] // RSHIFT+LEFT Arrow
define BalancePower R_SHIFT+USB[0x51] // RSHIFT+DOWN Arrow

then in the ED Game controller settings change your pip management from simple arrows to RightShift+arrows.


The pip management settings is found under "miscellaneous"

so instead of [up arrow] you have [RightShift+up arrow]

o7

Bump. Sorry for that. But I'm having an issue with this. Even if i do this the game still treats the hat switch as pip management. I cant use the hat switch anymore to navagate anything?
 
Bump. Sorry for that. But I'm having an issue with this. Even if i do this the game still treats the hat switch as pip management. I cant use the hat switch anymore to navagate anything?
Sethiest, I am going to have to try to remember what I did because I now am using throttle and mouse. I believe I had the pip management on the hat switch on my thrustmaster 16000 stick and the navigation arrows on the twcs throttle hat switch, the topmost one. I don't think that you can navigate anymore or even anything else once you have defined a TARGET pip macro to it. This would be something that Clicker would know because he is an actual coder. For the short term, I would bind the navigation arrows to something other.

The TARGET software is very powerful but I needed Clicker the pirate to help me. He is very nice, do not be afraid to contact him. Be sure to specify that you are using the 16000 hotas because he uses a Warthog. I am sorry if this did not help you much. Good luck to you.

o7
 
Hi @Sethiest,

I’ve sent you a PM requesting some info on the PIP Management question.

Regarding the navigation question, when you use this script and the HAT for PIP Management, it fires a sequence of arrow keys and as such is not suitable to use the same hat to navigate the panels.

If you want to use the keyboard arrow keys to navigate the panels, then it is best to change the script based on the quoted solution in your post, then within ED, in Control Settings, you bind arrows as the UI Navigation keys and then bind RightShift+Arrows as the PIP management keys.

If you REALLY want to use the same Hat switch to Navigate panels as well as PIP management, you might need to use a “modifier”.
I have included a couple of tutorials on this a little later on in the thread.
(the one you want is this one ... https://forums.frontier.co.uk/threa...ps-and-curves-here.480256/page-3#post-7792411 )
In case you are unfamiliar with “modifiers”, that’s when you press and hold one button then press the hat switch.
This is a method of being able to use the hat to perform different things (ie fire different keys)

I’m more than happy to help you out if you wish to have a go at this and get stuck.

Clicker
 
Last edited:
07 Commanders,


I wanted separate curves for the sick and rudder. Here's what I did.

In EDGlobalVars.tmh:



Code:
    short JS_CURVE[]    = {4, 5, 2};
    short JS_ZOOM[]        = {0, -2, -1};
    short JS_CURVER[]     = {4, 5, 5};
    short JS_ZOOMR[]        = {0, -2, -2};



I made another thingy called JS_ZOOMR. This part controls how the curves are parsed, so I just added another one and named it a slightly different thing. I guess programming sometimes works like that. Yay.


In the EDScript.tmh:


Code:
int initSetJoystickCurves(int profile) {
            SetSCurve(&T16000, JOYX, 0, 1, 0, JS_CURVE[profile], JS_ZOOM[profile]);
            SetSCurve(&T16000, JOYY, 0, 1, 0, JS_CURVE[profile], JS_ZOOM[profile]);
            SetSCurve(&TWCSThrottle, TRDR, 0, 1, 0 , JS_CURVER[profile], JS_ZOOMR[profile]);
            printf("Curves set to %d\x0a", profile);                // Print message to TARGET console
        }
    // end of initSetJoystickCurves() function




I have the HOTAS so JS_CURVE and JS_ZOOM profiles are applied to the joystick, while the JS_CURVER and JS_ZOOMR profiles are applied to the rudder on the throttle.

One last thing I had to do...


Code:
//    Configure(&TWCSThrottle, MODE_EXCLUDED);



        MapAxis(&T16000, JOYX, DX_X_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
        MapAxis(&T16000, JOYY, DX_Y_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
        MapAxis(&T16000, RUDDER, DX_ZROT_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
        MapAxis(&TWCSThrottle, TRDR, DX_Z_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
        MapAxis(&TWCSThrottle, TTHR, DX_THROTTLE_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
        MapAxis(&TWCSThrottle, TANT, DX_SLIDER_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
        MapAxis(&TWCSThrottle, TMSTX, DX_XROT_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
        MapAxis(&TWCSThrottle, TMSTY, DX_YROT_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);




        MapKey(&TWCSThrottle, TLOCK, DX17);
        MapKey(&TWCSThrottle, TBTN2, DX18);
        MapKey(&TWCSThrottle, TBTN3, DX19);
        MapKey(&TWCSThrottle, TBTN4, DX20);
        MapKey(&TWCSThrottle, TBTN5, DX21);
        MapKey(&TWCSThrottle, THAT1U, DX22);
        MapKey(&TWCSThrottle, THAT1R, DX23);
        MapKey(&TWCSThrottle, THAT1D, DX24);
        MapKey(&TWCSThrottle, THAT1L, DX25);
        MapKey(&TWCSThrottle, THAT3U, DX26);
        MapKey(&TWCSThrottle, THAT3R, DX27);
        MapKey(&TWCSThrottle, THAT3D, DX28);
        MapKey(&TWCSThrottle, THAT3L, DX29);
        MapKey(&TWCSThrottle, THAT2U, DXHATUP);
        MapKey(&TWCSThrottle, THAT2R, DXHATRIGHT);
        MapKey(&TWCSThrottle, THAT2D, DXHATDOWN);
        MapKey(&TWCSThrottle, THAT2L, DXHATLEFT);

// out that twcsthrottle exclude line because it's now being used in the configuration.



I then remapped everything to the DX inputs and the DX POV hat. I had to start on DX17 because there's 16 buttons on the joystick. I'm not sure if there is an easier way to do this but I typed all of this. The thumb button on the throttle is missing because it's already somewhere else in the code for the flight assist toggle, but if you want that, it would look like:

Code:
MapKey(&TWCSThrottle, TBTN1, DX30);

Where 30 is the next number in the sequence, hence DX30, and TBTN1 is the assigned name of the thumb button.

I'm not sure if this was necessary but I was having issues where Elite won't detect the buttons once I mapped the throttle axis. Mapping all of the buttons individually solved it.

Cheers.


Lemme know if you need help for your specific situation with this; I have been messing around with it for a few days and I think I have a little bit of a good understanding of the TARGET scripts now and how things are formatted. Also the PDF on the Thrustmaster website literally has everything....except what "Rotate" does in the curve editor lol.
 
Good evening all, you TARGET commanders!
After trying to run the TARGET software on my own for several days, and next with the help of this thread, I need to surrender! Please help me to understand what is happening here:

  • I have a T 16000 + TWCS Throttle,
  • I am playing on a laptop with two USB ports (one for mouse and second for the USB hub which is used for the joystick and the throttle),
  • while playing ED without the TARGET software, ED recognise both of the peripherials (connected to the USB hub), and I can bind any button, any button combination I want, BUT I don't have the curves available,
  • launching the TARGET GUI (with both joystick and throttle connected to the USB hub) results with none working - I was checking the response in the Test device panel
  • launching the TARGET GUI (with both joystick and throttle connected to a different USB ports) results with both controllers working - I was checking the response in the Test device panel and in-game, BUT the game (or the TARGET software) uses the same axis for Throttle up/down and Joystick roll, the same button for Joystick button 1 (fire) and the Throttle button one and perhaps some more that I haven't checked yet,
  • copying the script and running it, ended with almost the same - buttons overlapping (from the joystick and the throttle) - but the curves are working ! :)


All in all - I am here just for the curves - using the TARGET GUI enables the curves, but causes problems with the key bindings.

Can anyone help me ?
 
I can try to help!

One thing you need to understand (Well, a couple really)...

When you don’t use TARGET GUI/Script, your Joystick and Throttle are treated by Windows and the game as 2 seperate controllers. Binding buttons etc is easy and simple. The downside is you can’t do any fancy stuff.

As soon as you use the TARGET GUI or script, the Thrustmaster Software (aka TARGET), creates a single, combined controller in Windows (and therefore the game).

Any in game controller bindings you made originally, no longer apply. The profile you created to customise your controllers will not work. They are NOT gone...it’s just that the game can no longer “see” the controllers you used to create the profile, because, they don’t exist....they were replaced with the combined controller.

If you want to keep your original profile....find and rename the “.binds” file.
You will also need to use notepad to edit the second line in the file (it’s an XML text file) and change the title inside...this will appear as a selection each time you run the game without TARGET running.

So, what you need to do is create a new customised binding profile in game when you use TARGET.
This is certainly a PITA, but it’s the only way.

Regarding my script...
Once you run it, and run the game for the first time, you still need to create your bindings profile for the buttons and switches and axes (for the FIRST TIME ONLY).
Again, probably best to go ahead and rename this ”.bind” file and change the title within.
You don’t have to as it’ll become “custom.binds” anyway.
I change mine so I can keep track of versions etc that I create, but that’s way overkill for the average player who just wants to get in and just play!!!

Hope this helps your understanding.

Happy to help further if you need.

Cheers
Clicker
 
...one more thing...I found my HOTAS only worked reliably using a powered USB hub.

So, if you experience wierd behaviour, you might need to spring for a powered hub if yours isn’t.

Clicker
 
Hey Clicker, thanks for the answer!
After reading this whole thread, I understand that the TARGET creates one virtual device which is used in ED, and thus all the bindings are gone. This is the easy part.
One thing I cannot pass, is the overlapping buttons - for example: JOY1 and THRUST1 (I don't remember the exact button names, but you get the idea) - In the Test Device Panel (in TARGET) pressing any of those two buttons results in one output. Is there a way to distinguish which button was pressed?

Again, I am only trying to do this for the curves, if there is another easy way to enable the curves (with deadzones) I can give it a try.

Cheers!
 
One thing I cannot pass, is the overlapping buttons - for example:
Remap the buttons.


Code:
        MapKey(&TWCSThrottle, TLOCK, DX17);
        MapKey(&TWCSThrottle, TBTN2, DX18);
        MapKey(&TWCSThrottle, TBTN3, DX19);
        MapKey(&TWCSThrottle, TBTN4, DX20);
        MapKey(&TWCSThrottle, TBTN5, DX21);
        MapKey(&TWCSThrottle, THAT1U, DX22);
        MapKey(&TWCSThrottle, THAT1R, DX23);
        MapKey(&TWCSThrottle, THAT1D, DX24);
        MapKey(&TWCSThrottle, THAT1L, DX25);
        MapKey(&TWCSThrottle, THAT3U, DX26);
        MapKey(&TWCSThrottle, THAT3R, DX27);
        MapKey(&TWCSThrottle, THAT3D, DX28);
        MapKey(&TWCSThrottle, THAT3L, DX29);
        MapKey(&TWCSThrottle, THAT2U, DXHATUP);
        MapKey(&TWCSThrottle, THAT2R, DXHATRIGHT);
        MapKey(&TWCSThrottle, THAT2D, DXHATDOWN);
        MapKey(&TWCSThrottle, THAT2L, DXHATLEFT);



MapKey basically takes the physical input on your specified controller (TWCSThrottle here) and binds it to one of the virtual joystick inputs. It doesn't do this by itself for the throttle so you need to do it like this or else you'll have weird controller binding issues in game. Like you'll have 2 JOY-1 for example if you don't do this.

We just mapped the keys there...now if you want curves, you need to also map the axis.


Code:
        MapAxis(&T16000, JOYX, DX_X_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
        MapAxis(&T16000, JOYY, DX_Y_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
        MapAxis(&T16000, RUDDER, DX_ZROT_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
        MapAxis(&TWCSThrottle, TRDR, DX_Z_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
        MapAxis(&TWCSThrottle, TTHR, DX_THROTTLE_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
        MapAxis(&TWCSThrottle, TANT, DX_SLIDER_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
        MapAxis(&TWCSThrottle, TMSTX, DX_XROT_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
        MapAxis(&TWCSThrottle, TMSTY, DX_YROT_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);

I had to go into the TARGET GUI to find the names of all the things for this part.



Now that you mapped your axis...I need to know exactly what you want to do with curves. Do you just want curves or do you want ones that you can swap when you toggle Flight Assist? Because that is going to look different.
 
I am at work right now, but I am sure I've done the Trottle axis mapping, I will check it in the evening about the Throttle buttons map. I will post my script in the evening.

And for the curves.. I want them to be turned on all the time for my FA-off flying lessons :)

Cheers!
edit:
Here is my script, please have a look at it.
Code:
    include "target.tmh"
    include "EDGlobalVars.tmh"
   
    int main() {        // Exclude all but joystick supresses error messages in console on startup
   
        Configure(&HCougar, MODE_EXCLUDED);
//        Configure(&T16000, MODE_EXCLUDED);
        Configure(&T16000L, MODE_EXCLUDED);
        Configure(&Joystick, MODE_EXCLUDED);  
        Configure(&JoystickF18, MODE_EXCLUDED);  
//        Configure(&TWCSThrottle, MODE_EXCLUDED);
        Configure(&Throttle, MODE_EXCLUDED);
        Configure(&TFRPRudder, MODE_EXCLUDED);
        Configure(&TFRPHARudder, MODE_EXCLUDED);
        Configure(&LMFD, MODE_EXCLUDED);
        Configure(&RMFD, MODE_EXCLUDED);

        if(Init(&EventHandle)) return 1;
   
        SetKBRate(25, 75);
        SetKBLayout(KB_ENG);
       
        MapAxis(&T16000, JOYX, DX_X_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
        MapAxis(&T16000, JOYY, DX_Y_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
        MapAxis(&T16000, RUDDER, DX_ZROT_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
        MapAxis(&TWCSThrottle, TTHR, DX_Z_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
       

        MapAxis(&TWCSThrottle, TANT, DX_SLIDER_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
            MapAxis(&TWCSThrottle, TMSTX, DX_XROT_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
            MapAxis(&TWCSThrottle, TMSTY, DX_YROT_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
             MapKey(&TWCSThrottle, TLOCK, DX17);
              MapKey(&TWCSThrottle, TBTN2, DX18);
              MapKey(&TWCSThrottle, TBTN3, DX19);
               MapKey(&TWCSThrottle, TBTN4, DX20);
               MapKey(&TWCSThrottle, TBTN5, DX21);
             MapKey(&TWCSThrottle, THAT1U, DX22);
             MapKey(&TWCSThrottle, THAT1R, DX23);
            MapKey(&TWCSThrottle, THAT1D, DX24);
            MapKey(&TWCSThrottle, THAT1L, DX25);
            MapKey(&TWCSThrottle, THAT3U, DX26);
            MapKey(&TWCSThrottle, THAT3R, DX27);
            MapKey(&TWCSThrottle, THAT3D, DX28);
            MapKey(&TWCSThrottle, THAT3L, DX29);
            MapKey(&TWCSThrottle, THAT2U, DXHATUP);
            MapKey(&TWCSThrottle, THAT2R, DXHATRIGHT);
            MapKey(&TWCSThrottle, THAT2D, DXHATDOWN);
            MapKey(&TWCSThrottle, THAT2L, DXHATLEFT);

And now the curves (fixed values for now):

Code:
        int initSetJoystickCurves(int profile) {      
            SetSCurve(&T16000, JOYX, 0, 5, 0, 5, 0);
            SetSCurve(&T16000, JOYY, 0, 5, 0, 5, 0);
            SetSCurve(&T16000, RUDDER, 0, 5, 0, 5, 0);

I still need to add the curves for the lateral and vertical thrusters on the throttle, but this will come later.

So, any thoughts on my script?

edit2:
OK, I think I've managed to make it work! Yay! The only overlapping buttons are Joy1 (fire) and Throttle1 (red button under the thumb) - I can live with that. Curves are working for all three joystick axes, and for the lateral and vertical thrusters on the throttle. I've added also a deadzone in the middle for the thrust, as it was not so easy to set it at zero without the deadzone.

If anyone is interested I can post the script in the evening. I just need to "clean" it from my comments and some of the stuff I am not using.

Thank you @Clicker, @CMDR Poisenbery and everyone else involved!
Cheers!
 
Last edited:
This is a great thread, keep em coming.

I'm just migrating to a Dual T16k setup from an x52 pro so Target is pretty new to me.

I was wanting lots of buttons on the sticks so was initially looking at setting up IOUMD layers but with no physical toggle buttons it gets difficult to remember which layer I'm in so I've figured out I can use L_Shift and TEMPO to get up to 4 function per button.

Here's an example for those who might be interested. 4 functions on Right Stick button 2 from a combination of shift and short or long presses of button 2

//Right Maps​
MapKeyIO(&T16000, TS2, TEMPO('c', 'h', 500), TEMPO('b', 'g', 500)); //Shift short 'cargo scoop', Shift long 'hardpoints', short 'boost', long 'landing gear'​
//Left Maps​
SetShiftButton(&T16000L, TS1); //Left Stick trigger activates shift state whilst held​

After playing around with TEMPO a little more I've tweaked Clicker's original PIP distribution script from the 1st post.
Now if you use the Hat normally with a push and release you can distribute PIPs 1 at a time as normal and should be able to navigate the side screens normally but if you hold the hat for half a second Up, Left or Right you'll have the script execute the max ENG, max SYS or max WEP events.

//Right Hat-----------------------------------------------------------------------------------------------​
// (Data Management Switch) // PIP Management​
// ------------------------​
// PIPs = [SYS,ENG,WEP]​
MapKey(&T16000, H1U, TEMPO(UARROW, EXEC("initPIPMapper(ENG,WEP);"), 500)); // PIPs = [ 0, 4, 2 ]);​
MapKey(&T16000, H1L, TEMPO(LARROW, EXEC("initPIPMapper(SYS,ENG);"), 500)); // PIPs = [ 4, 2, 0 ]);​
MapKey(&T16000, H1R, TEMPO(RARROW, EXEC("initPIPMapper(WEP,ENG);"), 500)); // PIPs = [ 0, 2, 4 ]);​
MapKey(&T16000, H1D, DARROW, EXEC("initPIPMapper();")); // PIPs = [ 2, 2, 2 ]);​
 
Last edited:
Top Bottom