Multiple controller remaps

GPC2 script programming for Titan Two. Code examples, questions, requests.

Multiple controller remaps

Postby pointon242 » Sun Jan 13, 2019 10:07 pm

Received my titan 2 today to play elite dangerous on my xbox one with a thrustmaster flight stick and throttle setup.
The problem that i'm having is that when i am trying to set 2 separate controller remaps up in a script it ignores the first one and only uses the second.
Could you tell me where i'm going wrong please, thanks
Code: Select all
#include<remapper.gph>
 
const uint8 EliteThrottle[39] = {
    RMP_USB_D,
    BUTTON_1BUTTON_2BUTTON_3BUTTON_4, BUTTON_5, BUTTON_6, BUTTON_7,
    BUTTON_8BUTTON_9BUTTON_10, BUTTON_11, BUTTON_12, BUTTON_13, BUTTON_14,
    BUTTON_15, BUTTON_16, BUTTON_17BUTTON_18, BUTTON_19, BUTTON_20, BUTTON_21,
    STICK_2_Y, STICK_1_Y, STICK_2_X, STICK_1_X,
    POINT_1_X, POINT_1_Y, BUTTON_5, BUTTON_8,
    ACCEL_1_X, ACCEL_1_Y, ACCEL_1_Z, ACCEL_2_X, ACCEL_2_Y, ACCEL_2_Z,
    GYRO_1_XGYRO_1_YGYRO_1_Z
};
 
const uint8 EliteStick[39] = {
    RMP_USB_A,
    BUTTON_1BUTTON_2BUTTON_3BUTTON_4, BUTTON_17, BUTTON_6BUTTON_7,
    BUTTON_8BUTTON_9BUTTON_10, BUTTON_11, BUTTON_12, BUTTON_13, BUTTON_14,
    BUTTON_15, BUTTON_16, BUTTON_5BUTTON_18, BUTTON_19, BUTTON_20, BUTTON_21,
    STICK_2_X, STICK_2_Y, STICK_1_X, STICK_1_Y,
    POINT_1_X, POINT_1_Y, POINT_2_X, POINT_2_Y,
    ACCEL_1_X, ACCEL_1_Y, ACCEL_1_Z, ACCEL_2_X, ACCEL_2_Y, ACCEL_2_Z,
    GYRO_1_XGYRO_1_YGYRO_1_Z
};
 
init {
    remapper(EliteThrottle);
    remapper(EliteStick);
}
User avatar
pointon242
Sergeant
Sergeant
 
Posts: 9
Joined: Tue Jan 08, 2019 6:36 pm

Re: Multiple controller remaps

Postby J2Kbr » Tue Jan 15, 2019 10:42 pm

In the script you posted there are two input translator, this will not work. what you need to do is for one of the flight stick use the default mapping, the for the second a custom mapping. In the link below you can find a very good tutorial on how to configure double flight sticks with the Titan Two:

https://drive.google.com/file/d/11XIBfv ... MLGmu/view
ConsoleTuner Support Team
User avatar
J2Kbr
General of the Army
General of the Army
 
Posts: 20323
Joined: Tue Mar 18, 2014 1:39 pm

Re: Multiple controller remaps

Postby pointon242 » Tue Jan 15, 2019 11:23 pm

Thanks for taking the time to reply. Unfortunately i'm not using twin sticks, only a stick and throttle.
I was unaware that you couldnt individually remap each usb input, the problem i face here then is that the default maps for the stick and throttle units are way off. For example the throttle is bound to the x axis of the right hand anologue stick on the xbox controller instead of y axis of the left analogue stick and the pitch and roll of the flight stick is bound to the left hand xbox analogue stick instead of the right hand one that the games require. Is there any way i can alter the default mappings by any chance?
User avatar
pointon242
Sergeant
Sergeant
 
Posts: 9
Joined: Tue Jan 08, 2019 6:36 pm

Re: Multiple controller remaps

Postby J2Kbr » Wed Jan 16, 2019 8:23 am

pointon242 wrote:Is there any way i can alter the default mappings by any chance?

Possible yes. First, for the device you will apply the custom Input Translator, make sure the mappings will not overlap with the inputs from the device that is using the default mapping (you can use any GPC input this this purpose, ACCEL, GYRO, etc). If this is possible (which mostly like it will be), then you can code a script to perform any adjustments needed by manually copy the input values for the desired output. :smile0517:
ConsoleTuner Support Team
User avatar
J2Kbr
General of the Army
General of the Army
 
Posts: 20323
Joined: Tue Mar 18, 2014 1:39 pm

Re: Multiple controller remaps

Postby pointon242 » Wed Jan 16, 2019 1:05 pm

Thats brilliant, i greatly appreciate you taking the time to help me out here. I'll have another go tonight and let you know how i get on.
On the topic of inputs i have a strange problem i was wondering if you could help with, when the throttle is plugged into the titan and i am in gtuner it has a constant input of 100 for button 5 and 8 which is the xbox triggers. Have you come across anything like this before?
User avatar
pointon242
Sergeant
Sergeant
 
Posts: 9
Joined: Tue Jan 08, 2019 6:36 pm

Re: Multiple controller remaps

