TARGET Script to use two Thrustmaster T16000 Joysticks with E:D

Hi back,

so now i change the script to default. Start the game but no respond fron joysticks? Confused...

in TARGET Jostick Control Panel there is a combined device but no respond to both or on both stick. also the leds off. when stop the script i see both sticks and they active, can check them... much more confused

the combined device put both physical sticks to one virtual? and there i can use the axes as i need? I also look into line 38 and the others you wrote down in the whole discusion, no changes... still combined stick can*t be checked in windows and no respond in ED. I*m left handed player so need flight on left side and thrust up and down on right


Regards & thanks
Raphael
 
Last edited:
in TARGET Jostick Control Panel there is a combined device but no respond to both or on both stick. also the leds off. when stop the script i see both sticks and they active, can check them... much more confused

Does this happen if you run the Target Script Editor in administrator mode (i.e. right click on TARGET Script Editor, and choose "Run as administrator..."), and also if you run it in normal user mode?

What version of Windows do you use?

the combined device put both physical sticks to one virtual? and there i can use the axes as i need?

Yes, that's how it should work.
 
Hi, wind 8.1 64bit

always start editor and gui as admin.

changes in script:

//-------------------------------------------------------------------------------------------------

// TARGET Script for playing "Elite: Dangerous" with two Thrustmaster T.16000M Joysticks

//-------------------------------------------------------------------------------------------------


include "target.tmh"

alias Stick1;
alias Stick2;


// Script Settings --------------------------------------------------------------------------------


// Choose whether to combine the two joysticks, or not.
// Combining them offer more flexibility, but there is currently a bug in the TARGET
// software, and the POV hat of the second stick won't be available.
// If set to '0', only 'Stick1' will be defined.
define JOYSTICKS_COMBINED 1 // '0' or '1' (default: '1')

define JOYSTICKS_INVERTED 1

// Which axis of which joystick to use as a throttle.
define THROTTLE_JOYSTICK Stick2 // 'Stick1' or 'Stick2'
define THROTTLE_AXIS JOYY // 'JOYY' or 'RUDDER'

// Define a specific button to use as an FA Toggle; this button will automatically set
// default speed to 0 when in FA Off. Note that in order to use this, the "Toggle Flight Assist"
// option in the game have to be set on hold (instead of toggle).
define FA_TOGGLE_ENABLED 0 // '0' or '1'
define FA_TOGGLE_JOYSTICK Stick2 // 'Stick1' or 'Stick2'
define FA_TOGGLE_BUTTON TS3 // 'TS1' .. 'TS4', 'H1L', 'H1U', 'H1R', 'H1D' or 'B5' .. 'B16'

// Define a specific button to use as a shift mode selector. When held down, all other buttons
// (of both joysticks) have a different binding.
define SHIFT_ENABLED 1 // 0 or 1
define SHIFT_JOYSTICK Stick2 // Stick1 or Stick2
define SHIFT_BUTTON TS1 // TS1 .. TS4, H1L, H1U, H1R, H1D or B5 .. B16


// Button Mapping ---------------------------------------------------------------------------------


int stick1ButtonMap[] = {
// The trigger
TS1, DX1, DX5,
// The 3 thumb buttons
TS2, DX2, DX6,
TS3, DX3, DX7,
TS4, DX4, DX8,
// The POV Hat
H1L, DXHATLEFT, DX9,
H1U, DXHATUP, DX10,
H1R, DXHATRIGHT, DX11,
H1D, DXHATDOWN, DX12,
// The 12 buttons on the base
B5, DX31, DX31,
B6, DX31, DX31,
B7, DX31, DX31,
B8, DX31, DX31,
B9, DX31, DX31,
B10, DX31, DX31,
B11, DX32, DX32,
B12, DX32, DX32,
B13, DX32, DX32,
B14, DX32, DX32,
B15, DX32, DX32,
B16, DX32, DX32
};

int stick2ButtonMap[] = {
// The trigger
TS1, DX13, DX17,
// The 3 thumb buttons
TS2, DX14, DX18,
TS3, DX15, DX19,
TS4, DX16, DX20,
// (Note: the hat on second joystick currently does not work)
H1L, DX21, DX25,
H1U, DX22, DX26,
H1R, DX23, DX27,
H1D, DX24, DX28,
// The 12 buttons on the base
B5, DX31, DX31,
B6, DX31, DX31,
B7, DX31, DX31,
B8, DX31, DX31,
B9, DX31, DX31,
B10, DX31, DX31,
B11, DX32, DX32,
B12, DX32, DX32,
B13, DX32, DX32,
B14, DX32, DX32,
B15, DX32, DX32,
B16, DX32, DX32
};


// Script Implementation --------------------------------------------------------------------------


int curve0, curve25, curve50, curve75, curve100;

int currentCurve;
float currentSpeed;

int isFAOn;

