Jump to content

T.A.R.G.E.T. code for dual T16000M for Star Citizen. (need testers)

Recommended Posts

I made some code that works in the script editor. But I lack the skills to test them good in swarm/dogfight. The Vanduul aliens are fingerpainting my cockpit the whole time. They don't care for us testing buttons, lol.


This stuff I wrote (kinda proud of it smile.gif ) is for 2 T16000M joysticks.


include "target.tmh"
// include "CaptSolbeamer_v1.0.ttm"...define stuff that does not exist :)
//this code gives you thrust/brake on the LEFT stick, and stearing on the RIGHT

alias T16001; // second T16000 handle, which will be used all mapping commands
alias T16A; // for handy switching purposes only
alias T16B; // same here
define switchthem 1 // make 0/1 if left=right

int main()

Configure(&HCougar, MODE_EXCLUDED);
Configure(&Joystick, MODE_EXCLUDED);
Configure(&Throttle, MODE_EXCLUDED);

if(Init(&EventHandle)) return 1; // declare the event handler, return on error

&T16001 = GetIndexJoy (SelectUsbDevice ("VID_044F&PID_B10A")); //pc expects a joystick on this adress

if (switchthem)

&T16A = &T16000;
&T16B = &T16001;

&T16000 = &T16B;
&T16001 = &T16A;
// this was about making the left one right and vice...

//The Axis:

//Left stick axis
//thrust/backw, rolling and up/down (deadzones at 14%)

KeyAxis (&T16000, JOYY,   0,  AXMAP2 (LIST (0, 43, 57, 100), 'w', 0, 's'));  // forward/backward 
KeyAxis (&T16000, JOYX,   0,  AXMAP2 (LIST (0, 43, 57, 100), 'q', 0, 'e'));  //Strafe left/right
KeyAxis (&T16000, RUDDER, 0,  AXMAP2 (LIST (0, 43, 57, 100), 'f', 0, 'r')); // Strafe Down/Up 

//Right stick axis
//yaw and pitch and : 

MapAxis (&T16001, JOYY, DX_Y_AXIS);            //pitch
KeyAxis (&T16001, JOYX, 0, AXMAP2 (LIST (0, 43, 57, 100), 'a', 0, 'd')); // roll
MapAxis (&T16001, RUDDER, DX_X_AXIS);          //yaw
SetSCurve (&T16001, JOYY,   0, 6, 0, 4, 0);   // deadzone first number,   
SetSCurve (&T16001, RUDDER, 0, 12, 0, 4, 0);   // 2nd = sensitivy (range -20/20)

// left stick..

MapKey  (&T16000, TS1, MOUSE_LEFT);       // fire w1
MapKey  (&T16000, TS2, USB[0x2C]) ;       // Spacebar = brake
MapKey   (&T16000, TS3, TEMPO ( CHAIN (USB[0xE6], 'm'), CHAIN  (USB[0x2B],  USB[0xE0]) , 850 )  ); // RALT(=R_MENU)+M/ TAB+LCTRL =Look  ahead, or  after 0,8 pushdown sec Head Look
MapKey  (&T16000, TS4, USB [0xE2] );      // Gimball locked (L_ALT=L_MENU)

MapKey  (&T16000, H1U, TEMPO ('u', 'g', 850 ) ) ;    // PIN, CYCLE PINNED
//MapKey  (&T16000, H1D,                  // Second Reticle Speed...soon implemented by CIG I hope
MapKey  (&T16000, H1L, L_CTL+CAPS);       //'CTRL+CAPS' = g-safe
MapKey  (&T16000, H1R, USB[0x39]);        //'CAPS' = decouple

//The buttons left stick:

// 11,12,13  7,6,5
//         []
// 16,15,14  8,9,10

MapKey (&T16000, B11, '1');       // power to group 1
MapKey (&T16000, B12, '2');       // Power to group 2
MapKey (&T16000, B13, '3');       // power to group 3

MapKey (&T16000, B16, '0');       // equalize powergrid
MapKey (&T16000, B15, USB[0x5D]); // equalize shield powergrid (nump 5)
MapKey (&T16000, B14, '.');       // Camera Looks behind me

MapKey (&T16000, B7, USB[0x4A]);  // focus HUD 
MapKey (&T16000, B6, USB[0x52]);  // arrow UP
MapKey (&T16000, B5, USB[0x28]);  // Interact with HUD (ENTER)

MapKey (&T16000, B8,  USB[0x50]); // arrow LEFT
MapKey (&T16000, B9,  USB[0x51]); // arrow DOWN
MapKey (&T16000, B10, USB[0x4F]); // arrow RIGHT


