Splatoon 2 + Titan two

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

Re: Splatoon 2 + Titan two

Postby osbor » Tue Oct 18, 2022 2:52 pm

extremely unlikely, the T1 just does not have the horsepower and only one usb input

i've been messing with the build from the twitter guy, which is a more expansive version of the core script that cheddartime posted above

it feels pretty good, way better than sticks, but it still feels a little strange, like there's some mouse acceleration/smoothing going on, and like its trying to wander a little when doing precise aim on center.
The ya axis sens is different from x as well.
Apparently the performance varies a lot from mouse to mouse even at the same DPI, so tinkering is mandatory. hopefully i can arrive at a good setup eventually.
the thing i appreciate most is the build in turbo subscript though, it makes the squeezer an absolute dream to use
User avatar
osbor
Master Sergeant
Master Sergeant
 
Posts: 41
Joined: Sun Oct 08, 2017 12:19 am

Re: Splatoon 2 + Titan two

Postby alfie65536 » Mon Dec 12, 2022 5:42 pm

Hi all! I've been keeping an eye on this thread for a while in case anyone has found a solution concerning the vertical acceleration. Below, I've included my full script for what I use to combat the acceleration. I've found that the more aggressive you are with the division of the acceleration, it'll snap inwards instead of outwards, such as a typical acceleration would kinda drift in the direction you aimed, if you're too aggressive with the values and in lowering them, the drift will reverse and pull back from your aim location.

I feel like I've found the BEST middle ground for this acceleration since it's not going to go away any time soon. I use a G502 mouse with 1600 DPI.

I have also added quite a few other fun things in here too. I don't use the turbo shooting mode so that's not here.

This includes:

• The holding of the Y button to avoid camera turning
• Left CTRL is slow movement that allows for squid trotting
• H key is to go home
• The booyah button is on an auto turbo to allow spamming of the booyah bomb (It grows your special if you do!)
• T key allows the reset of the Y button since the acceleration drift sometimes needs to be reset and I don't like trying to determine if the camera turning is active or not.
• P key (which is assigned to G4 on the G502) allows for sub strafing

I love this game and this community and bought the Titan Two to be a part of it. I hope this helps if someone is like me and just wants to get into it without worrying too much about how to code.

Enjoy!!! :smile0517:

Code: Select all
#pragma METAINFO("Splatoon", 1, 70, "Edited by: alfie65536, Originally Created by: nspl")
 
 
#include <switch.gph>
#include <mouse.gph>
#include <keyboard.gph>
 
#define MAXGX 25.0
#define DEFAULT_MMY 0.0
#define MAXR 212.5
 
fix32 mmy;
bool y_toggle = FALSE;
bool e_toggle = FALSE;
// GIVMXYF:FF0014008000000002000200FC00050A0F14191E23282D32373C41464B50555A5F64
const uint8 kmap[] = { 0xE3, 0x00, 0x29, 0x0F, 0x3A, 0x0D, 0x15, 0x10, 0x3C, 0x02, 0x28, 0x0E, 0x52, 0x09, 0x51, 0x0A, 0x50, 0x0B, 0x4F, 0x0C, 0x1A, 0x98, 0x04, 0x97, 0x16, 0x18, 0x07, 0x17, 0x2C, 0x0F, 0x14, 0x06, 0x08, 0x03, 0x09, 0x05, 0xE1, 0x07, 0x2B, 0x0D, 0x3D, 0x01, 0x35, 0x08, 0x45, 0x11 };
const uint8 mmap[] = { 0x04, 0x04, 0x05, 0x07, 0x06, 0x03, 0x00, 0x15, 0x01, 0x16 };
const uint8 mxyc[] = { 0xFF, 0x00, 0x14, 0x00, 0x80, 0x00, 0x00, 0x00, 0x02, 0x00, 0x02, 0x00, 0xFC, 0x00, 0x05, 0x0A, 0x0F, 0x14, 0x19, 0x1E, 0x23, 0x28, 0x2D, 0x32, 0x37, 0x3C, 0x41, 0x46, 0x4B, 0x50, 0x55, 0x5A, 0x5F, 0x64 };
 