int main()
{
if(Init(&EventHandle)) return 1;

if(JOYSTICKS_COMBINED){
if(JOYSTICKS_INVERTED){
&Stick1 = GetIndexJoy(SelectUsbDevice("VID_044F&PID_B10A&REV_0500"));
&Stick2 = &T16000;
} else {
&Stick1 = &T16000;
&Stick2 = GetIndexJoy(SelectUsbDevice("VID_044F&PID_B10A&REV_0500"));
}
} else {
&Stick1 = &T16000;
}


// First Joystick

MapAxis(&Stick1, JOYX, DX_X_AXIS);
MapAxis(&Stick1, JOYY, DX_Y_AXIS);
MapAxis(&Stick1, RUDDER, DX_Z_AXIS);

mapButtons(&Stick1, &stick1ButtonMap);


// Second Joystick

if(JOYSTICKS_COMBINED){
MapAxis(&Stick2, JOYX, DX_XROT_AXIS);
MapAxis(&Stick2, JOYY, DX_YROT_AXIS);
MapAxis(&Stick2, RUDDER, DX_ZROT_AXIS);

mapButtons(&Stick2, &stick2ButtonMap);
}


// Curves

int min, max;
if(THROTTLE_AXIS == JOYY){
min = 0;
max = 100;
} else {
min = 100;
max = 0;
}

curve0 = LIST(0,min, 50, 0, 100,max);
curve25 = LIST(0,min, 50, 25, 100,max);
curve50 = LIST(0,min, 50, 50, 100,max);
curve75 = LIST(0,min, 50, 75, 100,max);
curve100 = LIST(0,min, 50,100, 100,max);

// Throttle Axis (on auxilliary joystick)

MapAxis(&THROTTLE_JOYSTICK, THROTTLE_AXIS, DX_THROTTLE_AXIS);

if(THROTTLE_AXIS == JOYY){
KeyAxis(&THROTTLE_JOYSTICK, THROTTLE_AXIS, 'ioumd',
AXMAP2(
LIST(0,1,99,100),
PULSE+DX32,
0,
PULSE+DX31
));
} else {
KeyAxis(&THROTTLE_JOYSTICK, THROTTLE_AXIS, 'ioumd',
AXMAP2(
LIST(0,1,99,100),
PULSE+DX31,
0,
PULSE+DX32
));
}

KeyAxis(&THROTTLE_JOYSTICK, THR, 0, AXMAP2(LIST(0,16,32 , 68,84,100),
EXEC("currentCurve = curve0; currentSpeed = 0.00; changeSpeedCurve();"),
EXEC("currentCurve = curve25; currentSpeed = 0.25; changeSpeedCurve();"),
EXEC("currentCurve = curve50; currentSpeed = 0.50; changeSpeedCurve();"),
EXEC("currentCurve = curve75; currentSpeed = 0.75; changeSpeedCurve();"),
EXEC("currentCurve = curve100; currentSpeed = 1.00; changeSpeedCurve();")
));


// Initialisation

currentCurve = curve100;
currentSpeed = 1.00;
isFAOn = 1;
changeSpeedCurve();
}


//-------------------------------------------------------------------------------------------------


int EventHandle(int type, alias o, int x)
{
DefaultMapping(&o, x);
}


//-------------------------------------------------------------------------------------------------


int mapButtons(alias device, alias list)
{
int length = elements(&list);
int i = 0;
while(i < length){
if(SHIFT_ENABLED & (&device == &SHIFT_JOYSTICK) & (list == SHIFT_BUTTON)){
SetShiftButton(&SHIFT_JOYSTICK, SHIFT_BUTTON, 0, 0, 0, 0);
MapKeyIO(&SHIFT_JOYSTICK, SHIFT_BUTTON, 0, 0);
} else if(FA_TOGGLE_ENABLED & (&device == &FA_TOGGLE_JOYSTICK) & (list == FA_TOGGLE_BUTTON)){
MapKeyIO(&FA_TOGGLE_JOYSTICK, FA_TOGGLE_BUTTON,
list[i+2],
SEQ(
CHAIN(
DOWN+list[i+1],
EXEC("isFAOn = 0; changeSpeedCurve();")
),
CHAIN(
UP+list[i+1],
EXEC("isFAOn = 1; changeSpeedCurve();")
)
)
);
} else {
MapKeyIO(&device, list, list[i+2], list[i+1]);
}
i = i + 3;
}
}


//-------------------------------------------------------------------------------------------------


int changeSpeedCurve()
{
if(isFAOn){
SetCustomCurve(&THROTTLE_JOYSTICK, THROTTLE_AXIS, currentCurve);
DXAxis(DX_THROTTLE_AXIS, -32767+65534*currentSpeed);
} else {
SetCustomCurve(&THROTTLE_JOYSTICK, THROTTLE_AXIS, curve100);
DXAxis(DX_THROTTLE_AXIS, -32767+65534*1.00);
}
}


//-------------------------------------------------------------------------------------------------


so now i don*t get this line 222 error but combined device not checkable under windows or through TARGET Control Joystick....


Should i use usb 2.0 onboard or two of the 4 usb 3.0 onboard? also steelseries usb mouse and simple dell usb keyboard connected. Already change the sticks to usb2 and usb3 ports on the Mobo.

If stop the script both t16000m are available and can be checked in control panel... really strange, hope i made no faults!
 
Last edited:
always start editor and gui as admin

Have you tried running the editor as a normal user?

If you create an empty script and run it, does the virtual controller work? (note that it will only pick one of the joysticks)

If all else fail, maybe try the procedure described here: (use the workaround)

http://support.microsoft.com/kb/2900614/en-us

But I think this specific problem was fixed in a Windows update, so I would be surprised if that was the cause...
 
Hi,

