Hard Light Productions Forums

Hosted Projects - Standalone => Diaspora => Diaspora Tech Help => Topic started by: Rakebuzz on February 12, 2014, 09:24:23 pm

Title: Using two T16000 and T.A.R.G.E.T. in Diaspora
Post by: Rakebuzz on February 12, 2014, 09:24:23 pm
Hello,

Been programming for a few months now, and read the script manual a few dozen times in the proces.
Got 97% on paper now on how I want my sticks to work, and for something for you and T.A.R.G.E.T. to work with.
Might have forgotten a few ; 's at the end of each line on the way and therefore things might not work yet, and not sure about the use of & to let the program use two command lines for the same axe. It's too C for me, but easy to trial and error..

In a few hours I will have it all posted here. Lot's of fluff stuff behind the //'s (the part the progam ignores) so you can understand why the line is written as it is, and what it should do.

First thing I did was...welll ofc read the manuals a dozen times...but in the proces it became clear that this was far superiour to using VJoy and PJoy. (well..if it works ofc, still need to test stuff).
While reading the manuals I could grasp how to write stuff so the T16kM's were going to do what they needed to do.

I wanted my right stick to be a never-let-go stick. All base buttons and the left youstick were all going to be have to be done with the left hand.
Therefore any unexpected immediate threat should have to be able to be dealt with by the right always-hand-holded joy only.

This is what I came up with...
T16000 (the right one)
X-axis = Bank axis
Y-axis = from middle to up:Absolute throttle-axis
         from middle to down: Also Absolute throttle-axis mirrored to up(yes, this is possible in TARGET!)
also Y-up = Forward Thrust
       Y-down = Reverse Thrust
You can see how this is stating: Push to go, and pull to go backwards! Easy as not eating pie :D. No seeking buttons to thrust stuff on this one.
Don't worry... Throttle (0, 1/3, 2/3 and full) will also be assigned to some right POV's for use with other Thrusts.
But linking the Dia Throttle Axis with the right Y-axis seemed too logical to ignore.
Z-rotate axis right-twist = Thrust up
Z-rotate exis left-twist = Thrust down.
Reason: I am doing stuff and suddenly someone starts shooting missiles at me from close range. This one has to save me! NOW!
Now the right POV -assigned full throttle- together with a quick twist will let this evil missile pass me by under or over me.

Left youstick T16001 :
X-Axis left= Left thrust
          right= Right Thrust
Y-Axis = Pitch axis
Z-rotate =Yaw (yawing is rotating anyways, cannot get more logical then this :))


And then did a lot of pencil and paper stuff. One of them is a sort of mapping of how I wanted things to be assigned.
Here's my scrablings..:)
(code will be here in a few hours. Lot's of typing to do. Only got code on paper)



[attachment deleted by an evil time traveler]
Title: Re: Using two T16000 and T.A.R.G.E.T. in Diaspora
Post by: Rakebuzz on February 13, 2014, 02:22:56 am
Code: [Select]
// everything behind two of these is always ignored by the program, and only for clarification purposes
include "target.tmh";
include "Diaspora_button_Macros.ttm"; // Telling the program to use this ttm. See next reply today or soon.

alias T16001;  // Second T16000M handle, and naming it. Since no testing yet, below you might have to switch 16000 and 16001 numberings if pc mixes them up.


int Cruise_Mode ; // I want three Axis-modes. Cruise, Combat and Docking. We will define next how axis should behave in Cruise Mode. The Combat and Docking Modes you can do for yourselves if below part here works. Just add SetSCurves to them. See page 27/60 in the Script Manual on howto of SetSCurve...
{
///////////
//T16000, The right, never-let-go stick. Forward/Reversed Thrust&Throttle Axis-in-one, Banking and Thrust UP/DOWN for evasion of incoming
///////////

MapAxis(&T16000, JOYX, DX_X_AXIS, AXIS_NORMAL, MAP_ABSOLUTE); // no need to Set Curve yet. Link X-axis ingame to Bank Axis. (just hit the right stick when you are into defining the bind in Dia)

KeyAxis(&T16000, JOYY, 0, AXMAP1 (2, 'PGUP', 'PGDN')); // Link Page Up and Down ingame to Forward and Reverse Thrust. Put two if these(//) before this line if you bind the axis ingame to the Absolute Throttle Axis. It might conflict with the PG buttons it creates here... or (my better guess on howto when fails) bind Forward Thrust and Reverse Thrust ingame to the page-keys áfter you have bound Absolute Throttle Axis that comes next..(the '2' chops the axis in half btw, and the next two state what it must do/keystroke there)
& SetCustomCurve(T16000, JOYY, LIST (0,100, 25,75, 50,50, 75,75, 100,100)); //  Both pull and push of Y-axis should behave the same. Link ingame to Absolute Throttle Axis. So you get Throttle going eather way :). Does it need an & in front of it?
//the above JOYY assignments should give you the handy push-to-go-forward, and pull-to-fly-backwards...

KeyAxis(&T16000, RUDDER, 0, AXMAP1(2, 'UARROW', 'DARROW'));
& KeyAxis(&T16000, RUDDER, DX_ZROT_AXIS, AXIS_NORMAL, MAP_ABSOLUTE; // Link arrows Up and DOWN ingame to Thrust Up and Down, and twisting the Z-Axis should do this. Ps: Don't forget the POV DL (downleft) clicking (see next reply that comes soon) or no full throttle :@P =nothing happening. Used to evade missiles. Does it need an & in front of it?

///////////////////
//T16001, the left one. Pitch, Yaw and left/right Thrust
///////////////////
KeyAxis(T16001, JOYX, 0, AXMAP1(2, 'LARROW', 'RARROW')); // link these arrows ingame to Left & Right Thrust.. then X-axis will do this
&MapAxis(T16001, JOYX, DX_X_AXIS, AXIS_NORMAL, MAP_ABSOLUTE); // does it need an & in front of it?

MapAxis(T16001, JOYY, DX_Y_AXIS, AXIS_NORMAL, MAP_ABSOLUTE); // link left joy y-axis ingame to Pitch Axis.

MapAxis(&T16001, RUDDER, DX_ZROT_AXIS, AXIS_NORMAL, MAP_ABSOLUTE); // link z-rotate ingame to Yaw Axis.

///////////
//making the other modes invalid (for obvious reasons)
///////////

COMBAT_MODE=0;  //(not sure these two work if not using FLAG)
&DOCKING_MODE=0;  //does it need an & in front of it?
}

int main()
{
if(Init(EventHandle)) return 1; //declare event handler, return on error
&T16001 = GetIndexJoy (SelectUsbDevice ("VID_044F&PID_B10A"));  // telling TARGET to get info from the second joy at given usb ID. The ID you see here is always this one for 2nd T16kM joy's, and T16001 was given this name by us so TARGET knows what we are talking about.
//here comes the MACRO key assigning. See next Reply to this thread. I will post script in parts. It's the least interesting and most easy part of this script...and the most typing I see :)

if 'SHIFT' + 'ALT' + '3'  // any T2, right j's T3 and left j's POV-right.
EXEC (Cruise_Mode;);  // this should result in going into Cruise_Mode, for now the only mode I did.

if 'SHIFT' + 'ALT' + '1'  // any T2, right j's T3 and left j's POV-up
EXEC (Combat_Mode;); // to be defined in a few weeks or by yourself with SCurving (page 27 script manual)

if 'SHIFT' + 'ALT' + '5'  // any T2, right j's T3 and left j's POV-down
EXEC (Docking_Mode;); // same story, better tweak it to your own liking :)

Cruise_Mode=1; // set initial Axis Mode to Cruise. If Mode switching doesn't work redo scripting writing with the use of 3 FLAG's for the Modes this time (page 43 script manual). Every mode should be told to unable the other two modes in the script. Or else some Axis might do two mixed modes :P. Not sure if it can be done without use of FLAG/EXEC. My guess is Combat_Mode=0 , Cruise_Mode=0 will just do the trick without defining these Modes in FLAG's.
}

I am very confident it is filled with syntax errors. Any corrections and comments/improvements are very welcome.
I am not an expert, and did this stuff more on assumptions then on knowto's.
I got twice the above more on paper to be posted here. 4 pages filled with define buttons. And got to write the whole part referring to the define part. Saved the boring part for last :). But the above...if it works...should give you 6 axis with some cut in half for improved functionality to top it off.


editted reason:
spelling in code wrong. :)
 :pimp: :pimp: there might be more...
