Input Translator Quest.

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

Input Translator Quest.

Postby Tonton » Tue Jun 15, 2021 11:54 pm

Good night guys, I have a question, within the input translator, we have a normal curve and an alternative curve that is activated when you press a certain key, I would like to know if there is the possibility of using two different buttons to activate the alternative sensitivity curve, because I would like to activate this curve for both the aiming and shooting buttons, for when I use hipfire.
User avatar
Tonton
Staff Sergeant
Staff Sergeant
 
Posts: 15
Joined: Thu May 07, 2020 11:17 am

Re: Input Translator Quest.

Postby Mad » Wed Jun 16, 2021 9:26 pm

Default = Hip
Alternate = ADS (or whatever you set the button to):
ADS.png
ADS.png (17.01 KiB) Viewed 797 times

or you can convert it to GPC code and activate it any way you like:
mxy.png
mxy.png (10.49 KiB) Viewed 798 times

https://www.consoletuner.com/wiki/index ... yconverter
ConsoleTuner Support Team || ConsoleTuner Discord || InputSense Discord (2K / FPS)
Mad
Major General
Major General
 
Posts: 4532
Joined: Wed May 22, 2019 5:39 am

Re: Input Translator Quest.

Postby Tonton » Thu Jun 17, 2021 12:48 am

Got it friend thanks, what I need is exactly that, edit the GIT to use two different keys to activate the alternative sensitivity, when I copy and paste as GPC I only received values ​​probably in hexadecimal, is there any way to convert to program in lines?
User avatar
Tonton
Staff Sergeant
Staff Sergeant
 
Posts: 15
Joined: Thu May 07, 2020 11:17 am

Re: Input Translator Quest.

Postby Tonton » Fri Jun 18, 2021 12:24 am

Basically, I would like to use this curve to move around.

const uint8 mxyc [] = {0xFF, 0x00, 0xC7, 0x01, 0x00, 0x00, 0x21, 0x18, 0x00, 0x18, 0x00, 0x00, 0x00, 0x42, 0x00, 0x1A, 0x25, 0x2A, 0x18, 0x00, 0x , 0x3B, 0x3D, 0x3F, 0x41, 0x42, 0x44, 0x45, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C};




And this is another curve when pressing buttons 5 or 8.

const uint8 mxyc [] = {0xFF, 0x00, 0x42, 0x01, 0x00, 0x00, 0x21, 0x18, 0x00, 0x18, 0x00, 0x00, 0x42, 0x00, 0x1A, 0x25, 0x2A, 0x2F, 0x18, 0x00, 0x , 0x3D, 0x3F, 0x41, 0x42, 0x44, 0x45, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C};
User avatar
Tonton
Staff Sergeant
Staff Sergeant
 
Posts: 15
Joined: Thu May 07, 2020 11:17 am

Re: Input Translator Quest.

Postby Mad » Fri Jun 18, 2021 9:11 pm

Your curves are invalid for me (wont compile) maybe something was left blank?:
0x.png
0x.png (1.59 KiB) Viewed 747 times

Make sure it's valid by saving the input translator and installing to a memory slot.

It would look something like this (you need to change the curves to valid ones):
Code: Select all
const uint8 look_curve[] = {0xFF, 0x00, 0xC7, 0x01, 0x00, 0x00, 0x21, 0x18, 0x00, 0x18, 0x00, 0x00, 0x00, 0x42, 0x00, 0x1A, 0x25, 0x2A, 0x18, 0x00, 0x , 0x3B, 0x3D, 0x3F, 0x41, 0x42, 0x44, 0x45, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C};
 
const uint8 hipads_curve[] = {0xFF, 0x00, 0x42, 0x01, 0x00, 0x00, 0x21, 0x18, 0x00, 0x18, 0x00, 0x00, 0x42, 0x00, 0x1A, 0x25, 0x2A, 0x2F, 0x18, 0x00, 0x , 0x3D, 0x3F, 0x41, 0x42, 0x44, 0x45, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C};
 
