## function for changing diagonals. help pls

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

### function for changing diagonals. help pls

Hi guys!

I do have the problem, that some games (Destiny 2!!!!) have much faster diagonals than normal x and y axis. I do have a deadzone remove function, that can change between circle and square. But in both cases, the diagonals are faster than normal x and y axis. I would like to have a function that compensates something like this. I know i have to try it out in destiny for the right numbers, but i really don't know how to write a good function for this.

King regards!

manx
Staff Sergeant

Posts: 15
Joined: Sun Sep 29, 2019 4:05 pm

### Re: function for changing diagonals. help pls

Hi, Are you using mouse? If yes you can compensate this behavior by adjusting the Diagonal Dampening parameter (DD Factor).
ConsoleTuner Support Team

J2Kbr
General of the Army

Posts: 19089
Joined: Tue Mar 18, 2014 1:39 pm

### Re: function for changing diagonals. help pls

No I am using a controller. I know that there is an option in the input translator, but i can't you this with the controller.

manx
Staff Sergeant

Posts: 15
Joined: Sun Sep 29, 2019 4:05 pm

### Re: function for changing diagonals. help pls

a x to y relationship isn't the right way I think. maybe with sin oder cos function or to change the deadzone to an other form.

manx
Staff Sergeant

Posts: 15
Joined: Sun Sep 29, 2019 4:05 pm

### Re: function for changing diagonals. help pls

Here is a GPC function to apply diagonal dampening to regular stick inputs (right stick).
Code: Select all
`void DiagonalDampening(fix32 DD) {    static fix32 px, py, rx, ry;    fix32 fx = get_actual(STICK_1_X);    fix32 fy = get_actual(STICK_1_Y);     if(fx != px || fy != py) {        px = fx; py = fy;         fix32 fsx;        if(fx > 0.0) { fsx = 1.0; }        else if(fx < 0.0) { fsx = -1.0; }        else fsx = 0.0;         fix32 fsy;        if(fy > 0.0) { fsy = 1.0; }        else if(fy < 0.0) { fsy = -1.0; }        else fsy = 0.0;         fx = abs(fx);        fy = abs(fy);         fix32 a = atan2(fy, fx);        fix32 cos_a = cos(a);        fix32 sin_a = sin(a);        fix32 dd = 1.0 - ((1.0 - abs(sin_a - cos_a)) * DD);         fx *= dd;        fy *= dd;         rx = clamp(fx, 0.0, 100.0) * fsx;        ry = clamp(fy, 0.0, 100.0) * fsy;    }    set_val(STICK_1_X, rx);    set_val(STICK_1_Y, ry);    return;}`

calling this function with argument 1.0 is the same as not apply any diagonal dampening, values below 1.0 reduces the diagonal sensitivity.
ConsoleTuner Support Team

J2Kbr
General of the Army

Posts: 19089
Joined: Tue Mar 18, 2014 1:39 pm

### Re: function for changing diagonals. help pls

i dont get it to work.
i think i dont know how to call it with argument???
Could you share how to do it?
Greetings

dan_94
Master Sergeant

Posts: 27
Joined: Sat Aug 11, 2018 6:07 am

### Re: function for changing diagonals. help pls

dan_94 wrote:i dont get it to work. i think i dont know how to call it with argument??? Could you share how to do it? Thanks in advance Greetings

Please post the script your tried use this function, so we can help with it. thanks.
ConsoleTuner Support Team

J2Kbr
General of the Army

Posts: 19089
Joined: Tue Mar 18, 2014 1:39 pm