Title: Re: Using two T16000 and T.A.R.G.E.T. in Diaspora
Post by: The E on February 13, 2014, 02:26:49 am
ummmm

okay

What is this for, exactly?
Title: Re: Using two T16000 and T.A.R.G.E.T. in Diaspora
Post by: Veers on February 13, 2014, 02:56:38 am
Looks like some key mapping/binding? (for two sticks?)

I'm so rusty on my coding.
Title: Re: Using two T16000 and T.A.R.G.E.T. in Diaspora
Post by: Rakebuzz on February 13, 2014, 03:03:38 am
Indeed. It is coding for using two joysticks as one.
In TARGET software. The scripting part of it uses C a lot.
So I learned some basic C in 3 months, lol..

It's for using two joysticks as a virtual one. Diaspora only wants to see one. TARGET software (from Thrustmaster) lets you do that.
That way you can assign more axis and buttons then with just one joystick. I have assigned the entire keybord to the base buttons of my two joysticks. The idea was that I just don't need to use the entire keybord at all. I got every button and function on my joysticks. A few people want to know how this is possible including me. So I spend three months of programming in TARGET (which uses C) and now I am almost done. When done, it's just copy/paste for the rest of the gamers who use two T16000M joysticks. And not only in Diaspora. With minor adjustments it also works in other games.

It will help a lot of people out. On other sites they also want to knwo how this is done. There are a few threads on this (TARGET) but I seem to have stuff the other threads are lacking. (if it works is a second, but it is all trial and error anyway with this stuff)


Title: Re: Using two T16000 and T.A.R.G.E.T. in Diaspora
Post by: Rakebuzz on February 13, 2014, 03:05:13 am
On this forum and at Roberts (Space Citizen) there are some people who have posted about this.
So I am not the only one with two T16000M's :)
Title: Re: Using two T16000 and T.A.R.G.E.T. in Diaspora
Post by: Familiar on February 13, 2014, 03:27:08 am
First of all, it is really strange setup (I mean 2 similar sticks)

I think most preferable (by popularity) setup for freespace will be :

1) keyboard + mouse
2) keyboard only
3) flightstick
4) HOTAS (flightstick + throttle) <- which is the best (I mean "fun" factor). Except you don't get "shooter style aiming precision" as using mouse. And your joystick must be very very precise with 0 deadzone and very light load. My choice is slightly modified Defender Cobra M5. For lateral thrusters I have 3 hat switches to choose from - 2 on stick and 1 on throttle.
I use VJoy + Joystick curves + SVMapper  soft to link Hotas into 1 device.
5) and now there's the guy with 2  T16k ( I think it's bit complicated setup for Freespace, but if you wish... However it could be fun to have 2 sticks for Mechwarrior or Descent)

