Jump to content

Thrustmaster TARGET Script Overview? / Exluding Axis


Maverick-90
 Share

Recommended Posts

Hi,

 

i'm setting up my Warthog and T16000 for the Viggen. Warthog for flying, T16000 for the Radar Stick.

However i have more Axis than Target lets me create (Dx Limitation i guess).

 

I've read that it is possible to exclude an axis from the Thrustmaster Combined setup, leaving it to Windows as a seperate Device. However nobody say how :cry:

Is this even possible? And if so, how?

 

 

Also: Is there an overview of all scripting commands available in TARGET?

 

Thanks

Mav

Link to comment
Share on other sites

There is a Script Editor Basics document in the Target folder (in the Resources subfolder, more specifically). Look for the MapAxis command. That should be the one you need I guess as it maps TM controller axes to DX ones.

i386DX40@42 MHz w/i387 CP, 4 MB RAM (8*512 kB), Trident 8900C 1 MB w/16-bit RAMDAC ISA, Quantum 340 MB UDMA33, SB 16, DOS 6.22 w/QEMM + Win3.11CE, Quickshot 1btn 2axis, Numpad as hat. 2 FPH on a good day, 1 FPH avg.

 

DISCLAIMER: My posts are still absolutely useless. Just finding excuses not to learn the F-14 (HB's Swansong?).

 

Annoyed by my posts? Please consider donating. Once the target sum is reached, I'll be off to somewhere nice I promise not to post from. I'd buy that for a dollar!

Link to comment
Share on other sites

I've already read that one, however i can't find any command to exclude the axis from the script....if i assign no Dx Axis, the Axis simply is not existant..

 

Yeah, I guess that's default behaviour, the automatic assignment. There's no exclusion that I know of, so you'll just have to go and manually assign all of those you will use from both controllers with the MapAxis command.

 

It works for me with the TM Cougar.


Edited by Dudikoff

i386DX40@42 MHz w/i387 CP, 4 MB RAM (8*512 kB), Trident 8900C 1 MB w/16-bit RAMDAC ISA, Quantum 340 MB UDMA33, SB 16, DOS 6.22 w/QEMM + Win3.11CE, Quickshot 1btn 2axis, Numpad as hat. 2 FPH on a good day, 1 FPH avg.

 

DISCLAIMER: My posts are still absolutely useless. Just finding excuses not to learn the F-14 (HB's Swansong?).

 

Annoyed by my posts? Please consider donating. Once the target sum is reached, I'll be off to somewhere nice I promise not to post from. I'd buy that for a dollar!

Link to comment
Share on other sites

It is not possible. Each DX device has 8 axes, POV, and 32 buttons. The axes being X Y Z XR YR ZR U V. The labels may be different, U "throttle" V "slider" but it's the same thing.

 

The virtual device has these 8 axes, controlled somehow or not they belong to the logical device. There is no way to "break out" a single axis into a separate logical controller.

 

There is however a way to exclude an entire physical device from being included in the TARGET script at all. Of course this excluded device is not subject to TARGET programming at all and simply performs as if TARGET was not running. Depending on the situation I find it often useful to exclude the entire joystick device from the TARGET virtual one.

Link to comment
Share on other sites

It is not possible. Each DX device has 8 axes, POV, and 32 buttons. The axes being X Y Z XR YR ZR U V. The labels may be different, U "throttle" V "slider" but it's the same thing.

 

The virtual device has these 8 axes, controlled somehow or not they belong to the logical device. There is no way to "break out" a single axis into a separate logical controller.

 

Edit: sorry, didn't get that you're referring to the OP's original post to have the excluded axes mapped to some 'other' logical device.

 

To the OP, how many axes do you need exactly? You could leave the T16000 outside of Target and map it in DCSW directly or you could convert some of its needed axes to key commands.


Edited by Dudikoff

i386DX40@42 MHz w/i387 CP, 4 MB RAM (8*512 kB), Trident 8900C 1 MB w/16-bit RAMDAC ISA, Quantum 340 MB UDMA33, SB 16, DOS 6.22 w/QEMM + Win3.11CE, Quickshot 1btn 2axis, Numpad as hat. 2 FPH on a good day, 1 FPH avg.

 

DISCLAIMER: My posts are still absolutely useless. Just finding excuses not to learn the F-14 (HB's Swansong?).

 

Annoyed by my posts? Please consider donating. Once the target sum is reached, I'll be off to somewhere nice I promise not to post from. I'd buy that for a dollar!

Link to comment
Share on other sites

I don't need that many, i just wanted to know if it is possible :joystick:

as of now i've disabled the mouse and one throttle lever on the Throttle, and the Rudder on the T16000 which gives me a total of 7. Enough for the Viggen.

 

I don't want to exclude the T16000 because i use the big pinkie switch on the WH Stick as a mode Switch to toggle the Modes for the 12 Buttons on the Base of the T16000 (Nav Modes, Weapon select, Data Panel mode)

Link to comment
Share on other sites

Target can do exactly what you want.

 

Getting the terms straight, there are the original devices - the Thrustmaster Joystick and the Thrustmaster Throttle in the Windows Game Controller Config Panel --> C:\Windows\System32\joy.cpl

 

When you run a Target Script, the "Thrustmaster Combined" is magically created. By default, the original devices are removed. Stopping the script destroys the "Thrustmaster Combined" device, and re-instates the original devices.

 

However, there are some switches in Target to change that behavior.

 

With Target you can Exclude a device (or more than one device) entirely:

int main()
{
    Configure(&Joystick,MODE_EXCLUDED);
    [color=SeaGreen][color=green]// ---> Joystick remains as game controller[/color][/color]
    [color=SeaGreen][color=green]// ---> Cannot configure Joystick from Target
[/color][/color] [color=SeaGreen][color=green][color=green]     // ---> Throttle removed as game controller
    // ---> "Thrustmaster Combined" created[/color] [/color]
   [/color][color=SeaGreen][color=Black] if(Init(&EventHandle)) return 1; // declare the event handler, return on error

    // Normal Map statements go here.
[/color][/color] }

You can also use the "filtered" mode to selectively drag the original Joystick/Throttle/T1600 buttons/axis into the Thrustmaster Combined Device.

 

With even more magic in the event handler, you can exclude buttons from the original device(!), so they only appear in the Thrustmaster Combined device:

int main()
{
   Configure(&Joystick[color=#ffffff],[/color]MODE_FILTERED);
[color=green]    // ---> Joystick remains as game controller
   // ---> Throttle removed as game controller
   // ---> "Thrustmaster Combined" created[/color]
[color=SeaGreen][color=Black]    if(Init(&EventHandle)) return 1; // declare the event handler, return on error
[/color][/color] 
   // Note: The X Axis is [color=Red]commented out[/color] ---> No Mapping
[color=#32cd32]    [color=Black]// MapAxis(&Joystick, JOYX, DX_X_AXIS);     
[color=Green]    // Thrustmaster Combined    =    No JoyX[/color][/color][/color][color=Green] axis
   // Joystick                         =    JoyX active[/color]

   MapAxis(&Joystick, JOYY, DX_Y_AXIS);         
[color=Green]    // Thrustmaster Combined   =    JoyY active
   // Joystick                        =    JoyY active[/color]

   MapKey(&Joystick, TG1, 0[color=#ffffff]0[/color]);
[color=green]    // Thrustmaster Combined    =    Nil ---> no action
   // Joystick                         =    DX1  (default mapping) [/color]

}

//event handler
int EventHandle(int type, alias o, int x)
{
   if(&o == &Joystick & !(o[s1]|o[s4]|o[s2])) GameOutput(&o, x, o[x]); 
[color=Green]    // Thrustmaster Combined   =    S1+S3+S4 work by default
   // Joystick                        =    S1+S3+S4 = Nil ---> no action[/color]

   DefaultMapping(&o, x);
   
   //add event handling code here
}

  • Like 1
Link to comment
Share on other sites

Target can do exactly what you want.

 

What he asked is if its possible to have two Thrustmaster Combined Devices, not one.

i386DX40@42 MHz w/i387 CP, 4 MB RAM (8*512 kB), Trident 8900C 1 MB w/16-bit RAMDAC ISA, Quantum 340 MB UDMA33, SB 16, DOS 6.22 w/QEMM + Win3.11CE, Quickshot 1btn 2axis, Numpad as hat. 2 FPH on a good day, 1 FPH avg.

 

DISCLAIMER: My posts are still absolutely useless. Just finding excuses not to learn the F-14 (HB's Swansong?).

 

Annoyed by my posts? Please consider donating. Once the target sum is reached, I'll be off to somewhere nice I promise not to post from. I'd buy that for a dollar!

Link to comment
Share on other sites

What he asked is if its possible to have two Thrustmaster Combined Devices, not one.

No i didn't.

I wanted to know if it is possible to keep axis out of the combined device, so they will be available via the unprogrammed Joystick

-> 1 Joystick Combined via Target using the buttons an Axis I want to programm

-> x Joysticks without Target using only axis i can assign directly in DCS

Link to comment
Share on other sites

Ah, so you want TARGET device and the "natural" device working simultaneously. It is sort of possible in a very buggy way when the filter driver fails to correctly replace the standard driver. You would get natural device and TARGET device at the same time. But it is very buggy, the TARGET output was not doing anything despite the device being present. It's not practical.

 

What would be great is a virtual device like CH Products which has up to 4 virtual devices instead of just 1.

Link to comment
Share on other sites

Perhaps read my solution on the first page. Target supports just this use case.

 

Interesting.I had no idea this filtering is an option since it's not mentioned in the script editor document (only exclusion is). Is there some more advanced document available?

i386DX40@42 MHz w/i387 CP, 4 MB RAM (8*512 kB), Trident 8900C 1 MB w/16-bit RAMDAC ISA, Quantum 340 MB UDMA33, SB 16, DOS 6.22 w/QEMM + Win3.11CE, Quickshot 1btn 2axis, Numpad as hat. 2 FPH on a good day, 1 FPH avg.

 

DISCLAIMER: My posts are still absolutely useless. Just finding excuses not to learn the F-14 (HB's Swansong?).

 

Annoyed by my posts? Please consider donating. Once the target sum is reached, I'll be off to somewhere nice I promise not to post from. I'd buy that for a dollar!

Link to comment
Share on other sites

Ah, so you want TARGET device and the "natural" device working simultaneously. It is sort of possible in a very buggy way when the filter driver fails to correctly replace the standard driver. You would get natural device and TARGET device at the same time. But it is very buggy, the TARGET output was not doing anything despite the device being present. It's not practical.

 

There is a way to do it, it's not buggy at all.

https://forums.eagle.ru/showpost.php?p=3212573&postcount=8

 

Hi all,

 

Sorry I'm a bit late to the party.

Yes, you can totally do that, using MODE_FILTERED.

 

Here is a sample script that I'm using it for the P-51D (I just tweaked it so it doesn't depend on other includes), in which I set up:

- a few special commands that call keyboard shortcuts (for snap views, teamspeak, trackIR)

- a customized axis (MAP_RELATIVE) to use the ministick for target range

- a virtual axis that is activated through the Coolie switch left and right (for target size)

- a filtered slider (through an hysteresis) because my throttle slider is a bit jittery.

 

I just launch the script, the "Combined" appears and the other two stay and work as usual.

In game I map the zoom on the SLIDER1 axis of the "Combined", and the RY for target range, RX for size.

Everything else I map it directly on the "Throttle" and "Joystick" devices, in DCS.

Except I don't map anything on the Joystick's S1, H2L, H2R and Throttle's CSL, CSR, MSP and MSU because these will trigger some keypresses that I set up in the script, but this is just an example, if you use the A-10C just delete these lines from the script and map the keys to your liking (as in your originial question).

 

 

 

include "target.tmh"

// Standalone DX mappings

int ThrottleMap1[]={

SC,DX1,

MSU,DX3, // Mike Switch
MSD,DX5,
MSL,DX6,
MSR,DX4,
MSP,DX2,

SPDF,DX7, // Speed Brake
SPDM,0,
SPDB,DX8,

BSF,DX9, // Boat Switch
BSM,0,
BSB,DX10,

CHF,DX11, // China Hat
CHB,DX12,

PSF,DX13, // Pinky
PSM,0,
PSB,DX14,

CSU,DXHATUP, // Coolie Switch
CSD,DXHATDOWN,
CSL,DXHATLEFT,
CSR,DXHATRIGHT,

LTB,DX15,

EFLNORM,DX16,
EFLOVER,0,

EFRNORM,DX17,
EFROVER,0,

EOLIGN,DX31,
EOLNORM,0,
EOLMOTOR,DX18,

EORIGN,DX32,
EORNORM,0,
EORMOTOR,DX19,

APUON,DX20,
APUOFF,0,

LDGH,DX21,

FLAPU,DX22,
FLAPM,0,
FLAPD,DX23,

EACON,DX24,
EACOFF,0,

RDRNRM,DX25,
RDRDIS,0,

APPAT,DX27, // PATH
APAH,0,     // ALT/HDG
APALT,DX28, // ALT
APENG,DX26,

IDLELON,DX30,
IDLERON,DX29
};

int JoystickMap1[]={ // Actually the same as JoystickMap

TG1,DX1,

S1,DX5, // Side
S2,DX2, // Red
S3,DX3, // Pinky
S4,DX4, // Paddle

TG2,DX6,

H1U,DXHATUP, // Trims (upper right)
H1D,DXHATDOWN,
H1L,DXHATLEFT,
H1R,DXHATRIGHT,

H2U,DX7, // TMS (lower right)
H2D,DX9,
H2L,DX10,
H2R,DX8,

H3U,DX11, // DMS (lower left)
H3D,DX13,
H3L,DX14,
H3R,DX12,

H4U,DX15, // CMS (thumb)
H4D,DX17,
H4L,DX18,
H4R,DX16,
H4P,DX19
};

// empty maps

int ThrottleMap0[]={

SC,0,

MSU,0,
MSD,0,
MSL,0,
MSR,0,
MSP,0,

SPDF,0,
SPDM,0,
SPDB,0,

BSF,0,
BSM,0,
BSB,0,

CHF,0,
CHB,0,

PSF,0,
PSM,0,
PSB,0,

CSU,0,
CSD,0,
CSL,0,
CSR,0,

LTB,0,

EFLNORM,0,
EFLOVER,0,

EFRNORM,0,
EFROVER,0,

EOLIGN,0,
EOLNORM,0,
EOLMOTOR,0,

EORIGN,0,
EORNORM,0,
EORMOTOR,0,

APUON,0,
APUOFF,0,

LDGH,0,

FLAPU,0,
FLAPM,0,
FLAPD,0,

EACON,0,
EACOFF,0,

RDRNRM,0,
RDRDIS,0,

APPAT,0,
APAH,0,
APALT,0,
APENG,0,

IDLELON,0,
IDLERON,0
};

int JoystickMap0[]={

TG1,0,

S1,0,
S2,0,
S3,0,
S4,0,

TG2,0,

H1U,0,
H1D,0,
H1L,0,
H1R,0,

H2U,0,
H2D,0,
H2L,0,
H2R,0,

H3U,0,
H3D,0,
H3L,0,
H3R,0,

H4U,0,
H4D,0,
H4L,0,
H4R,0,
H4P,0
};

// Special keys
define KPslash					USB[84]
define KPstar					USB[85]
define KPminus					USB[86]
define KPplus					USB[87]

define TeamSpeakPushToTalk		CAPS

define TrackIrCenter			L_ALT+SCRLCK
define TrackIrDisable			L_ALT+BRK

////////////////////////////////////////////////////////////

define TPULSE 70
define TDELAY 50
define T (TPULSE+TDELAY)

define SHORTTEMPO 300
define LONGTEMPO 1500

////////////////////////////////////////////////////////////
int hysteresis(alias dir, alias cur, int val, int delta){
if (dir<0){
	if      (val<cur      ){ cur=val;         }
	else if (val>cur+delta){ cur=val; dir= 1; }
}
else if (dir>0){
	if      (val>cur      ){ cur=val;         }
	else if (val<cur-delta){ cur=val; dir=-1; }
}
else{
	if (val>cur){ cur=val; dir= 1; }
	else        { cur=val; dir=-1; }
}
return cur;
}

////////////////////////////////////////////////////////////
int s_THR_FC_dir=0;
int s_THR_FC_cur=0;
int hysteresis_THR_FC(int axis)
{
return TrimDXAxis(axis,
	SET(
		hysteresis(
			&s_THR_FC_dir,
			&s_THR_FC_cur,
			Throttle[THR_FC],512
		)/32
	)
);
}

////////////////////////////////////////////////////////////
int snapviewlist;
int snapview(int s,int hold,int release)
{
snapviewlist = SEQ(KP0,KP1,KP2,KP3,KP4,KP5,KP6,KP7,KP8,KP9);

if (hold)
{
    ActKey(KEYON+CHAIN(
    	PULSE+R_CTL+KP0			,D(T),
    	PULSE+X(snapviewlist,s)	));
}
else
{
	if (release)
	    ActKey(      L_WIN+X(snapviewlist,s));
	else
	    ActKey(KEYON+L_WIN+X(snapviewlist,s));
}
}

////////////////////////////////////////////////////////////

int main()
{
/////////////////// Setup and initialisation ///////////////////
Configure(&HCougar, MODE_EXCLUDED);
Configure(&T16000, MODE_EXCLUDED);
Configure(&LMFD, MODE_EXCLUDED);
Configure(&RMFD, MODE_EXCLUDED);

Configure(&Joystick, MODE_FILTERED);
Configure(&Throttle, MODE_FILTERED);
if(Init(&EventHandle)) return 1;

SetKBRate(TPULSE, TDELAY); // Keyboard pulse and delay times in ms
SetKBLayout(KB_ENG);

/////////////////// Empty maps ///////////////////

// Empty maps
MapList(&Joystick,&JoystickMap0);
MapList(&Throttle,&ThrottleMap0);

/////////////////// Mappings ///////////////////

//MapKey(&Throttle, CSU, REXEC(0, 75, "TrimDXAxis(DX_SLIDER_AXIS,  16);")); // DX_SLIDER_AXIS = slider2
//MapKey(&Throttle, CSD, REXEC(0, 75, "TrimDXAxis(DX_SLIDER_AXIS, -16);"));

MapKey (&Joystick, S1, EXEC("snapview(8,0,0);"));
MapKeyR(&Joystick, S1, EXEC("snapview(8,0,1);"));

//MapKey (&Joystick, H2D, EXEC("snapview(2,0,0);"));
//MapKeyR(&Joystick, H2D, EXEC("snapview(2,0,1);"));
MapKey (&Joystick, H2L, EXEC("snapview(1,0,0);"));
MapKeyR(&Joystick, H2L, EXEC("snapview(1,0,1);"));
MapKey (&Joystick, H2R, EXEC("snapview(3,0,0);"));
MapKeyR(&Joystick, H2R, EXEC("snapview(3,0,1);"));

/////////
// TDC //
/////////

//MapAxis(&Throttle, SCX, DX_XROT_AXIS, AXIS_NORMAL, MAP_RELATIVE);
//SetSCurve(&Throttle, SCX, 0, 40, 0, 0, -10);
MapAxis(&Throttle, SCY, DX_YROT_AXIS, AXIS_NORMAL, MAP_RELATIVE);
SetSCurve(&Throttle, SCY, 0, 40, 0, 0, -10);

MapKey(&Throttle, CSL, REXEC(0, 50, "TrimDXAxis(DX_XROT_AXIS, -8);"));
MapKey(&Throttle, CSR, REXEC(0, 50, "TrimDXAxis(DX_XROT_AXIS,  8);"));

////////////
// Slider //
////////////

KeyAxis(&Throttle,THR_FC,0,AXMAP1(512,
	EXEC("hysteresis_THR_FC(DX_THROTTLE_AXIS);"),
	EXEC("hysteresis_THR_FC(DX_THROTTLE_AXIS);"),
	EXEC("hysteresis_THR_FC(DX_THROTTLE_AXIS);")
));

/////////////
// TrackIR //
/////////////

MapKey(&Throttle, MSP, TEMPO(TrackIrCenter,TrackIrDisable,SHORTTEMPO));

/////////
// Mic //
/////////

MapKey (&Throttle, MSU, TeamSpeakPushToTalk);
   
   return 0;

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

if(&o == &Throttle & x == THR_FC) return rc;

GameOutput(&o, x, o[x]);
return rc;
}

 

 

 

P.S.:

 

This snippet makes the thrustmaster combined silent by default (no DX generated by the combined on button actions):

	MapList(&Joystick,&JoystickMap0);
MapList(&Throttle,&ThrottleMap0);

If you want the combined act as usual (by default, all joystick DX buttons available + a few of the throttle DX buttons), remove the lines entirely (this is default).

 

If you want the combined to only act as the throttle (all throttle DX buttons available), replace with this:

	MapList(&Joystick,&JoystickMap0);
MapList(&Throttle,&ThrottleMap1);

 

P.P.S.: Adding a simplified script that doesn't have all the gizmos, to serve as template:

 

 

include "target.tmh"


define TeamSpeakPushToTalk		CAPS

define TrackIrCenter			L_ALT+SCRLCK
define TrackIrDisable			L_ALT+BRK

////////////////////////////////////////////////////////////

define TPULSE 70
define TDELAY 50
define T (TPULSE+TDELAY)

define SHORTTEMPO 300
define LONGTEMPO 1500

////////////////////////////////////////////////////////////

int main()
{
/////////////////// Setup and initialisation ///////////////////
Configure(&HCougar, MODE_EXCLUDED);
Configure(&T16000, MODE_EXCLUDED);
Configure(&LMFD, MODE_EXCLUDED);
Configure(&RMFD, MODE_EXCLUDED);

Configure(&Joystick, MODE_FILTERED);
Configure(&Throttle, MODE_FILTERED);
if(Init(&EventHandle)) return 1;

SetKBRate(TPULSE, TDELAY); // Keyboard pulse and delay times in ms
SetKBLayout(KB_ENG);

/////////////////// Mappings ///////////////////

/////////////
// TrackIR //
/////////////

MapKey(&Throttle, MSP, TEMPO(TrackIrCenter,TrackIrDisable,SHORTTEMPO));

/////////
// Mic //
/////////

MapKey (&Throttle, MSU, TeamSpeakPushToTalk);
   
   return 0;

}
int EventHandle(int type, alias o, int x)
{
   int rc = DefaultMapping(&o, x);
//
GameOutput(&o, x, o[x]);
return rc;
}


Edited by PiedDroit
Link to comment
Share on other sites

  • 2 years later...
The Script Editor Basics pdf is the most complete Target Manual out there.

 

Looking at the "target.tmh" file and the other files in that same install directory can also give you some further hints.

 

 

thanks Thermal for your input.

This is most exciting piece of software.

 

I tried searching for "target.tmh" file but can't seem to find it.

start menu/programs/thrustmaster/TARGET

has only 3 files.......

Link to comment
Share on other sites

Should be in the installation folder of TARGET, not in the start menu.

Something like this: c:\Program files (or Program Files (x86))\Thrustmaster\TARGET\Scripts\

(can't tell the exact default install location, i moved mine to another location after the installation).

Win10 Pro 64-bit, i7-4770K @ 4.5 GHz, Corsair H100i, AsRock Extreme4, ASUS Strix 1080Ti OC 11GB, 32 GB DDR3 G.Skill 2400. Monitors: LG 27GL850-B27 2560x1440 + Samsung SyncMaster 2443 1920x1200, HOTAS: Warthog with Virpil WarBRD base & hegykc MFG Crosswind modded pedals, TrackIR4, Oculus Rift S.

Personal Wish List: A6 Intruder, Vietnam theater, decent ATC module, better VR performance!

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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