init {
    keymapping(kmap);
    mousemapping(mmap);
    mxyconverter(mxyc);
    mmy = DEFAULT_MMY;
}
 
 
main {
    set_val(SWITCH_ACCZ,0.0 );
    set_val(SWITCH_ACCY,0.0 );
    set_val(SWITCH_GYROZ, 0.0 );
    set_val(SWITCH_GYROY, 0.0 );
    set_val(SWITCH_GYROX, 0.0 );
    set_val(SWITCH_ACCX, 0.0);
    gyro_aim();
}
 
combo home {
    set_val(SWITCH_X, 100.0);
    //wait(50);
    set_val(SWITCH_DOWN, 100.0);
    //wait(50);
    set_val(SWITCH_A, 100.0);
    //wait(50);
}
 
combo booya {
    set_val(SWITCH_DOWN, 100.0);
    wait(70);
    set_val(SWITCH_DOWN, 0.0);
    wait(70);
}
 
combo cam_reset {
    set_val(SWITCH_Y, 100.0);
    wait(70);
    set_val(SWITCH_Y, 0.0);
    wait(70);
}
 
combo quickswim_thr {
    set_val(SWITCH_ZL, 0.0);
    set_val(SWITCH_R, 100.0);
    wait(500);
}
 
combo quickswim_swm {
    wait(50);
    set_val(SWITCH_ZL, 100.0);
    wait(500);
}
 
void gyro_aim(){
    if(event_active(SWITCH_Y)) {
        y_toggle = !y_toggle;
        mmy = DEFAULT_MMY;
    }
    if(y_toggle) {
        set_val(SWITCH_Y, 100.0);
    }
 
    if(key_status(KEY_LEFTCONTROL)) {
        if(get_val(SWITCH_LX) && get_val(SWITCH_LY)) {
            set_val(SWITCH_LX, clamp(get_val(SWITCH_LX), -57.0, 57.0));
            set_val(SWITCH_LY, clamp(get_val(SWITCH_LY), -57.0, 57.0));
        }
        else {
            set_val(SWITCH_LX, clamp(get_val(SWITCH_LX), -83.0, 83.0));
            set_val(SWITCH_LY, clamp(get_val(SWITCH_LY), -83.0, 83.0));
        }
    }
    else {
        set_val(SWITCH_LX, clamp(get_val(SWITCH_LX), -100.0, 100.0));
        set_val(SWITCH_LY, clamp(get_val(SWITCH_LY), -100.0, 100.0));
    }
 
    if(key_status(KEY_H)) {
        combo_run(home);
    }
 
    if(get_val(SWITCH_DOWN)) {
        combo_run(booya);
    }
 
    if(key_status(KEY_T)) {
        mmy = DEFAULT_MMY;
        combo_run(cam_reset);
    }
 
    if(key_status(KEY_P) && e_toggle == FALSE) {
        combo_run(quickswim_thr);
        combo_run(quickswim_swm);
        e_toggle = TRUE;
    }
    else if(key_status(KEY_P) && e_toggle == TRUE) {
        set_val(SWITCH_ZL, 100.0);
    }
    else if(!key_status(KEY_P)) {
        e_toggle = FALSE;
    }
 
    fix32 my = rad2deg(get_val(SWITCH_RY) / 840.0 * PI) / MAXGX;
    mmy = clamp( mmy + my , -MAXGX , MAXGX );
    set_val(SWITCH_ACCY, mmy );
    if( abs(mmy) != MAXGX ){
        fix32 mybak = rad2deg(get_val(SWITCH_RY) / 440.0 * PI) / (MAXGX - 4.2);
        set_val(SWITCH_GYROX, mybak * MAXR );
        //set_val(SWITCH_GYROX, my * MAXR );
    }
    else {
        set_val(GYRO_1_X,0.0);
    }   
 
    set_val(SWITCH_ACCZ, abs(get_val(SWITCH_ACCY)) - 25.0  );
    fix32 gyroz = rad2deg(get_val(SWITCH_RX) / 240.0 * PI) / 45.0 * MAXR;
    set_val(SWITCH_GYROZ, gyroz * -get_val(SWITCH_ACCZ) / 25.0 );
    set_val(SWITCH_GYROY, gyroz * -get_val(SWITCH_ACCY) / 25.0 );
    set_val(SWITCH_ACCX, 0.0 );
    set_val(SWITCH_RY, 0.0);
    set_val(SWITCH_RX, 0.0);
 
}
User avatar
alfie65536
Private
Private
 