here the test script:
Running script: C:\Users\config\Documents\_ED_\test.tmc
*** Allocated ProcInstances found from the previous run: use FreeProcInstance() ***
Mapped plugin module "C:\Program Files (x86)\Thrustmaster\TARGET\Plugins\sys.dll"
Compile Succeeded.
Physical USB HID devices managed by script!
Currently plugged USB HID devices[2]:
1: "T.16000M" - "USB\VID_044F&PID_B10A&REV_0500"
2: "T.16000M" - "USB\VID_044F&PID_B10A&REV_0500"
USB HID device with hardware id "VID_044F&PID_0404" cannot be found
USB HID device with hardware id "VID_044F&PID_0402" cannot be found
USB HID device with hardware id "VID_044F&PID_b351" cannot be found
USB HID device with hardware id "VID_044F&PID_b352" cannot be found
USB HID device with hardware id "VID_044F&PID_0400" cannot be found
USB HID device "T.16000M"(USB\VID_044F&PID_B10A\6&23E79E2A&0&3) selected
Virtual HID devices managed by script!
Connecting virtual joystick...Done
Device name set to Thrustmaster Combined
Connecting virtual keyboard...Done
Connecting virtual mouse...Done

main returned 0

works, right joystick can be tested is available

The windows hint means the ids from both sticks under regedit? there is under ...Enum/USB/StickID/8 other sets inside, looks like doubles from the sticks inside few usb ports i*m already plugin, i think.
 
Last edited:
I'm sorry, I really don't know why it doesn't work. :(

I'll try to run more tests tomorrow, hopefully I'll find a solution...
 
Great!

So it's the fault of USB 3... That's strange, as I am pretty sure I used my joysticks on that kind of port, but maybe that depend on the motherboard...

Anyway, good flying!
 
hi, it is possible to set more functions on the sticks in the script? all buttons on both Sticks bottom are marked in combined mode as 31 or 32 . no way to change this? and what about these error in line 222 if try combined 0?

Questions over Questions i know, don´t thought i would be so komplex.... for me :)

so now i have play a little bit with the device mapper. why is the throttle axe "right stick" still full backward when stick in neutral position and FA on or off??

UPDATE, with this setup don´t know what happen, i have one phys. stick and one combined device, but the right stick (physical dev.) is the flight one and the left stick is for for throttle. can it be changed? :


include "target.tmh"

alias Stick1;
alias Stick2;


// Script Settings --------------------------------------------------------------------------------


// Choose whether to combine the two joysticks, or not.
// Combining them offer more flexibility, but there is currently a bug in the TARGET
// software, and the POV hat of the second stick won't be available.
// If set to '0', only 'Stick1' will be defined.
define JOYSTICKS_COMBINED 0 // '0' or '1' (default: '1')

define JOYSTICKS_INVERTED 0

// Which axis of which joystick to use as a throttle.
define THROTTLE_JOYSTICK Stick1 // 'Stick1' or 'Stick2'
define THROTTLE_AXIS JOYY // 'JOYY' or 'RUDDER'

// Define a specific button to use as an FA Toggle; this button will automatically set
// default speed to 0 when in FA Off. Note that in order to use this, the "Toggle Flight Assist"
// option in the game have to be set on hold (instead of toggle).
define FA_TOGGLE_ENABLED 1 // '0' or '1'
define FA_TOGGLE_JOYSTICK Stick1 // 'Stick1' or 'Stick2'
define FA_TOGGLE_BUTTON TS3 // 'TS1' .. 'TS4', 'H1L', 'H1U', 'H1R', 'H1D' or 'B5' .. 'B16'

// Define a specific button to use as a shift mode selector. When held down, all other buttons
// (of both joysticks) have a different binding.
define SHIFT_ENABLED 1 // 0 or 1
define SHIFT_JOYSTICK Stick1 // Stick1 or Stick2
define SHIFT_BUTTON TS1 // TS1 .. TS4, H1L, H1U, H1R, H1D or B5 .. B16


// Button Mapping ---------------------------------------------------------------------------------


int stick1ButtonMap[] = {
// The trigger
TS1, DX1, DX5,
// The 3 thumb buttons
TS2, DX2, DX6,
TS3, DX3, DX7,
TS4, DX4, DX8,
// The POV Hat
H1L, DXHATLEFT, DX9,
H1U, DXHATUP, DX10,
H1R, DXHATRIGHT, DX11,
H1D, DXHATDOWN, DX12,
// The 12 buttons on the base
B5, DX31, DX31,
B6, DX31, DX31,
B7, DX31, DX31,
B8, DX31, DX31,
B9, DX31, DX31,
B10, DX31, DX31,
B11, DX32, DX32,
B12, DX32, DX32,
B13, DX32, DX32,
B14, DX32, DX32,
B15, DX32, DX32,
B16, DX32, DX32
};

int stick2ButtonMap[] = {
// The trigger
TS1, DX13, DX17,
// The 3 thumb buttons
TS2, DX14, DX18,
TS3, DX15, DX19,
TS4, DX16, DX20,
// (Note: the hat on second joystick currently does not work)
H1L, DX21, DX25,
H1U, DX22, DX26,
H1R, DX23, DX27,
H1D, DX24, DX28,
// The 12 buttons on the base
B5, DX31, DX31,
B6, DX31, DX31,
B7, DX31, DX31,
B8, DX31, DX31,
B9, DX31, DX31,
B10, DX31, DX31,
B11, DX32, DX32,
B12, DX32, DX32,
B13, DX32, DX32,
B14, DX32, DX32,
B15, DX32, DX32,
B16, DX32, DX32
};


// Script Implementation --------------------------------------------------------------------------


int curve0, curve25, curve50, curve75, curve100;

int currentCurve;
float currentSpeed;

int isFAOn;

