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!