But wait - how T16000 fits your left hand?
Title: Re: Using two T16000 and T.A.R.G.E.T. in Diaspora
Post by: Rakebuzz on February 13, 2014, 04:13:39 am
It is not uncommon to use two sticks. (although I hear you get owned in MECHWARRIOR online if you fight a dude who uses a mouse, but it could be just a skill-thing :))
These were exactly made for this purpose.
They can be converted to left-side use by a little tinker-work with a screwdriver.
They got good rep on a few review sites.
They are also budget. :)
Quality budget. They don't flip over when taking a dive, and they also lack deadzone issues other expensive joy's tend to have.
I did some extensive homework before I descided that this was my horse to bet on. :)
Title: Re: Using two T16000 and T.A.R.G.E.T. in Diaspora
Post by: z64555 on February 13, 2014, 08:25:45 am
Hey, so long as it works for you.

We can possibly put in support for analog forward/reverse thrust. We've already got the digital keys, it would just be a matter of setting up a new control configuration and then wrestling it into the control config screen so that the user can actually use it.

We could also allow the relative throttle axis to engage in reverse thrust.
Title: Re: Using two T16000 and T.A.R.G.E.T. in Diaspora
Post by: Rakebuzz on February 15, 2014, 07:56:58 am
Code: [Select]
/////////////
//The second part of the 'main' part of the main script. The MapKeying part. copy-past it into main file.
/////////////

////////////
//First the right joystick MapKeys...:
////////////

//////////
// POV part. H1U= up, etc..
/////////

MapKey(&T16000, H1U, Match_Target_Speed); // T.A.R.G.E.T. has to find what defines Match_Target_Speed and finds it in the ttm file we made before if all is well :).  ''KP1''
MapKey(&T16000, H1UR, L_ALT + '2'); //this together with [shift] (any TS2) should give us 1/3 Throttle.. (see: this is the (my) Diaspora_button_Macros.ttm file. (part 2))
MapKey(&T16000, H1R, Toggle_Gliding); // ''KP3''
MapKey(&T16000, H1DR, L_ALT + '4'); // +[Sh]= 2/3 Thr
MapKey(&T16000, H1D, Launch_Countermeasures); // ''KP5''
MapKey(&T16000, H1DL, L_ALT + '6'); // +[Sh]= Thr Max
MapKey(&T16000, H1L, Afterburners); // ''KP7''
MapKey(&T16000, H1UL, L_ALT + '8'); // +[Sh]= Thr to zero
//above POV's edited!!! and therefore also gonna edit the main file that refers to it..

////////////////////////////////
//other top buttons MapKeyed:
////////////////////////////////
 
MapKey(&T16000, TS1, Fire_Primary_Weapon);
MapKey(&T16000, TS2, SHIFT);// Not sure if you get a shift here, or a search for what SHIFT is defined..
MapKey(&T16000, TS3, ALT); //same here. have to test.
MapKey(&T16000, TS4, Cycle_Forward_Primary_Weapon);

///////////////////////////////
// Base Buttons right joystick:
///////////////////////////////

MapKey(&T16000, B5, Rearm_Me);
MapKey(&T16000, B6, Augment_Forward_Shield);
MapKey(&T16000, B7, Equalize_Energy);

MapKey(&T16000, B10, Disarm_My_Target);
MapKey(&T16000, B9, Attack_My_Target);
MapKey(&T16000, B8, Capture_My_Target);
 
MapKey(&T16000, B13, Ignore_My_Target);
MapKey(&T16000, B12, Communication_Menu);
MapKey(&T16000, B11, Toggle_Auto_Speed_Matching);

MapKey(&T16000, B14, Engage_the_Enemy);
MapKey(&T16000, B15, Cover_Me);
MapKey(&T16000, B16, Return_To_Base);


/////////////////////////
/////////////////////////
//left joystick (T16001):
/////////////////////////


///////
//POV: (all views and modes)
///////
 
MapKey(&T16001, H1U, Center_View);
MapKey(&T16001, H1UR, View_Up);
MapKey(&T16001, H1R, View_Right);
MapKey(&T16001, H1DR, Free_Look);
MapKey(&T16001, H1D, View_Rear);
MapKey(&T16001, H1DL, External_View);
MapKey(&T16001, H1L, View_Left);
MapKey(&T16001, H1UL, Current_Target_View);

////////////
//the 4 other top buttons/trigger:
///////////

MapKey(&T16001, TS1, Fire_Secondary_Weapon);
MapKey(&T16001, TS2, SHIFT); // not sure if this will create a search or already giving the shift here..
MapKey(&T16001, TS3, Cycle_Secundary_Weapon_Bank);
MapKey(&T16001, TS4, Target_Next_Closest_Hostile_Ship);

//////////////
//The base buttons:
//////////////
MapKey(&T16001, B11, Target_Ship_In_Reticle);
MapKey(&T16001, B12, Target_subsystem_In_Reticle);
MapKey(&T16001, B13, Target_Targets_Nearest_Attacker);

MapKey(&T16001, B16, Toggle_Auto_Targeting);
MapKey(&T16001, B15, Target_Last_Ship_That_Transmitted);
MapKey(&T16001, B14, Target_Next_Live_Turret);

MapKey(&T16001, B7, Target_Next_Ship);
MapKey(&T16001, B6, Decreaee_View_Distance);
MapKey(&T16001, B5, Increase_View_Distance);

MapKey(&T16001, B8, Target_Closest_Friendly_Ship);
MapKey(&T16001, B9, Cycle_Radar_Range);
MapKey(&T16001, B10, Target_Newest_ship_In_Area);