int main()
{
if(Init(&EventHandle)) return 1;

if(JOYSTICKS_COMBINED){
if(JOYSTICKS_INVERTED){
&Stick1 = GetIndexJoy(SelectUsbDevice("VID_044F&PID_B10A&REV_0500"));
&Stick2 = &T16000;
} else {
&Stick1 = &T16000;
&Stick2 = GetIndexJoy(SelectUsbDevice("VID_044F&PID_B10A&REV_0500"));
}
} else {
&Stick1 = &T16000;
}


// First Joystick

MapAxis(&Stick1, JOYX, DX_X_AXIS);
MapAxis(&Stick1, JOYY, DX_Y_AXIS);
MapAxis(&Stick1, RUDDER, DX_Z_AXIS);

mapButtons(&Stick1, &stick1ButtonMap);


// Second Joystick

if(JOYSTICKS_COMBINED){
MapAxis(&Stick2, JOYX, DX_XROT_AXIS);
MapAxis(&Stick2, JOYY, DX_YROT_AXIS);
MapAxis(&Stick2, RUDDER, DX_ZROT_AXIS);

mapButtons(&Stick2, &stick2ButtonMap);
}


// Curves

int min, max;
if(THROTTLE_AXIS == JOYY){
min = 0;
max = 100;
} else {
min = 100;
max = 0;
}

curve0 = LIST(0,min, 50, 0, 100,max);
curve25 = LIST(0,min, 50, 25, 100,max);
curve50 = LIST(0,min, 50, 50, 100,max);
curve75 = LIST(0,min, 50, 75, 100,max);
curve100 = LIST(0,min, 50,100, 100,max);

// Throttle Axis (on auxilliary joystick)

MapAxis(&THROTTLE_JOYSTICK, THROTTLE_AXIS, DX_THROTTLE_AXIS);

if(THROTTLE_AXIS == JOYY){
KeyAxis(&THROTTLE_JOYSTICK, THROTTLE_AXIS, 'ioumd',
AXMAP2(
LIST(0,1,99,100),
PULSE+DX32,
0,
PULSE+DX31
));
} else {
KeyAxis(&THROTTLE_JOYSTICK, THROTTLE_AXIS, 'ioumd',
AXMAP2(
LIST(0,1,99,100),
PULSE+DX31,
0,
PULSE+DX32
));
}

KeyAxis(&THROTTLE_JOYSTICK, THR, 0, AXMAP2(LIST(0,16,32 , 68,84,100),
EXEC("currentCurve = curve0; currentSpeed = 0.00; changeSpeedCurve();"),
EXEC("currentCurve = curve25; currentSpeed = 0.25; changeSpeedCurve();"),
EXEC("currentCurve = curve50; currentSpeed = 0.50; changeSpeedCurve();"),
EXEC("currentCurve = curve75; currentSpeed = 0.75; changeSpeedCurve();"),
EXEC("currentCurve = curve100; currentSpeed = 1.00; changeSpeedCurve();")
));


// Initialisation

currentCurve = curve100;
currentSpeed = 1.00;
isFAOn = 1;
changeSpeedCurve();
}


//-------------------------------------------------------------------------------------------------


int EventHandle(int type, alias o, int x)
{
DefaultMapping(&o, x);
}


//-------------------------------------------------------------------------------------------------


int mapButtons(alias device, alias list)
{
int length = elements(&list);
int i = 0;
while(i < length){
if(SHIFT_ENABLED & (&device == &SHIFT_JOYSTICK) & (list == SHIFT_BUTTON)){
SetShiftButton(&SHIFT_JOYSTICK, SHIFT_BUTTON, 0, 0, 0, 0);
MapKeyIO(&SHIFT_JOYSTICK, SHIFT_BUTTON, 0, 0);
} else if(FA_TOGGLE_ENABLED & (&device == &FA_TOGGLE_JOYSTICK) & (list == FA_TOGGLE_BUTTON)){
MapKeyIO(&FA_TOGGLE_JOYSTICK, FA_TOGGLE_BUTTON,
list[i+2],
SEQ(
CHAIN(
DOWN+list[i+1],
EXEC("isFAOn = 0; changeSpeedCurve();")
),
CHAIN(
UP+list[i+1],
EXEC("isFAOn = 1; changeSpeedCurve();")
)
)
);
} else {
MapKeyIO(&device, list, list[i+2], list[i+1]);
}
i = i + 3;
}
}


//-------------------------------------------------------------------------------------------------


int changeSpeedCurve()
{
if(isFAOn){
SetCustomCurve(&THROTTLE_JOYSTICK, THROTTLE_AXIS, currentCurve);
DXAxis(DX_THROTTLE_AXIS, -32767+65534*currentSpeed);
} else {
SetCustomCurve(&THROTTLE_JOYSTICK, THROTTLE_AXIS, curve100);
DXAxis(DX_THROTTLE_AXIS, -32767+65534*1.00);
}
}


//-------------------------------------------------------------------------------------------------

regards
raphael
 
Last edited:
UPDATE:

with these config, still try to change right left, i get an error in line 167:

//-------------------------------------------------------------------------------------------------

// TARGET Script for playing "Elite: Dangerous" with two Thrustmaster T.16000M Joysticks

//-------------------------------------------------------------------------------------------------


include "target.tmh"

alias Stick1;
alias Stick2;


// Script Settings --------------------------------------------------------------------------------


// Choose whether to combine the two joysticks, or not.
// Combining them offer more flexibility, but there is currently a bug in the TARGET
// software, and the POV hat of the second stick won't be available.
// If set to '0', only 'Stick1' will be defined.
define JOYSTICKS_COMBINED 0 // '0' or '1' (default: '1')

define JOYSTICKS_INVERTED 0

// Which axis of which joystick to use as a throttle.
define THROTTLE_JOYSTICK Stick1 // 'Stick1' or 'Stick2'
define THROTTLE_AXIS JOYX // 'JOYY' or 'RUDDER'

