Hosted Projects - Standalone > Diaspora Tech Help

Using two T16000 and T.A.R.G.E.T. in Diaspora

(1/5) > >>


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]


--- Code: ---// 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.
--- End code ---

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...

The E:


What is this for, exactly?

Looks like some key mapping/binding? (for two sticks?)

I'm so rusty on my coding.

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)


[0] Message Index

[#] Next page

Go to full version