Posts: 1
Joined: Thu Oct 27, 2022 10:11 pm

Re: Splatoon 2 + Titan two

Postby wayneradiotv » Sun Jan 08, 2023 4:34 am

alfie65536 wrote:Hi all! I've been keeping an eye on this thread for a while in case anyone has found a solution concerning the vertical acceleration. Below, I've included my full script for what I use to combat the acceleration. I've found that the more aggressive you are with the division of the acceleration, it'll snap inwards instead of outwards, such as a typical acceleration would kinda drift in the direction you aimed, if you're too aggressive with the values and in lowering them, the drift will reverse and pull back from your aim location.

I feel like I've found the BEST middle ground for this acceleration since it's not going to go away any time soon. I use a G502 mouse with 1600 DPI.

I have also added quite a few other fun things in here too. I don't use the turbo shooting mode so that's not here.

This includes:

• The holding of the Y button to avoid camera turning
• Left CTRL is slow movement that allows for squid trotting
• H key is to go home
• The booyah button is on an auto turbo to allow spamming of the booyah bomb (It grows your special if you do!)
• T key allows the reset of the Y button since the acceleration drift sometimes needs to be reset and I don't like trying to determine if the camera turning is active or not.
• P key (which is assigned to G4 on the G502) allows for sub strafing

I love this game and this community and bought the Titan Two to be a part of it. I hope this helps if someone is like me and just wants to get into it without worrying too much about how to code.

Enjoy!!! :smile0517:

Code: Select all
#pragma METAINFO("Splatoon", 1, 70, "Edited by: alfie65536, Originally Created by: nspl")
 
 
#include <switch.gph>
#include <mouse.gph>
#include <keyboard.gph>
 
#define MAXGX 25.0
#define DEFAULT_MMY 0.0
#define MAXR 212.5
 
fix32 mmy;
bool y_toggle = FALSE;
bool e_toggle = FALSE;
// GIVMXYF:FF0014008000000002000200FC00050A0F14191E23282D32373C41464B50555A5F64
const uint8 kmap[] = { 0xE3, 0x00, 0x29, 0x0F, 0x3A, 0x0D, 0x15, 0x10, 0x3C, 0x02, 0x28, 0x0E, 0x52, 0x09, 0x51, 0x0A, 0x50, 0x0B, 0x4F, 0x0C, 0x1A, 0x98, 0x04, 0x97, 0x16, 0x18, 0x07, 0x17, 0x2C, 0x0F, 0x14, 0x06, 0x08, 0x03, 0x09, 0x05, 0xE1, 0x07, 0x2B, 0x0D, 0x3D, 0x01, 0x35, 0x08, 0x45, 0x11 };
const uint8 mmap[] = { 0x04, 0x04, 0x05, 0x07, 0x06, 0x03, 0x00, 0x15, 0x01, 0x16 };
const uint8 mxyc[] = { 0xFF, 0x00, 0x14, 0x00, 0x80, 0x00, 0x00, 0x00, 0x02, 0x00, 0x02, 0x00, 0xFC, 0x00, 0x05, 0x0A, 0x0F, 0x14, 0x19, 0x1E, 0x23, 0x28, 0x2D, 0x32, 0x37, 0x3C, 0x41, 0x46, 0x4B, 0x50, 0x55, 0x5A, 0x5F, 0x64 };
 