// Define a specific button to use as an FA Toggle; this button will automatically set
// default speed to 0 when in FA Off. Note that in order to use this, the "Toggle Flight Assist"
// option in the game have to be set on hold (instead of toggle).
define FA_TOGGLE_ENABLED 1 // '0' or '1'
define FA_TOGGLE_JOYSTICK Stick2 // 'Stick1' or 'Stick2'
define FA_TOGGLE_BUTTON TS3 // 'TS1' .. 'TS4', 'H1L', 'H1U', 'H1R', 'H1D' or 'B5' .. 'B16'

// Define a specific button to use as a shift mode selector. When held down, all other buttons
// (of both joysticks) have a different binding.
define SHIFT_ENABLED 1 // 0 or 1
define SHIFT_JOYSTICK Stick2 // Stick1 or Stick2
define SHIFT_BUTTON TS1 // TS1 .. TS4, H1L, H1U, H1R, H1D or B5 .. B16


// Button Mapping ---------------------------------------------------------------------------------


int stick1ButtonMap[] = {
// The trigger
TS1, DX1, DX5,
// The 3 thumb buttons
TS2, DX2, DX6,
TS3, DX3, DX7,
TS4, DX4, DX8,
// The POV Hat
H1L, DXHATLEFT, DX9,
H1U, DXHATUP, DX10,
H1R, DXHATRIGHT, DX11,
H1D, DXHATDOWN, DX12,
// The 12 buttons on the base
B5, DX31, DX31,
B6, DX31, DX31,
B7, DX31, DX31,
B8, DX31, DX31,
B9, DX31, DX31,
B10, DX31, DX31,
B11, DX32, DX32,
B12, DX32, DX32,
B13, DX32, DX32,
B14, DX32, DX32,
B15, DX32, DX32,
B16, DX32, DX32
};

int stick2ButtonMap[] = {
// The trigger
TS1, DX13, DX17,
// The 3 thumb buttons
TS2, DX14, DX18,
TS3, DX15, DX19,
TS4, DX16, DX20,
// (Note: the hat on second joystick currently does not work)
H1L, DX21, DX25,
H1U, DX22, DX26,
H1R, DX23, DX27,
H1D, DX24, DX28,
// The 12 buttons on the base
B5, DX31, DX31,
B6, DX31, DX31,
B7, DX31, DX31,
B8, DX31, DX31,
B9, DX31, DX31,
B10, DX31, DX31,
B11, DX32, DX32,
B12, DX32, DX32,
B13, DX32, DX32,
B14, DX32, DX32,
B15, DX32, DX32,
B16, DX32, DX32
};


// Script Implementation --------------------------------------------------------------------------


int curve0, curve25, curve50, curve75, curve100;

int currentCurve;
float currentSpeed;

int isFAOn;

int main()
{
if(Init(&EventHandle)) return 1;

if(JOYSTICKS_COMBINED){
if(JOYSTICKS_INVERTED){
&Stick2 = GetIndexJoy(SelectUsbDevice("VID_044F&PID_B10A&REV_0500"));
&Stick1 = &T16000;
} else {
&Stick2 = &T16000;
&Stick1 = GetIndexJoy(SelectUsbDevice("VID_044F&PID_B10A&REV_0500"));
}
} else {
&Stick2 = &T16000;
}


// First Joystick

MapAxis(&Stick2, JOYY, DX_Y_AXIS);
MapAxis(&Stick2, JOYX, DX_X_AXIS);
MapAxis(&Stick2, RUDDER, DX_Z_AXIS);

mapButtons(&Stick2, &stick2ButtonMap);


// Second Joystick

if(JOYSTICKS_COMBINED){
MapAxis(&Stick1, JOYX, DX_XROT_AXIS);
MapAxis(&Stick1, JOYY, DX_YROT_AXIS);
MapAxis(&Stick1, RUDDER, DX_ZROT_AXIS);

mapButtons(&Stick1, &stick1ButtonMap);
}


// Curves

int min, max;
if(THROTTLE_AXIS == JOYX){
min = 0;
max = 100;
} else {
min = 100;
max = 0;
}

curve0 = LIST(0,min, 50, 0, 100,max);
curve25 = LIST(0,min, 50, 25, 100,max);
curve50 = LIST(0,min, 50, 50, 100,max);
curve75 = LIST(0,min, 50, 75, 100,max);
curve100 = LIST(0,min, 50,100, 100,max);

// Throttle Axis (on auxilliary joystick)

MapAxis(&THROTTLE_JOYSTICK, THROTTLE_AXIS, DX_THROTTLE_AXIS);

if(THROTTLE_AXIS == JOYX){
KeyAxis(&THROTTLE_JOYSTICK, THROTTLE_AXIS, 'ioumd',
AXMAP2(
LIST(0,1,99,100),
PULSE+DX32,
0,
PULSE+DX31
));
} else {
KeyAxis(&THROTTLE_JOYSTICK, THROTTLE_AXIS, 'ioumd',
AXMAP2(
LIST(0,1,99,100),
PULSE+DX31,
0,
PULSE+DX32
));
}

KeyAxis(&THROTTLE_JOYSTICK, THR, 0, AXMAP2(LIST(0,16,32 , 68,84,100),
EXEC("currentCurve = curve0; currentSpeed = 0.00; changeSpeedCurve();"),
EXEC("currentCurve = curve25; currentSpeed = 0.25; changeSpeedCurve();"),
EXEC("currentCurve = curve50; currentSpeed = 0.50; changeSpeedCurve();"),
EXEC("currentCurve = curve75; currentSpeed = 0.75; changeSpeedCurve();"),
EXEC("currentCurve = curve100; currentSpeed = 1.00; changeSpeedCurve();")
));


// Initialisation

currentCurve = curve100;
currentSpeed = 1.00;
isFAOn = 1;
changeSpeedCurve();
}


