Previous Thread
Next Thread
Print Thread
Rate This Thread
Hop To
#4087385 - 03/04/15 09:01 AM T.A.R.G.E.T. code for dual T16000M for Star Citizen. (need testers)  
Joined: Dec 2013
Posts: 46
Space the Blaze Offline
Blazer of Space
Space the Blaze  Offline
Blazer of Space
Junior Member

Joined: Dec 2013
Posts: 46
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 ) is for 2 T16000M joysticks.

Code:
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);
Configure(&LMFD, MODE_EXCLUDED);
Configure(&RMFD, 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.

Solution:

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

[quote]:
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.

Code:
     else if(&dev == &T16000)
 
edit it to this:

Code:
     else if(&dev == &T16000 | &dev == &T16001)
Cheers

[end quote]
------

You will end up with this file:
http://www.speedyshare.com/cmZZT/target.tmh


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.
http://www.reddit.com/r/starcitizen/...aft_and_rough/

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.
Better fight the demons you know..


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.

http://forums.eagle.ru/showthread.php?t=73271&page=6



Geetings from Holland
Captain of the Solbeamer
tomcat
_
_

Inline advert (2nd and 3rd post)

#4087435 - 03/04/15 12:48 PM Re: T.A.R.G.E.T. code for dual T16000M for Star Citizen. (need testers) [Re: Space the Blaze]  
Joined: Jul 2009
Posts: 9,711
CyBerkut Offline
Administrator
CyBerkut  Offline
Administrator
Hotshot

Joined: Jul 2009
Posts: 9,711
Florida
Nice work! If you have not yet posted this over in Cloud Imperium's forums yet, I strongly suggest you do. You'll most likely find some additional testers there, and may even pick up some admirers! wink

Well done! Keep us posted if you tweak it any.

#4087768 - 03/04/15 11:17 PM Re: T.A.R.G.E.T. code for dual T16000M for Star Citizen. (need testers) [Re: Space the Blaze]  
Joined: Dec 2013
Posts: 46
Space the Blaze Offline
Blazer of Space
Space the Blaze  Offline
Blazer of Space
Junior Member

Joined: Dec 2013
Posts: 46
Thanks. It's already there. (but it seems I hit the dead zone over there, lol)
And on a lot of other places. smile
On one forum I have more succes than on others.

Here you can follow all discussions about it.

https://forums.robertsspaceindustries.co...-and-helpers/p2

http://www.reddit.com/r/starcitizen/comments/2xw5ws/target_code_for_dual_t16000m_for_star_citizen/

http://forums.eagle.ru/showthread.php?p=2338156

And some update about the mouse issue I still have to try:
http://forums.eagle.ru/showthread.php?t=73271&page=7


Last edited by SpaceBlaze; 03/04/15 11:21 PM.

Moderated by  RacerGT 

Quick Search
Recent Articles
Support SimHQ

If you shop on Amazon use this Amazon link to support SimHQ
.
Social


Recent Topics
Headphones
by RossUK. 04/24/24 03:48 PM
Skymaster down.
by Mr_Blastman. 04/24/24 03:28 PM
The Old Breed and the Costs of War
by wormfood. 04/24/24 01:39 PM
Actors portraying British Prime Ministers
by Tarnsman. 04/24/24 01:11 AM
Roy Cross is 100 Years Old
by F4UDash4. 04/23/24 11:22 AM
Actors portraying US Presidents
by PanzerMeyer. 04/19/24 12:19 PM
Dickey Betts was 80
by Rick_Rawlings. 04/19/24 01:11 AM
Exodus
by RedOneAlpha. 04/18/24 05:46 PM
Copyright 1997-2016, SimHQ Inc. All Rights Reserved.

Powered by UBB.threads™ PHP Forum Software 7.6.0