//Right stick 

//rightstick POV:

//U,D,L,R, bind ingame for ship follows reticle 
MapKey  (&T16001, H1U, '8');  // Aim up
MapKey  (&T16001, H1D, '9');  // Aim down  
MapKey  (&T16001, H1L, '6');  // Aim left
MapKey  (&T16001, H1R, '7');  // Aim right

MapKey  (&T16001, TS1, MOUSE_RIGHT );   // Fire w2
MapKey  (&T16001, TS2, TEMPO (MOUSE_CENTER, 'z' , 850) ); //Mousewheel (missile) / FLARE
MapKey  (&T16001, TS3, DX3);            // weapon 3 = mouse4 button
MapKey  (&T16001, TS4, 'x' );           // Cycle cm. (and missile cycle in future by tempo) 

/// 5,6,7  13,12,11
///      []
///10,9,8  14,15,16

//shield stuff
MapKey (&T16001, B5, USB[0x5F]);   // nump7
MapKey (&T16001, B6, USB[0x60]);   // nump8
MapKey (&T16001, B7, USB[0x61]);   // nump9

MapKey (&T16001, B10, USB[0x5C]);  // nump4
MapKey (&T16001, B9,  USB[0x5A]);  // nump2
MapKey (&T16001, B8,  USB[0x5E]);  // nump6

MapKey (&T16001, B13, ',');        // zoom radar
MapKey (&T16001, B12, 'o');        // toggle lights or ninja/mode
MapKey (&T16001, B11, 't');        // Cycle (find) all enemies

MapKey (&T16001, B14, 'k');        // cycle radar backw 
MapKey (&T16001, B15, 'j');        // cycle radar forward
MapKey (&T16001, B16, R_ALT +'l'); // Ejectos (USB[0xE6]) (R_ALT=R_MENU)

//doubletap bind ingame or with combining it with [ENTER] (B5 left sstick)
//to go to camera view. B5, B7, B10 and B8 = top, bottom, left and right camera then 


//event handler
int EventHandle(int type, alias o, int x)
DefaultMapping(&o, x);

//add event handling code here

And this is what it should do:




Don't forget to apply the following..

...the hat-problem!

TARGET not finding it that is. It's a typo in the file TARGET itself makes.




thanks to KrakkenSmacken (on the SC forum) for this:



To find the second hat in T.A.R.G.E.T, you need to go deep.


To set it up you have to relalize that the second stick is on Alias, (&T16001)


Because of this, the hat code on line 258 of the target.tmh file misses the check.


else if(&dev == &T16000)

edit it to this:


else if(&dev == &T16000 | &dev == &T16001)



[end quote]



You will end up with this file:




Sol (on a general note):

If saving this file (in case my link stops working) is a problem (you can just copy-paste by selecting the whole stuff in TARGET and then CTRL+C the lot, and give a new file the same name);

You can use the file in this zip.



It has a different solution. (it completely kills the 'else'-stuff altogeter), but it has the same result. It works!


You need to put this new target.tmh file in the same folder as your homebrew file. TARGET will not make it's own typo'ed file, and our file will give us the second HAT.


*note ... I don't know if Thrustmaster updated the program and fixed this.

I emailed them with the above solution, but I dare not uninstall, and re-install TARGET. Maybe they fixed this, but screwed up other stuff. tongue.gif

Better fight the demons you know.. smile.gif



Maybe in the future we might be able to replace the right POV 6-9 ingame solution with a coded mouse. But for now the game flips when we use mouse code.

Follow this thread for updates on (hopefully) fixing this.






Geetings from Holland

Captain of the Solbeamer




Edited by Solbeamer
slight editing
Link to comment
Share on other sites

Wrong forum.

ASUS ROG Maximus VIII Hero, i7-6700K, Noctua NH-D14 Cooler, Crucial 32GB DDR4 2133, Samsung 950 Pro NVMe 256GB, Samsung EVO 250GB & 500GB SSD, 2TB Caviar Black, Zotac GTX 1080 AMP! Extreme 8GB, Corsair HX1000i, Phillips BDM4065UC 40" 4k monitor, VX2258 TouchScreen, TIR 5 w/ProClip, TM Warthog, VKB Gladiator Pro, Saitek X56, et. al., MFG Crosswind Pedals #1199, VolairSim Pit, Rift CV1 :thumbup:

Link to comment
Share on other sites

  • Recently Browsing   0 members

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