//-------------------------------------------------------------------------------------------------


int EventHandle(int type, alias o, int x)
{
DefaultMapping(&o, x);
}


//-------------------------------------------------------------------------------------------------


int mapButtons(alias device, alias list)
{
int length = elements(&list);
int i = 0;
while(i < length){
if(SHIFT_ENABLED & (&device == &SHIFT_JOYSTICK) & (list == SHIFT_BUTTON)){
SetShiftButton(&SHIFT_JOYSTICK, SHIFT_BUTTON, 0, 0, 0, 0);
MapKeyIO(&SHIFT_JOYSTICK, SHIFT_BUTTON, 0, 0);
} else if(FA_TOGGLE_ENABLED & (&device == &FA_TOGGLE_JOYSTICK) & (list == FA_TOGGLE_BUTTON)){
MapKeyIO(&FA_TOGGLE_JOYSTICK, FA_TOGGLE_BUTTON,
list[i+2],
SEQ(
CHAIN(
DOWN+list[i+1],
EXEC("isFAOn = 0; changeSpeedCurve();")
),
CHAIN(
UP+list[i+1],
EXEC("isFAOn = 1; changeSpeedCurve();")
)
)
);
} else {
MapKeyIO(&device, list, list[i+2], list[i+1]);
}
i = i + 3;
}
}


//-------------------------------------------------------------------------------------------------


int changeSpeedCurve()
{
if(isFAOn){
SetCustomCurve(&THROTTLE_JOYSTICK, THROTTLE_AXIS, currentCurve);
DXAxis(DX_THROTTLE_AXIS, -32767+65534*currentSpeed);
} else {
SetCustomCurve(&THROTTLE_JOYSTICK, THROTTLE_AXIS, curve100);
DXAxis(DX_THROTTLE_AXIS, -32767+65534*1.00);
}
}


//-------------------------------------------------------------------------------------------------

Regards
 
with these config, still try to change right left, i get an error in line 167

In order to swap right and left joysticks, you just have to set JOYSTICKS_INVERTED to 1 at line 23. I forgot to document that in the script. For this to work, you also should revert THROTTLE_JOYSTICK to its original value (Stick2). The easier is probably to start from the original script and change only line 23.

I have no idea why, but it seems you have an error each time JOYSTICKS_COMBINED is set to 0, so you should probably leave it to 1.
 
hi, thanks. i will check this. everything else works fine or do before i start change axes settings by my self.

regards

UPDATE

Yes but then only be able do have one combined device. It is possible to have one virt. joystick and one phys.? Also both coolie hats and it this config left flying and right throttle up/donw? What about the 12 buttons on each stick can they also be configured for needed things??

UPDATE 2

ok now i have right combined device (standalone) and left stick as t16000m (standalone) will test config. later ingame


update 3:

with combined 1 and inverted 1 the throttle is on left stick, thought you mean then right?? and how to enable both coolie hats and make more settings to the bottom buttons from the both Joystick?


UPDATE4 :

Hi Drakemaniso,

with config follows i have now one combined stick with one of the phys. t16km and one phys. stick. Everything seems now in correct position. Flying with left one and speed up/down with the right one. It is also possible to setup more of the buttons on the bottom of both sticks and these FA on/off buttons config how does it work...?


UPDATE 5:

I see and wonder last dyas there are always little graphics error when the target script is running, without the script everything is fine. Do you know these issues...?


Hmm not working probably, the second POV always working in separated mode? in combined mode working in the controller menu from TARGET but not available ingame ED....


how to make both sticks as separated devices ingame available? Is it possible? I have now one combined device and one t16km under windows and target work&looks fine, only one of the pov not at buttons availbale in the combined setup. also ingame not available...
 
Last edited:
Hi,

these config as follow i´m using now:

//-------------------------------------------------------------------------------------------------

// TARGET Script for playing "Elite: Dangerous" with two Thrustmaster T.16000M Joysticks

//-------------------------------------------------------------------------------------------------


include "target.tmh"

alias Stick1;
alias Stick2;


// Script Settings --------------------------------------------------------------------------------


// Choose whether to combine the two joysticks, or not.
// Combining them offer more flexibility, but there is currently a bug in the TARGET
// software, and the POV hat of the second stick won't be available.
// If set to '0', only 'Stick1' will be defined.
define JOYSTICKS_COMBINED 0 // '0' or '1' (default: '1')

define JOYSTICKS_INVERTED 1

// Which axis of which joystick to use as a throttle.
define THROTTLE_JOYSTICK Stick1 // 'Stick1' or 'Stick2'
define THROTTLE_AXIS JOYY // 'JOYY' or 'RUDDER'

// Define a specific button to use as an FA Toggle; this button will automatically set
// default speed to 0 when in FA Off. Note that in order to use this, the "Toggle Flight Assist"
// option in the game have to be set on hold (instead of toggle).
define FA_TOGGLE_ENABLED 1 // '0' or '1'
define FA_TOGGLE_JOYSTICK Stick1 // 'Stick1' or 'Stick2'
define FA_TOGGLE_BUTTON TS3 // 'TS1' .. 'TS4', 'H1L', 'H1U', 'H1R', 'H1D' or 'B5' .. 'B16'