init {
    keymapping(kmap);
    mousemapping(mmap);
    mxyconverter(mxyc);
    mmy = DEFAULT_MMY;
}
 
 
main {
    set_val(SWITCH_ACCZ,0.0 );
    set_val(SWITCH_ACCY,0.0 );
    set_val(SWITCH_GYROZ, 0.0 );
    set_val(SWITCH_GYROY, 0.0 );
    set_val(SWITCH_GYROX, 0.0 );
    set_val(SWITCH_ACCX, 0.0);
    gyro_aim();
}
 
combo home {
    set_val(SWITCH_X, 100.0);
    //wait(50);
    set_val(SWITCH_DOWN, 100.0);
    //wait(50);
    set_val(SWITCH_A, 100.0);
    //wait(50);
}
 
combo booya {
    set_val(SWITCH_DOWN, 100.0);
    wait(70);
    set_val(SWITCH_DOWN, 0.0);
    wait(70);
}
 
combo cam_reset {
    set_val(SWITCH_Y, 100.0);
    wait(70);
    set_val(SWITCH_Y, 0.0);
    wait(70);
}
 
combo quickswim_thr {
    set_val(SWITCH_ZL, 0.0);
    set_val(SWITCH_R, 100.0);
    wait(500);
}
 
combo quickswim_swm {
    wait(50);
    set_val(SWITCH_ZL, 100.0);
    wait(500);
}
 
void gyro_aim(){
    if(event_active(SWITCH_Y)) {
        y_toggle = !y_toggle;
        mmy = DEFAULT_MMY;
    }
    if(y_toggle) {
        set_val(SWITCH_Y, 100.0);
    }
 
    if(key_status(KEY_LEFTCONTROL)) {
        if(get_val(SWITCH_LX) && get_val(SWITCH_LY)) {
            set_val(SWITCH_LX, clamp(get_val(SWITCH_LX), -57.0, 57.0));
            set_val(SWITCH_LY, clamp(get_val(SWITCH_LY), -57.0, 57.0));
        }
        else {
            set_val(SWITCH_LX, clamp(get_val(SWITCH_LX), -83.0, 83.0));
            set_val(SWITCH_LY, clamp(get_val(SWITCH_LY), -83.0, 83.0));
        }
    }
    else {
        set_val(SWITCH_LX, clamp(get_val(SWITCH_LX), -100.0, 100.0));
        set_val(SWITCH_LY, clamp(get_val(SWITCH_LY), -100.0, 100.0));
    }
 
    if(key_status(KEY_H)) {
        combo_run(home);
    }
 
    if(get_val(SWITCH_DOWN)) {
        combo_run(booya);
    }
 
    if(key_status(KEY_T)) {
        mmy = DEFAULT_MMY;
        combo_run(cam_reset);
    }
 
    if(key_status(KEY_P) && e_toggle == FALSE) {
        combo_run(quickswim_thr);
        combo_run(quickswim_swm);
        e_toggle = TRUE;
    }
    else if(key_status(KEY_P) && e_toggle == TRUE) {
        set_val(SWITCH_ZL, 100.0);
    }
    else if(!key_status(KEY_P)) {
        e_toggle = FALSE;
    }
 
    fix32 my = rad2deg(get_val(SWITCH_RY) / 840.0 * PI) / MAXGX;
    mmy = clamp( mmy + my , -MAXGX , MAXGX );
    set_val(SWITCH_ACCY, mmy );
    if( abs(mmy) != MAXGX ){
        fix32 mybak = rad2deg(get_val(SWITCH_RY) / 440.0 * PI) / (MAXGX - 4.2);
        set_val(SWITCH_GYROX, mybak * MAXR );
        //set_val(SWITCH_GYROX, my * MAXR );
    }
    else {
        set_val(GYRO_1_X,0.0);
    }   
 
    set_val(SWITCH_ACCZ, abs(get_val(SWITCH_ACCY)) - 25.0  );
    fix32 gyroz = rad2deg(get_val(SWITCH_RX) / 240.0 * PI) / 45.0 * MAXR;
    set_val(SWITCH_GYROZ, gyroz * -get_val(SWITCH_ACCZ) / 25.0 );
    set_val(SWITCH_GYROY, gyroz * -get_val(SWITCH_ACCY) / 25.0 );
    set_val(SWITCH_ACCX, 0.0 );
    set_val(SWITCH_RY, 0.0);
    set_val(SWITCH_RX, 0.0);
 
}