////////
//done :) 4 moths work here, lol... So if any T16kM users like to test it out for me...;). If something doesn't work, and you come up with a solution, by all means, post it here.  Next come the other file. the .ttm file in where things of the above are defined.
////////


 :pimp: editted:
//////////
// POV part. H1U= up, etc..
/////////
 :pimp:


 :D extra note: You might wonder why at POV I use Keypad numbers and normal numbers at will. This is not without reason! I wanted [shift]-use with half of the POV clicks. To avoid activating stuff that shouldn't activate by accident if you're 1/8th off with clicking. And since shift+keypad numbers are not allowed as option in Dia, I came up with this creative solution that still made some sence  :eek2:

more editted: t16000's codings of the left one had to be be coded as t16001's ofc, lol...

*editted: closet=closest typo... (Target_Next_Closest_Hostile_Ship)
Title: Re: Using two T16000 and T.A.R.G.E.T. in Diaspora
Post by: Rakebuzz on February 15, 2014, 07:59:17 am
Code: [Select]
// this is the (my) Diaspora_button_Macros.ttm  file.   (usage seen at page 19/60 of the TARGET script manual)
// to be used in conjunction with the mapkey part I will post in a few days. (how it works: T.A.R.G.E.T. script manual page19/60)
//feel free to adjust to your own pref. construction ofc. It's mainly here te help understand how T.A.R.G.E.T. can do stuff for you.

//everything behind at least two of these -untill the next line- is always ignored by the program. so an ideal place to clarify stuff.

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////  here the handy layout POV/HAT/top of the (my) left T16001M joystick
///////////////                '9' [Trigger] (TS1)
///////////////                             1                                    H1U
///////////////                        8         2                           H1UL    H1UR
///////////////   'm' (TS3)        7        .        3   'r' (TS4)  =    H1L      .        H1R
///////////////                        6         4                           H1DL    H1DR
///////////////                             5                                    H1D
///////////////                   [SHIFT] (TS2)        (H1UL etc info not/hard to find in Thrustmaster/TARGET manuals,
///////////////                                                             so mentioning it for global benefit)
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////

//note: my pc gave one USB the nr ''3'' (the left one T16001), and the other ''1'' (the right one T16000). In case of reference ..

//here comes the left joystick little thumbee POV's HAT definitions they way it made sence to me... And list below is going clockwise:

{
define Center_View '1' // When the game tells MapKey (soon to be posted) to execute 'Center_View' it gets redirected to this file and creates a ''1'' here.
//It starts working (doing the MapKey part) when quickkeyed ingame to ''1'' for Center View. linked to the POV-UP in the soon-to-be-seen MapKey code.
define View_Up '2' //  link View Up ingame to ''2''. linked to POV-UPRIGHT
define View_Right '3' // link View Right to ''3''. linked to POV-R
define Free_Look '4' // link to ''4'' ingame. linked to POV-DR
define View_Rear '5' // etc, see above how to proceed, POV-D
define External_View '6' // POV-DL
define View_Left '7' // POV-L
define Current_Target_View '8' // POV-UL

//also on left POV: joystick sensibility. The three modes. Defining them was done in the main script. They are in the [SHIFT]+[ALT] layer (only accessable by pushing two buttons with the right hand to prevent accidental activation.)

//TS1-TS4  trigger/buttons next:

define Fire_Secondary_Weapon '9' // quickkey ingame to ''9''. Mapkey will give this order to the trigger (TS1)

define SHIFT L_SHIFT // TS2 (easy to push with base of your thumb) does ''shift''-layer. Needed since I make use of Keybord obsolete by assigning entire alphabet to buttons on the two joystick.
//Some letters have to be used more then once to be able to assign all the Dia stuff :) .

define Cycle_Secundary_Weapon_Bank 'm' // TS3 (the left button) creates an ''m'' because when pushed in the MapKey part it orders TARGET to look for something that defines C_S_W_B, and TARGET finds that info over here. 
//''m'' needs to be linked ingame to C_S_W_B  ofc. as with all these defines!
//define Cycle_Secundary_Weapon_Firing_Rate. *//* Yes, this is not a //-typo. Target needs no info about this one, but you do...:
//Activated by using any TS2 (both will give you a [shift]) +left TS3. Bind ingame to [SHIFT]+ ''m''. 
//These not-completelly-used-by-TARGET lines are from here on marked by *//* after the define-part for easy comment-reading, and to avoid confusion.

define Target_Next_Closest_Hostile_Ship 'r' // TS4 (the right button) creates an 'r' here. bind ingame to T_N_C_H_S as usual
//define Target_Previous_Closest_Hostile_Ship. *//* The former/above created 'r' In the [ALT] layer this time. [ALT] gets created by pushing the right stick's TS3. So left TS4+ right TS3. Bind ingame to [ALT]+ ''r''

//define Target_Next_Hostile_Bomb_Bomber. *//* Any TS2 + left TS4. Bind ingame to [SHIFT]+ 'r'
//Define Target_Previous_Hostile_Bomb_Bomber. *//* Any TS2+ right TS3+ left TS4. Bind ingame to [SHIFT]+[ALT]+ 'r'  (=not difficult to push al these. the mental stuff is the hard part :) )

//end POV part

////////////////////////////////////////////////////////////////
// Base buttons lefthanded joystick. Assignment of alphabet.
////////////////////////////////////////////////////////////////
//                       ||
// B11   B12   B13       ||      B7   B6   B5
// B16   B15             <>           B9   B10
//             B14               B8
//
/////////////////////////////////////////
//                      ||
//   Q    W     E       ||       T     Y     U
//   A    S             <>             G     H
//              D                F
//
/////////////////////////////////////////

define Target_Ship_In_Reticle 'q'  // B11 button says: ''q''. (in the next to be posted MapKey part).  Bind ingame to ''q''
//define Target_Closest_Attacking_Ship. *//*  [SHIFT] (=anyTS2) + B11 (''q''). Bind ingame to [SHIFT]+ ''q''

define Target_subsystem_In_Reticle 'w' // B12. Bind ingame as usual
//define Target_Next_subsystem *//* [SHIFT] + ''w'' . Same proces here and below
//define Target_Previous_Subsystem *//* [SHIFT]+[ALT] + ''w''.

define Target_Targets_Nearest_Attacker 'e'  // B13
//define Target_Targets_Target *//* [SHIFt] + ''e''

define Toggle_Auto_Targeting 'a' // B16
//define Turn_Auto_Targeting_Off *//* [ALT]+ ''a''
//define Turn_Auto_targeting_Subsystem_Off *//* [SHIFT] + ''a''

define Target_Last_Ship_That_Transmitted 's' // B15

define Target_Next_Live_Turret 'd' // B14

define Target_Next_Ship  't' // B7
//define Target_Previous_Ship *//* [ALT] + ''t''

define Decreaee_View_Distance 'y' // B6

define Increase_View_Distance 'u' // B5

define Target_Closest_Friendly_Ship 'f' // B8
//define Target_Closest_Previous_Friendly_Ship *//* [ALT] + ''f''

define Cycle_Radar_Range 'g' // B9

define Target_Newest_ship_In_Area  'h' // B10



}