// Define a specific button to use as a shift mode selector. When held down, all other buttons
// (of both joysticks) have a different binding.
define SHIFT_ENABLED 1 // 0 or 1
define SHIFT_JOYSTICK Stick1 // Stick1 or Stick2
define SHIFT_BUTTON TS1 // TS1 .. TS4, H1L, H1U, H1R, H1D or B5 .. B16


// Button Mapping ---------------------------------------------------------------------------------


int stick1ButtonMap[] = {
// The trigger
TS1, DX1, DX5,
// The 3 thumb buttons
TS2, DX2, DX6,
TS3, DX3, DX7,
TS4, DX4, DX8,
// The POV Hat
H1L, DXHATLEFT, DX9,
H1U, DXHATUP, DX10,
H1R, DXHATRIGHT, DX11,
H1D, DXHATDOWN, DX12,
// The 12 buttons on the base
B5, DX31, DX31,
B6, DX31, DX31,
B7, DX31, DX31,
B8, DX31, DX31,
B9, DX31, DX31,
B10, DX31, DX31,
B11, DX32, DX32,
B12, DX32, DX32,
B13, DX32, DX32,
B14, DX32, DX32,
B15, DX32, DX32,
B16, DX32, DX32
};

int stick2ButtonMap[] = {
// The trigger
TS1, DX13, DX17,
// The 3 thumb buttons
TS2, DX14, DX18,
TS3, DX15, DX19,
TS4, DX16, DX20,
// (Note: the hat on second joystick currently does not work)
H1L, DX21, DX25,
H1U, DX22, DX26,
H1R, DX23, DX27,
H1D, DX24, DX28,
// The 12 buttons on the base
B5, DX31, DX31,
B6, DX31, DX31,
B7, DX31, DX31,
B8, DX31, DX31,
B9, DX31, DX31,
B10, DX31, DX31,
B11, DX32, DX32,
B12, DX32, DX32,
B13, DX32, DX32,
B14, DX32, DX32,
B15, DX32, DX32,
B16, DX32, DX32
};


// Script Implementation --------------------------------------------------------------------------


int curve0, curve25, curve50, curve75, curve100;

int currentCurve;
float currentSpeed;

int isFAOn;

int main()
{
if(Init(&EventHandle)) return 1;

if(JOYSTICKS_COMBINED){
if(JOYSTICKS_INVERTED){
&Stick1 = GetIndexJoy(SelectUsbDevice("VID_044F&PID_B10A&REV_0500"));
&Stick2 = &T16000;
} else {
&Stick1 = &T16000;
&Stick2 = GetIndexJoy(SelectUsbDevice("VID_044F&PID_B10A&REV_0500"));
}
} else {
&Stick1 = &T16000;
}


// First Joystick

MapAxis(&Stick1, JOYX, DX_X_AXIS);
MapAxis(&Stick1, JOYY, DX_Y_AXIS);
MapAxis(&Stick1, RUDDER, DX_Z_AXIS);

mapButtons(&Stick1, &stick1ButtonMap);


// Second Joystick

if(JOYSTICKS_COMBINED){
MapAxis(&Stick2, JOYX, DX_XROT_AXIS);
MapAxis(&Stick2, JOYY, DX_YROT_AXIS);
MapAxis(&Stick2, RUDDER, DX_ZROT_AXIS);

mapButtons(&Stick2, &stick2ButtonMap);
}


// Curves

int min, max;
if(THROTTLE_AXIS == JOYY){
min = 0;
max = 100;
} else {
min = 100;
max = 0;
}

curve0 = LIST(0,min, 50, 0, 100,max);
curve25 = LIST(0,min, 50, 25, 100,max);
curve50 = LIST(0,min, 50, 50, 100,max);
curve75 = LIST(0,min, 50, 75, 100,max);
curve100 = LIST(0,min, 50,100, 100,max);

// Throttle Axis (on auxilliary joystick)

MapAxis(&THROTTLE_JOYSTICK, THROTTLE_AXIS, DX_THROTTLE_AXIS);

if(THROTTLE_AXIS == JOYY){
KeyAxis(&THROTTLE_JOYSTICK, THROTTLE_AXIS, 'ioumd',
AXMAP2(
LIST(0,1,99,100),
PULSE+DX32,
0,
PULSE+DX31
));
} else {
KeyAxis(&THROTTLE_JOYSTICK, THROTTLE_AXIS, 'ioumd',
AXMAP2(
LIST(0,1,99,100),
PULSE+DX31,
0,
PULSE+DX32
));
}

KeyAxis(&THROTTLE_JOYSTICK, THR, 0, AXMAP2(LIST(0,16,32 , 68,84,100),
EXEC("currentCurve = curve0; currentSpeed = 0.00; changeSpeedCurve();"),
EXEC("currentCurve = curve25; currentSpeed = 0.25; changeSpeedCurve();"),
EXEC("currentCurve = curve50; currentSpeed = 0.50; changeSpeedCurve();"),
EXEC("currentCurve = curve75; currentSpeed = 0.75; changeSpeedCurve();"),
EXEC("currentCurve = curve100; currentSpeed = 1.00; changeSpeedCurve();")
));


// Initialisation

currentCurve = curve100;
currentSpeed = 1.00;
isFAOn = 1;
changeSpeedCurve();
}


//-------------------------------------------------------------------------------------------------


int EventHandle(int type, alias o, int x)
{
DefaultMapping(&o, x);
}


//-------------------------------------------------------------------------------------------------