Hey, I'm using your code: it rocks. Vertical movement feels great and in general, the gyro translation feels a lot more natural. I am having some issues though. I figured out how you mapped the buttons, but I can't seem to change inputs you bound to keyboard buttons to be done via the mouse. For instance, I'd like to bind Booyah to mouse wheel down rather than arrow key down. I was able to rebind some buttons (R, L, and A) to other keys that I preferred but I'm stumped trying to get the mouse to do anything but shoot and swim. I want to open up the middle mouse for a rapid primary fire combo, and move your substrafe hotkey to Mouse4. not sure why its on P in the first place lol... but otherwise. AMAZING job!
User avatar
wayneradiotv
Private First Class
Private First Class
 
Posts: 2
Joined: Sat Nov 12, 2022 5:32 am

Re: Splatoon 2 + Titan two

Postby Pooper » Fri Jan 13, 2023 11:16 pm

Is there any way at all to change the mouse/gyro sensitivity in these scripts??? It's working perfectly other than my mouse sensitivity and i have it set to like 1800 dpi. I've tried changing a bunch of values in the script but nothings working, the sensitivity is still insanely slow (i've tried this with multiple mouses it still doesn't work)
User avatar
Pooper
Private
Private
 
Posts: 1
Joined: Fri Jan 13, 2023 11:08 pm

Re: Splatoon 2 + Titan two

Postby ricely » Wed Apr 05, 2023 12:38 pm

Pooper wrote:Is there any way at all to change the mouse/gyro sensitivity in these scripts??? It's working perfectly other than my mouse sensitivity and i have it set to like 1800 dpi. I've tried changing a bunch of values in the script but nothings working, the sensitivity is still insanely slow (i've tried this with multiple mouses it still doesn't work)
by Pooper » Fri Jan 13, 2023 11:16 pm


I managed to work this out. The trick is modifying the mxyc[]. To do this, copy the "GIVMXYF:..." code and go to input translator > Mouse XY Converter and "Paste Config" button. Tweak sens/x:y ratio to your liking, and hold Alt + click the "Copy Config" button (next to paste). That should give you a new mxyc[] (const uint8 mxyc....) in your clipboard. Paste into GPC Script, load and enjoy!
User avatar
ricely
Private
Private
 
Posts: 1
Joined: Wed Apr 05, 2023 12:30 pm

Re: Splatoon 2 + Titan two

Postby XxpomeoxX » Fri Sep 15, 2023 3:25 pm

Hello, could you tell me about your experience playing splatoon with keyboard and mouse? it's worth it? Since I saw Bocian's video https://www.youtube.com/watch?v=h-j140DV7Sk&t=4s I always wanted to try the mouse and keyboard in Splatoon. There is currently titan two for sale on amazon, but I would like to be sure before purchasing. thank you
User avatar
XxpomeoxX
Private First Class
Private First Class
 
Posts: 2
Joined: Sun Sep 10, 2023 3:49 pm

Previous

Return to GPC2 Script Programming

Who is online

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

cron