note: just before the } above; copy-paste the next reply-total code part.


-end part one of this file, the left joystick MapKey definitions-

Second part soon. Posting in parts so you can see work in progress. :). In a few days all is posted, and testing can begin. I hope people with also these two sticks will want to help me with this.
Maybe other T.A.R.G.E.T. file writers can see errors sooner then me. I am confident that this will help some of Thrustmaster stuff users out.
Copy-Pasting this and correcting (hopefully) only one or two syntax errors saves you 3 days typing and 3 months homework I find.
I hope my theorie of/in the code is as good as correct. I am no pro in finding out why stuff will/is not working yet, lol.. Haven't had time to test anything. Still got 1-2 days of programming the rest of the program ahead it seems...
ps: Sorry if with copy-paste the txt joy pic layout gets gurbled up. It's either looking ok here, or ok in your own file :P.

pps: the green code trick works :) looking nice!

The next page below needs adjusting, so I will go []code it when I got code that works. It seems that Diaspora hates F1-F12 buttons. So I need to adjust it. My idea is that since I cannot push two buttons (ALT is the left big button besides the POV) with one thumb top (we cán with the base of the tumb/palm which gives us the shift-button!), and I want to use the KeyPad numbers and the normal numbers without chance of activating other stuff linked to normal numbers.
I will use up, right, down and left POV = KP1, KP3, KP5 and KP7.
The in between POV's I will do in [SHIFT]+[ALT] + normal 2, 4, 6 and 8. This has to be done so cause Dia don't like [SHIFT] with KeyPad numbers. And [ALT] + POV is using your thumbtop for two things= not possible, lol.
I will code T.A.R.G.E.T. to give these four POV's an [ALT] and the number, and you will have to use the [SHIFt] TS3 in addition to these POV's. This to deny the possibility you slightly miss the POV you want to hit, and do stuff with your Throttle while you wanted to use countermeasure etc. The having to use of TS3 button for the in-between-buttons prevents unexpected stuff from happening. :)

The other left handed POV only does camera, and misswitching between them doesn't do other stuff to the ship. So it doesn't matter that much over there.. :)


*editted: closet=closest typo... (Target_Next_Closest_Hostile_Ship)

[attachment deleted by an evil time traveler]
Title: Re: Using two T16000 and T.A.R.G.E.T. in Diaspora
Post by: Rakebuzz on February 15, 2014, 08:01:15 am
// this is the (my) Diaspora_button_Macros.ttm  file.   (part 2)
//  just copy/paste it behind the first part of this file above.

Code: [Select]

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////  here the handy layout POV/HAT/top of the (my) right T16000M joystick
///////////////                       KP9[Trigger(TS1)]
///////////////                            KP1                                H1U
///////////////                 [S]+[A+8]      [S]+[A+2]                  H1UL    H1UR
///////////////   [ALT](TS3)  KP7          PoV       KP3 (TS4)[0] =    H1L     .       H1R
///////////////                 [S]+[A+6]      [S]+[A+4]                  H1DL    H1DR
///////////////                            KP5                                H1D
///////////////                           (TS2)       
///////////////                         [=SHIFT]                               
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////

//note: my pc gave one USB the nr ''3'' (the left one T16001), and the other ''1'' (the right one T16000). In case of reference ..

//////////////////
//here comes the right joystick little thumbee POV's HAT definitions ... And list below again going clockwise:
/////////////////

//beware: every half POV , I switch between Keypad numbers and normal+[alt]+[shift]. This is not without reason, and explained elsewhere.
define Match_Target_Speed KP1 // bind ingame to KeyPad button 1
//define Set_Throttle_to_One_third *//*  bind ingame to [SHIFt] + [ALT] + 2,  the [ALT]+2-part is going to be defined in the main file. Use UR-POV and TS2 to throttle 1/3 is what we've got here.
define Toggle_Gliding KP3 // H1R button. Up for battle en Right for cruise and gliding stuff... this was my idea of easy logic.
//define Set_Throttle_to_Two_Third *//* bind to [Shift] + [ALT] + 4
define Launch_Countermeasures KP5 // down button. dropping and down logic :)
//define Set_Throttle_to_Max *//* [Shift] + [ALT] +6 linked
define Afterburners KP7  // left button (sorry, I know Vipers has got the big red Fire here :), but triggering to shoot= :) too )
//define Set_Throttle_to_zero *//* [Shift] + [ALT] + 8 linked