int mapButtons(alias device, alias list)
{
int length = elements(&list);
int i = 0;
while(i < length){
if(SHIFT_ENABLED & (&device == &SHIFT_JOYSTICK) & (list == SHIFT_BUTTON)){
SetShiftButton(&SHIFT_JOYSTICK, SHIFT_BUTTON, 0, 0, 0, 0);
MapKeyIO(&SHIFT_JOYSTICK, SHIFT_BUTTON, 0, 0);
} else if(FA_TOGGLE_ENABLED & (&device == &FA_TOGGLE_JOYSTICK) & (list == FA_TOGGLE_BUTTON)){
MapKeyIO(&FA_TOGGLE_JOYSTICK, FA_TOGGLE_BUTTON,
list[i+2],
SEQ(
CHAIN(
DOWN+list[i+1],
EXEC("isFAOn = 0; changeSpeedCurve();")
),
CHAIN(
UP+list[i+1],
EXEC("isFAOn = 1; changeSpeedCurve();")
)
)
);
} else {
MapKeyIO(&device, list, list[i+2], list[i+1]);
}
i = i + 3;
}
}


//-------------------------------------------------------------------------------------------------


int changeSpeedCurve()
{
if(isFAOn){
SetCustomCurve(&THROTTLE_JOYSTICK, THROTTLE_AXIS, currentCurve);
DXAxis(DX_THROTTLE_AXIS, -32767+65534*currentSpeed);
} else {
SetCustomCurve(&THROTTLE_JOYSTICK, THROTTLE_AXIS, curve100);
DXAxis(DX_THROTTLE_AXIS, -32767+65534*1.00);
}
}


//-------------------------------------------------------------------------------------------------
// Copyright (c) 2014 -

With this config. i have one combined stick with one phys. stick and one phys. stick. Both POVs running as POVs. I will test this a little bit more and hopin it will running... Thanks and good hunting, cheers
 
Hi,

so still playing the last config. i describe (one combined, one phys.). For now works fine. My question is it possible to set the 12 buttons on the bottom from both sticks separately or give each single button function?

Which language i use the script, is this lua??

cheers
 
Last edited:
The language is something specific to Thrustmaster (or even just the Target software, I think).

It's possible to bind the 12 base buttons to something else, especially if you have "JOYSTICKS_COMBINED" set to 0.

Starting at line 46:

Code:
int stick1ButtonMap[] = {
	// The trigger
	TS1, DX1, DX5,
	// The 3 thumb buttons
	TS2, DX2, DX6,
	TS3, DX3, DX7,
	TS4, DX4, DX8,
	// The POV Hat
	H1L, DXHATLEFT, DX9,
	H1U, DXHATUP, DX10,
	H1R, DXHATRIGHT, DX11,
	H1D, DXHATDOWN, DX12,
	// The 12 buttons on the base
	B5, DX31, DX31,
	B6, DX31, DX31,
	B7, DX31, DX31,
	B8, DX31, DX31,
	B9, DX31, DX31,
	B10, DX31, DX31,
	B11, DX32, DX32,
	B12, DX32, DX32,
	B13, DX32, DX32,
	B14, DX32, DX32,
	B15, DX32, DX32,
	B16, DX32, DX32
};

The first column is the name of the button on the T16000, don't change it. The second column is the virtual button associated with it, and the third columns is for the shifted state.

You can replace all the "DX31" and "DX32" by other numbers (i.e. "DX13", "DX14"...). You're limited to 32 buttons in total, though. If you don't use the "shift" mode you have more room.
 
Thank you very much for this script, this has made my life so much easier!

Still, I think there is a bug related to FA off mode. As soon as I switch FA to off, throttle is put to foll backwards speed. I've changed line 257 to read:

DXAxis(DX_THROTTLE_AXIS, 0);

and the problem went away. Also, right after loading the script, the throttle would show no value in the analysis too. So I changed lines 198-199 to read:

currentCurve = curve50;
currentSpeed = 0.50;
DXAxis(DX_THROTTLE_AXIS, 0);
 
Still, I think there is a bug related to FA off mode. As soon as I switch FA to off, throttle is put to foll backwards speed. I've changed line 257 to read:

DXAxis(DX_THROTTLE_AXIS, 0);

and the problem went away. Also, right after loading the script, the throttle would show no value in the analysis too. So I changed lines 198-199 to read:

currentCurve = curve50;
currentSpeed = 0.50;
DXAxis(DX_THROTTLE_AXIS, 0);

I assume you're using the "Full Range" settings for the throttle in ED?

I designed the script to work for the "Forward Only" settings, and forgot to add an option for the other mode.. As soon as I find the time, I'll add your these changes to the script and release a new version.

Thanks for the contribution!
 
I assume you're using the "Full Range" settings for the throttle in ED?

Precisely! I do want to fly backwards in some situations.

Also, here's another suggestion: map the buttons on the base of the joystick to virtual keyboard events, so they can be used for the myriad of small functions.
 
@ drakmaniso, you mean shifted mode, when button "xy" pressed, is there then the shifted mode? shifted mode is for? and when shifted mode not set how many buttons are configurable? The other things andreas wrote i will try them out :)

cheers
snake
 
Thank you very much for this script, this has made my life so much easier!

Still, I think there is a bug related to FA off mode. As soon as I switch FA to off, throttle is put to foll backwards speed. I've changed line 257 to read:

DXAxis(DX_THROTTLE_AXIS, 0);

and the problem went away. Also, right after loading the script, the throttle would show no value in the analysis too. So I changed lines 198-199 to read:

currentCurve = curve50;
currentSpeed = 0.50;
DXAxis(DX_THROTTLE_AXIS, 0);

What should happen here definetly? In the event tester, after pressing FAon always full speed backwards...??

cheers snake
 
Back
Top Bottom