Postby Scachi » Wed Jan 16, 2019 1:36 pm

Does moving your throttles or switches on your throttle device change the value of button 5 and 8 ?
If nothing it changing the value you can try to use a script and set those values to zero in the init { } section of that script to check if it stays at zero then.
Code: Select all
 
init {
  set_val(BUTTON_5,0);
  set_val(BUTTON_8,0);
}
 

What does the value read when you have a controller with those buttons connected at the same time with your throttle to a different input of your T2 ?

I had that issue too with my own input device: viewtopic.php?f=27&t=6676&hilit=snap+on&start=10#p55960
I had to adjust my software program to initiate all buttons and axes that are not physically connected to their zero value, or disable those. For axes/throttles that could be the middle value of its valid range.

Maybe this can be done in your case with a hid file J2kbr might be able to create .. no idea if this is really possible.
User avatar
Scachi
Brigadier General
Brigadier General
 
Posts: 3044
Joined: Wed May 11, 2016 6:25 am
Location: Germany

Re: Multiple controller remaps

Postby pointon242 » Wed Jan 16, 2019 5:18 pm

Does that script just reset the values to zero rather than disabling them?
I've tried all the buttons and moving the throttle and it makes no difference, for some strange reason it believes that something is calling those 2 values once connected to the titan. If i have an xbox controller connected alongside it does the same thing.
User avatar
pointon242
Sergeant
Sergeant
 
Posts: 9
Joined: Tue Jan 08, 2019 6:36 pm

Re: Multiple controller remaps

Postby Scachi » Wed Jan 16, 2019 6:22 pm

pointon242 wrote:Does that script just reset the values to zero rather than disabling them?
I've tried all the buttons and moving the throttle and it makes no difference, for some strange reason it believes that something is calling those 2 values once connected to the titan. If i have an xbox controller connected alongside it does the same thing.

Yes, the script sets them to zero, but only once on start.
But this won't fix your issue when the controller sends the same value again and again.
You can try to fetch the descriptors and post them, maybe j2kbr gets an idea what is going on.
Here is a post on how to fetch them: viewtopic.php?f=27&t=11266&p=77271&hilit=fetch+descriptor#p77190
User avatar
Scachi
Brigadier General
Brigadier General
 
Posts: 3044
Joined: Wed May 11, 2016 6:25 am
Location: Germany

Re: Multiple controller remaps

Postby pointon242 » Thu Jan 17, 2019 7:55 am

[USB DESCRIPTOR]
12 01 10 01 00 00 00 40 4F 04 87 B6 10 01 01 02 00 01 09 02 22 00 01 01 02 80 32 09 04 00 00 01 03 00 00 02 09 21 11 01 00 01 22 76 00 07 05 81 03 40 00 05

[STRING 1 DESCRIPTOR]
00 00 00 01 00 00 02 01 80 06 03 01 04 09 00 1A
1A 03 54 00 68 00 72 00 75 00 73 00 74 00 6D 00 61 00 73 00 74 00 65 00 72 00

[STRING 2 DESCRIPTOR]
00 00 00 01 00 00 02 01 80 06 03 02 04 09 00 1C
1C 03 54 00 57 00 43 00 53 00 20 00 54 00 68 00 72 00 6F 00 74 00 74 00 6C 00 65 00

[INTERFACE 0 HID DESCRIPTOR]
00 00 00 01 00 00 02 01 81 06 22 00 00 00 00 76
05 01 09 04 A1 01 85 01 09 30 09 31 09 35 09 33 09 34 09 36 09 37 15 00 26 FF 03 75 10 95 07 81 02 09 32 15 00 27 FF FF 00 00 75 10 95 01 81 02 09 39 15 00 25 07 35 00 46 3B 01 65 14 75 04 95 01 81 42 65 00 05 09 19 01 29 0E 15 00 25 01 75 01 95 0E 81 02 75 06 95 01 81 01 06 00 FF 09 21 75 08 95 2C 81 02 06 F0 FF 09 40 85 F1 09 47 75 08 95 3F B1 02 C0


Hopefully this helps, even if i swap button 5 and 8 to another input i have the same problem, it still inputs 100.0 even though there is no button or axis calling for it. This is causing a bit of trouble as i dont want to disable them as inputs as i need as many inputs as possible free to bind various buttons from the flight stick and throttle to.
User avatar
pointon242
Sergeant
Sergeant
 
Posts: 9
Joined: Tue Jan 08, 2019 6:36 pm

Re: Multiple controller remaps

Postby J2Kbr » Thu Jan 17, 2019 9:54 am

@pointon242. Do you have Micro SD card in your Titan Two? The descriptors you posted are from TWCS Throttle and already supported by the Titan Two. It has a dedicated HID configuration file that must be stored in the sd card. With the sd card inserted on the Titan Two go to Device Configuration panel (Gtuner IV) and click on the button "Configure". after this procedure plug the TWCS Throttle. :smile0517:
ConsoleTuner Support Team
User avatar
J2Kbr
General of the Army
General of the Army
 
Posts: 20323
Joined: Tue Mar 18, 2014 1:39 pm

Next

Return to GPC2 Script Programming

Who is online

Users browsing this forum: Google [Bot] and 92 guests