bool load_curve;
 
init { mxyconverter(look_curve); }
 
main {
    if(event_active(BUTTON_5) || event_active(BUTTON_8)) {
        load_curve = 0;
        mxyconverter(hipads_curve);
    }
    if(is_release(BUTTON_5) && is_release(BUTTON_8)) {
        if(!load_curve) mxyconverter(look_curve);
        load_curve = 1;
    }
}

Though you may need a delay between loading curves using check_active and check_release

If you cant find the issue attach the .git (input translator) and we can take a look.
ConsoleTuner Support Team || ConsoleTuner Discord || InputSense Discord (2K / FPS)
Mad
Major General
Major General
 
Posts: 4532
Joined: Wed May 22, 2019 5:39 am

Re: Input Translator Quest.

Postby Tonton » Fri Jun 18, 2021 9:23 pm

Thank you very much bro, I will check the possible error in the curve the most important was the script now I will feed it with my curves, the question you commented about the delay would work how?
User avatar
Tonton
Staff Sergeant
Staff Sergeant
 
Posts: 15
Joined: Thu May 07, 2020 11:17 am

Re: Input Translator Quest.

Postby Mad » Fri Jun 18, 2021 9:31 pm

Tonton wrote:Thank you very much bro, I will check the possible error in the curve the most important was the script now I will feed it with my curves, the question you commented about the delay would work how?

No problem. This should do it, you can change the value at the very top:
Code: Select all
#define load_delay 250 // delay before loading curves. 0 is no delay
 
const uint8 look_curve [] = {0xFF, 0x00, 0xC7, 0x01, 0x00, 0x00, 0x21, 0x18, 0x00, 0x18, 0x00, 0x00, 0x00, 0x42, 0x00, 0x1A, 0x25, 0x2A, 0x18, 0x00, 0x , 0x3B, 0x3D, 0x3F, 0x41, 0x42, 0x44, 0x45, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C};
 
const uint8 hipads_curve[] = {0xFF, 0x00, 0x42, 0x01, 0x00, 0x00, 0x21, 0x18, 0x00, 0x18, 0x00, 0x00, 0x42, 0x00, 0x1A, 0x25, 0x2A, 0x2F, 0x18, 0x00, 0x , 0x3D, 0x3F, 0x41, 0x42, 0x44, 0x45, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C};
 
bool load_curve;
 
init { mxyconverter(look_curve); }
 
main {
    if(!load_curve) {
        if(check_active(BUTTON_5, load_delay) || check_active(BUTTON_8, load_delay)) {
            mxyconverter(hipads_curve);
            load_curve = 1;
        }
    }
    else {
        if(check_release(BUTTON_5, load_delay) && check_release(BUTTON_8, load_delay)) {
            mxyconverter(look_curve);
            load_curve = 0;
        }
    }
}
ConsoleTuner Support Team || ConsoleTuner Discord || InputSense Discord (2K / FPS)
Mad
Major General
Major General
 
Posts: 4532
Joined: Wed May 22, 2019 5:39 am

Re: Input Translator Quest.

Postby Tonton » Fri Jun 18, 2021 9:51 pm

Perfect, I ran the test just now, everything worked, again thank you very much.
User avatar
Tonton
Staff Sergeant
Staff Sergeant
 
Posts: 15
Joined: Thu May 07, 2020 11:17 am

Re: Input Translator Quest.

Postby Mad » Sat Jun 19, 2021 12:32 am

Tonton wrote:Perfect, I ran the test just now, everything worked, again thank you very much.

:joia: :joia:
ConsoleTuner Support Team || ConsoleTuner Discord || InputSense Discord (2K / FPS)
Mad
Major General
Major General
 
Posts: 4532
Joined: Wed May 22, 2019 5:39 am


Return to GPC2 Script Programming

Who is online

Users browsing this forum: No registered users and 121 guests