multiple assignment - scripting help

GPC1 script programming for Titan One. Code examples, questions, requests.

multiple assignment - scripting help

Postby LeDoeh » Mon Apr 19, 2021 12:49 pm

hey scripters!

I just got the titan one and was setting it up for my switch.

I wanted to set up buttons to use the analog stick, so it looked like this
remap XB360_A -> SWITCH_LY;
remap XB360_B -> SWITCH_LX;
remap XB360_Y -> SWITCH_LX;
remap XB360_X -> SWITCH_LY;

and to get the other direction I got this

set_val(XB360_A, inv(get_val(XB360_A)));
set_val(XB360_B, inv(get_val(XB360_B)));

but unfortunately I can just map 1 button to 1 axis.. so its whether AB or XY.
Any ideas?
User avatar
LeDoeh
Private First Class
Private First Class
 
Posts: 2
Joined: Mon Apr 19, 2021 12:39 pm

Re: multiple assignment - scripting help

Postby Mad » Mon Apr 19, 2021 10:23 pm

Try this:
Code: Select all
main {
    set_val(XB360_A, 0);
    set_val(XB360_X, 0);
    set_val(XB360_B, 0);
    set_val(XB360_Y, 0);
 
    if(get_val(XB360_A)) set_val(SWITCH_LY, -100);
    if(get_val(XB360_X)) set_val(SWITCH_LY, 100);
    if(get_val(XB360_B)) set_val(SWITCH_LX, -100);
    if(get_val(XB360_Y)) set_val(SWITCH_LX, 100);
}
ConsoleTuner Support Team || Discord || YouTube || Twitter
Mad
Major General
Major General
 
Posts: 3448
Joined: Wed May 22, 2019 5:39 am

Re: multiple assignment - scripting help

Postby LeDoeh » Tue Apr 20, 2021 3:26 pm

Thanks I will try that soon!

I was wondering if I could make a shift modifier - so when holding another button to give the buttons another output!?

so for example using the same buttons for the right stick, when holding down another button..
would be this just another "If" logic combined with event pressed?
User avatar
LeDoeh
Private First Class
Private First Class
 
Posts: 2
Joined: Mon Apr 19, 2021 12:39 pm


Return to GPC1 Script Programming

Who is online

Users browsing this forum: No registered users and 9 guests