//////////////////////////
//TS1-TS4  trigger/buttons next:
//////////////////////////

define Fire_Primary_Weapon KP9 // Trigger. Bind ingame to KeyPad 9
define SHIFT L_SHIFT // TS2. Not sure if SHIFT in the MapKey already gives me the shift. Might be obsolete.
define ALT L_ALT // TS3. Same story here as shift above..
define Cycle_Forward_Primary_Weapon '0' // TS4, the right button
//define Cycle_backward_Primary_Weapon *//* [Shift] (any TS2) + TS4 (0). Link this combo ingame to work

//end POV part

//editted F9=KP9 now!!!

////////////////////////////////////////////////////////////////
// Base buttons righthanded joystick. Assignment of alphabet.
////////////////////////////////////////////////////////////////
//                     ||
// B5    B6   B7       ||       B13   B12   B11
// B10   B9            <>             B15   B16
//            B8                B14
//
/////////////////////////////////////////
//                   ||
//  I    O    P      ||       J    K    L
//  Z    X           <>            B    N
//            C               V
//
/////////////////////////////////////////

define Rearm_Me 'i' // B5=i as you can see above. Link Rearm ingame to ''i''
//define Increase_Weapon_Energy *//* [Shift] + ''i''. Link all below as usual...
//define Decrease_weapon_Energy *//* [Shift] + [Alt] + ''i''

define Augment_Forward_Shield 'o' // B6
//define Equalize_Shield *//* [Alt] + ''o''. TS3 for 'Alting'+B6
//define Increase_Shield_Energy *//* [Shift] + ''o''
//define Decrease_Shield_Energy *//* [Shift] + [Alt] + ''o''

define Equalize_Energy 'p' // B7
//define Increase_Increase_Engine_Energy *//* [Shift] + ''p''
//define Decrease_Increase_Engine_Energy *//* [Shift] + [Alt] + ''p''

define Disarm_My_Target 'z' // B10
//define Disable_My_Target *//* [Shift] + ''z''

define Attack_My_Target 'x' // B9
//define Attack_My_Subsystem *//* [Shift] + ''x''

define Capture_My_Target 'c' // B8

define Ignore_My_Target 'j' // B13
//define Form_On_My_Wing *//* [Shift] + ''j''

define Communication_Menu 'k' // B12

define Toggle_Auto_Speed_Matching 'l' // B11 = L

define Engage_the_Enemy 'v' // B14

define Cover_Me 'b' // B15
/define Protect_My_Target *//* [Shift] + ''b''
 
define Return_To_Base 'n' // B16
//define Enter_Subspace_End_Mission *//* [Shift] + ''n''




-end final part of this file. -the right joystick MapKey definitions-


 :pimp:   editted:
//////////////////
//here comes the right joystick little thumbee POV's HAT definitions ... And list below again going clockwise:
/////////////////

//////////////////////////
//TS1-TS4  trigger/buttons next:
//////////////////////////

and editted the layout pics of the sticks POV's etc  :yes:  (not sure if firefox shows the same as IE)
 :pimp:

more editted: TS4 right=0 now. (F10 was forgotten while killing all the F's)

[attachment deleted by an evil time traveler]
Title: Re: Using two T16000 and T.A.R.G.E.T. in Diaspora
Post by: z64555 on February 15, 2014, 06:13:35 pm
If you don't mind, would you please encase the .ttm code with the {code}{/code} tags (using square brackets instead of the braces)?
Title: Re: Using two T16000 and T.A.R.G.E.T. in Diaspora
Post by: Rakebuzz on February 16, 2014, 10:09:33 am
Are you sure *.ttm files use these at all? I only did what the manual on page 19 sayed how it worked. It doesn't speak of these {}'s (as you can see in the attachment)
I haven't been in the T.A.R.G.E.T. script part of the software yet, so I only have on paper that in order for my joysticks to work like 'this' , the code should be 'that'. Been busy with other stuff this weekend also and two days of headache isn't working along too.
But you sound sure, so I will apply them.

It might seem foolish to post stuff that hasn't been tested, but the theory is there, people got a lot to work with (took me 4 months to read, and understand the manual, and come up with code that should do the job), and it might only take a few small adjustments to get the stuff working.
Posted it so it could save others weeks of work that are riding on the same boat as me... (I think even other Thrustmaster users could benefit)
Even posted a few comments to adjustments and reason why they might have to be applied.

Had to look Brackets and Bracers up on google. My English is ok, but not in the code-section...

BTW: Here you can find the manuals and the software. Not sure if I posted it above. Don't see it.

http://ts.thrustmaster.com/eng/index.php?pg=view_files&gid=1&fid=3&pid=285&cid=5



[attachment deleted by an evil time traveler]
Title: Re: Using two T16000 and T.A.R.G.E.T. in Diaspora
Post by: Rakebuzz on February 16, 2014, 10:34:37 am
I'm sure you didn't mean for me to do every indivudual line of
define: between []
and every
// define: not between []
?
If so...I would mind. for obvious reasons.. :P
Everything behind // is ignored by the program. But it still serves a purpose, cause you still need the info after it, to understand stuff and it can do no harm there for as long as it remains in the same line.. (according to the manual)
Title: Re: Using two T16000 and T.A.R.G.E.T. in Diaspora
Post by: AdmiralRalwood on February 16, 2014, 12:22:44 pm
No no no, he meant that you should put the contents in a [code](stuff)[/code] block. So it would look like this:

Code: [Select]
(stuff)
Title: Re: Using two T16000 and T.A.R.G.E.T. in Diaspora
Post by: z64555 on February 16, 2014, 02:42:24 pm
No no no, he meant that you should put the contents in a [code](stuff)[/code] block. So it would look like this:

Code: [Select]
(stuff)

Yes this.

Huh, interesting trick there, Ralwood
Title: Re: Using two T16000 and T.A.R.G.E.T. in Diaspora
Post by: AdmiralRalwood on February 16, 2014, 05:42:55 pm
Huh, interesting trick there, Ralwood
I can't take the credit; I learned it from Goober5000.
Title: Re: Using two T16000 and T.A.R.G.E.T. in Diaspora
Post by: z64555 on February 16, 2014, 07:33:41 pm
Rakebuzz to further clarify, I didn't mean for you to put the [code] [/code] tags on your script for T.A.R.G.E.T., just on your posts where you've pasted them.

And no, please don't do another paste with the tags in place, just edit your previous posts.  :rolleyes:
Title: Re: Using two T16000 and T.A.R.G.E.T. in Diaspora
Post by: karajorma on February 16, 2014, 08:19:25 pm
I did the first two posts for you, so you can see what they mean.
Title: Re: Using two T16000 and T.A.R.G.E.T. in Diaspora
Post by: Rakebuzz on February 18, 2014, 10:07:29 am
I am so noobish, lol. I have to look it up in a few hours when I am ready to give it some time. Been busy with other stuff this few days, and just watched some scating in the Olympics. It's raining medals for the Dutch :). Just watched a titan race... again 3 medal :P.

Ahum... back on topic... I also posted this thread on Roberts. (You know...Space Citizen..)
In case anybody there got idea's about my code that gets posted there (and still have to edit it there the way I did here)..here's the post:
Got to give away my secret ID there now, lol..

https://forums.robertsspaceindustries.com/discussion/105534/using-two-t16000-and-t-a-r-g-e-t-in-diaspora#latest

Title: Re: Using two T16000 and T.A.R.G.E.T. in Diaspora
Post by: Rakebuzz on February 18, 2014, 11:39:23 am
arrgg... F1-F12= nonbindable keys the game says!
Got to redo the entire right POV options in code. 8+ of them.
Short of logical options now... I feel two more days of puzzling coming up...:P

Sorry for the dead horse guys... I feel it's still possible, but I need to get into it for a lot of hours again...


and.....done stuff that should solve the F1-9 problem :)


''Never give up....never back down!''  :lol: -commander Taggart
Title: Re: Using two T16000 and T.A.R.G.E.T. in Diaspora
Post by: Rakebuzz on March 29, 2014, 01:54:02 pm
Hello,

Got some (97%) working code now. Sorry it took a while. Lot's of other stuff I had to do at home  :nod:

I still (only) have some POV-issues left, and my C is lacking the knowhow. I posted on several sites, and expect an answer soon (I hope)
Here is one site I swamped with code and question about the POV..
http://cboard.cprogramming.com/game-programming/162353-programming-t-r-g-e-t-uses-c.html

If any C expert(s) want to help out? Please click on the link and read the issue? I am sure there is C-code to solve the POV-issues (I got two, and one of them looks simple if you know your C ),  My C logic is at flaw here... 'almosts' do not work in C, lol..

Maybe I will program the two sliders I haven't done anything with yet too soon. Not sure if they are handy in case I don't get my POV issues resolved. I guess they might ...

I will leave the code on page one here unaltered, because it explaines the following code a lot. Too much work to integrate page-1-stuff in the following. It kinda speaks for itself.

Code: [Select]

include "target.tmh"
include "Macros_test1.ttm"
alias T16001; // second T16000 handle, which will be used all mapping commands

