Page 1 of 1

multiple assignment - scripting help

PostPosted: Mon Apr 19, 2021 12:49 pm
by LeDoeh
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?

Re: multiple assignment - scripting help

PostPosted: Mon Apr 19, 2021 10:23 pm
by Mad
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);
}

Re: multiple assignment - scripting help

PostPosted: Tue Apr 20, 2021 3:26 pm
by LeDoeh
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?