Can't find how to hold left stick x down in Nintendo Switch.

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

Can't find how to hold left stick x down in Nintendo Switch.

Postby Endless » Sun Sep 20, 2020 6:27 am

Code: Select all
#pragma METAINFO("grind1", 1, 0, "<author_name>")
#include <titanone.gph>
 
int onoff = FALSE;
 
main {
    if(event_press(BUTTON_7)) {
        onoff = !onoff;
    }
 
    if(onoff) {
        combo_run(FF7);
        combo_run(FF72);
    }
}
 
combo FF7 {   
    set_val(STICK_2_X,-100);
    wait(100);
    wait(10);
}
 
 
combo FF72 {   
    set_val(SWITCH_A,100);
    wait(100);
    wait(10);
}


This is what I got. I can get it to do SWITCH_RIGHT but I need the stick and not the right button. Anyone know what to do to hold down the switch's left analog stick?
User avatar
Endless
Master Sergeant
Master Sergeant
 
Posts: 38
Joined: Thu May 02, 2019 1:06 am

Re: Can't find how to hold left stick x down in Nintendo Swi

Postby Mad » Sun Sep 20, 2020 8:41 am

So left stick right?

change:
Code: Select all
set_val(STICK_2_X,-100);
to:
Code: Select all
set_val(STICK_2_X,100);

if you want it held down the entire time the toggle is on just put it inside onoff instead of a combo.
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: Can't find how to hold left stick x down in Nintendo Swi

Postby Endless » Sun Sep 20, 2020 10:02 am

@Mad
For some reason this is not pressing the left stick. Under device monitor it says it is pressing Accel_1_z. I have the code for the previous version of the Titan. What is the TitanOne left stick command?

Code: Select all
#include <titanone.gph>
 
int onoff = FALSE;
 
main {
    if(event_press(BUTTON_7)) {
        onoff = !onoff;
    }
 
    if(onoff) {
        set_val(STICK_2_X,-100);
        combo_run(FF72);
    }
}
 
 
combo FF72 {   
    set_val(SWITCH_A,100);
    wait(100);
    wait(10);
}


https://pasteboard.co/JrWxcB5.jpg

Please take a look at the image and attempt to compile this. If it is the same for both of us then it is a bug.
User avatar
Endless
Master Sergeant
Master Sergeant
 
Posts: 38
Joined: Thu May 02, 2019 1:06 am

Re: Can't find how to hold left stick x down in Nintendo Swi

Postby Scachi » Sun Sep 20, 2020 5:15 pm

please try this if it works correctly:
Code: Select all
#include <switch.gph>
 
int onoff = FALSE;
 
main {
    if(event_active(BUTTON_7)) {
        onoff = !onoff;
    }
 
    if(onoff) {
        set_val(STICK_2_X,-100);
        combo_run(FF72);
    }
}
 
 
combo FF72 {   
    set_val(SWITCH_A,100);
    wait(100);
    wait(10);
}
User avatar
Scachi
Brigadier General
Brigadier General
 
Posts: 3044
Joined: Wed May 11, 2016 6:25 am
Location: Germany

Re: Can't find how to hold left stick x down in Nintendo Swi

Postby Endless » Sun Sep 20, 2020 7:14 pm

I have no idea what you changed but it works perfectly. Thanks so much!

Oh, I just did a comparison and it was including the switch.ghp. That's great.
User avatar
Endless
Master Sergeant
Master Sergeant
 
Posts: 38
Joined: Thu May 02, 2019 1:06 am

Re: Can't find how to hold left stick x down in Nintendo Swi

Postby Scachi » Mon Sep 21, 2020 9:29 am

Endless wrote:I have no idea what you changed but it works perfectly. Thanks so much!

Oh, I just did a comparison and it was including the switch.ghp. That's great.

I did remove the titanone.gph and added the switch.gph instead and changed event_press to event_active to use gpc2 code only.

mixing t1 and T2 code using the titanone.gph header tends to mess up the output controls, resulting in being different buttons/sticks pressed then you want to.
User avatar
Scachi
Brigadier General
Brigadier General
 
Posts: 3044
Joined: Wed May 11, 2016 6:25 am
Location: Germany


Return to GPC2 Script Programming

Who is online

Users browsing this forum: No registered users and 79 guests