//program startup
int main()
{
if(Init(&EventHandle)) return 1; // declare the event handler, return on error
&T16001 = GetIndexJoy (SelectUsbDevice ("VID_044F&PID_B10A"));

//right one
MapAxis(&T16000, JOYX, DX_X_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
MapAxis(&T16000, JOYY, DX_Y_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
SetCustomCurve(&T16000, JOYY, LIST (0,100, 25,75, 50,50, 75,75, 100,100)); //this little trick lets you use thrusters at both the push and the pull , cause the stick is now programmed to do this if I am correct, lol
KeyAxis(&T16000, JOYY, 0, AXMAP2 (3, USB[0x4B], 0, USB[0x4E])); //PGUP & PGDN
MapAxis(&T16000, RUDDER, DX_Z_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
KeyAxis(&T16000, RUDDER, 0, AXMAP2 (3, USB[0x52], 0, USB[0x51])); //'UARROW',0 , 'DARROW'

//left one
MapAxis(&T16001, JOYX, DX_XROT_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
KeyAxis(&T16001, JOYX, 0, AXMAP2 (3, USB[0x50], 0, USB[0x4F])); //'LARROW', 'RARROW'
MapAxis(&T16001, JOYY, DX_YROT_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
MapAxis(&T16001, RUDDER, DX_ZROT_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);

// everything behind two of these is ignored by the program T.A.R.G.E.T.
//this second (right) POV is not seen at all, need to ask about it to smart people...
//MapKey(&T16000, H1U, Match_Target_Speed);

//MapKey(&T16000, H1R, Toggle_Gliding);

//MapKey(&T16000, H1D, Launch_Countermeasures);

//MapKey(&T16000, H1L, Afterburners);



MapKey(&T16000, TS1, Fire_Primary_Weapon);
MapKey(&T16000, TS2, L_SHIFT);
MapKey(&T16000, TS3, L_ALT);
MapKey(&T16000, TS4, Cycle_Forward_Primary_Weapon);


MapKey(&T16000, B5, Rearm_Me);
MapKey(&T16000, B6, Augment_Forward_Shield);
MapKey(&T16000, B7, Equalize_Energy);

MapKey(&T16000, B10, Disarm_My_Target);
MapKey(&T16000, B9, Attack_My_Target);
MapKey(&T16000, B8, Capture_My_Target);

MapKey(&T16000, B13, Ignore_My_Target);
MapKey(&T16000, B12, Communication_Menu);
MapKey(&T16000, B11, Toggle_Auto_Speed_Matching);

MapKey(&T16000, B14, Engage_the_Enemy);
MapKey(&T16000, B15, Cover_Me);
MapKey(&T16000, B16, Return_To_Base);


MapKey(&T16001, H1U, Center_View);

MapKey(&T16001, H1R, View_Right);

MapKey(&T16001, H1D, View_Rear);

MapKey(&T16001, H1L, View_Left);



MapKey(&T16001, TS1, Fire_Secondary_Weapon);
MapKey(&T16001, TS2, L_SHIFT);
MapKey(&T16001, TS3, Cycle_Secundary_Weapon_Bank);
MapKey(&T16001, TS4, Target_Next_Closest_Hostile_Ship);


MapKey(&T16001, B11, Target_Ship_In_Reticle);
MapKey(&T16001, B12, Target_subsystem_In_Reticle);
MapKey(&T16001, B13, Target_Targets_Nearest_Attacker);

MapKey(&T16001, B16, Toggle_Auto_Targeting);
MapKey(&T16001, B15, Target_Last_Ship_That_Transmitted);
MapKey(&T16001, B14, Target_Next_Live_Turret);

MapKey(&T16001, B7, Target_Next_Ship);
MapKey(&T16001, B6, Decreaee_View_Distance);
MapKey(&T16001, B5, Increase_View_Distance);

MapKey(&T16001, B8, Target_Closest_Friendly_Ship);
MapKey(&T16001, B9, Cycle_Radar_Range);
MapKey(&T16001, B10, Target_Newest_ship_In_Area);



}

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

//add event handling code here
}


and here the Macros_test1.ttm code

Code: [Select]
//T16001 POV, left one
define Center_View '1'
//define View_Up '2'
define View_Right '3'
//define Free_Look '4'
define View_Rear '5'
//define External_View '6'
define View_Left '7'
//define Current_Target_View '8'
//even ones are in-betweens, and not seen as seperates ones yet, but as both ones neighbouring it. asked about it... no reply yet.

define Fire_Secondary_Weapon '9'
define Cycle_Secundary_Weapon_Bank 'm'
define Target_Next_Closest_Hostile_Ship 'r'
define Target_Ship_In_Reticle 'q'
define Target_subsystem_In_Reticle 'w'
define Target_Targets_Nearest_Attacker 'e'
define Toggle_Auto_Targeting 'a'
define Target_Last_Ship_That_Transmitted 's'
define Target_Next_Live_Turret 'd'
define Target_Next_Ship 't'
define Decreaee_View_Distance 'y'
define Increase_View_Distance 'u'
define Target_Closest_Friendly_Ship 'f'
define Cycle_Radar_Range 'g'
define Target_Newest_ship_In_Area 'h'


//this POV not seen at all...
//define Match_Target_Speed KP1
//define Toggle_Gliding KP3
//define Launch_Countermeasures KP5
//define Afterburners KP7

define Fire_Primary_Weapon KP9
define Cycle_Forward_Primary_Weapon '0'

define Rearm_Me 'i'
define Augment_Forward_Shield 'o'
define Equalize_Energy 'p'
define Disarm_My_Target 'z'
define Attack_My_Target 'x'
define Capture_My_Target 'c'
define Ignore_My_Target 'j'
define Communication_Menu 'k'
define Toggle_Auto_Speed_Matching 'l'
define Engage_the_Enemy 'v'
define Cover_Me 'b'
define Return_To_Base 'n'
Title: Re: Using two T16000 and T.A.R.G.E.T. in Diaspora
Post by: jonny5isalivetm on January 06, 2022, 10:53:14 am
Hi
My Wife got me the 2 pack of t16000m joysticks, did you get sorted and working in the end ?
I need a guide to use these sticks

https://www.amazon.co.uk/T-16000M-FCS-Space-Sim-simultaneously/dp/B076J1JBNY/ref=asc_df_B076J1JBNY/?tag=googshopuk-21&linkCode=df0&hvadid=310568533429&hvpos=&hvnetw=g&hvrand=2602104579446770282&hvpone=&hvptwo=&hvqmt=&hvdev=c&hvdvcmdl=&hvlocint=&hvlocphy=1006886&hvtargid=pla-404968855355&psc=1
Title: Re: Using two T16000 and T.A.R.G.E.T. in Diaspora
Post by: Dilmah G on January 07, 2022, 01:17:52 am
Yo, take a look at this (https://www.hard-light.net/forums/index.php?topic=97640.0) thread and a bit of a gander potentially at these (https://www.hard-light.net/forums/index.php?topic=91694.0) too. Personally, I use vJoy to create a virtual joystick and then UCR to actually map the axes/buttons from my real HOTAS/pedal setup to the virtual stick, boot Knossos with the virtual joystick selected, and it works a treat. I only had a skim of this thread, but I daresay that broad method should work for your two joystick setup. Let us know how you go.