Accessible Script Requests for Disabled Users

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

Re: Accessible Script Requests for Disabled Users

Postby SpecialEffect » Sun Mar 06, 2016 10:09 pm

Just testing.....
User avatar
SpecialEffect
Sergeant Major of the Army
Sergeant Major of the Army
 
Posts: 203
Joined: Mon Apr 07, 2014 3:26 pm

Re: Accessible Script Requests for Disabled Users

Postby SpecialEffect » Sun Mar 06, 2016 10:38 pm

Think I've cracked it with your help and hunting around. Something like this.....

Code: Select all
// colorled(0,0,0,0); // Off / No LED light
// colorled(1,0,0,0); // Dim Blue
// colorled(0,1,0,0); // Dim Red
// colorled(0,0,1,0); // Dim Lime/Green
// colorled(0,0,0,1); // Dim Fuchsia/Pink
// colorled(1,0,1,0); // Dim SkyBlue
// colorled(0,1,1,0); // Dim Yellow
// colorled(1,1,1,1); // Dim White
// colorled(2,0,0,0); // Blue 
// colorled(0,2,0,0); // Red
// colorled(0,0,2,0); // Lime/Green
// colorled(0,0,0,2); // Fuchsia/Pink
// colorled(2,0,2,0); // SkyBlue
// colorled(0,2,2,0); // Yellow
// colorled(2,2,2,2); // White
// colorled(3,0,0,0); // Bright Blue
// colorled(0,3,0,0); // Bright Red
// colorled(0,0,3,0); // Bright Lime/Green
// colorled(0,0,0,3); // Bright Fuchsia/Pink
// colorled(3,0,3,0); // Bright SkyBlue
// colorled(0,3,3,0); // Bright Yellow
// colorled(3,3,3,3); // Bright white
// ColorLed (1) Dim light
// ColorLed (2) Normal/Medium
// ColorLed (3) Bright light

// Colour help via: http://www.consoletuner.com/gpclib/?s=897 and overall script help from Jefferson Kopee

define NORMAL = 0;
define DPAD = 1;
define RIGHTSTICK = 2;

int profile = NORMAL;

main {
    // 1. START needs to be passed through when tapped, but swallowed when held
    // (in anticipation of the joystick or a button being tapped to select a new
    // mode/slot). It would be fantastic to be able to smoothly swap the power
    // of the stick, without the Options menu popping up everytime, which is
    // what currently happens.
    if(get_val(XB360_START)) {
        if(get_val(XB360_LX) <= -30) profile = NORMAL;
        else if(get_val(XB360_LY) <= -30) profile = DPAD;
        else if(get_val (XB360_LX) >= 30) profile = RIGHTSTICK;
        else if(event_press(XB360_A)) {
            load_slot(2); // *** START + A TO CHANGE SLOT TO WHAT EVER SLOT NUMBERED HERE
        }
        set_val(TRACE_1, profile);
        set_val(XB360_START, 0);
    } else if(event_release(XB360_START) && get_ptime(XB360_START) < 300) {
        combo_run(StartTap);
    }
   
    if(profile == NORMAL) {
        colorled(1,0,0,0); // BLUE (Left-stick mode) LED 1
    } else if(profile == DPAD) {
        if(abs(get_val(XB360_LY)) >= 20 || abs(get_val(XB360_LX)) >= 20) {
            if(get_val(XB360_LY) <= -30) set_val(XB360_UP, 100);
            else if(get_val(PS3_LY) >= 30) set_val(XB360_DOWN, 100);
            if(get_val(XB360_LX) <= -30) set_val(XB360_LEFT, 100);
            else if(get_val(PS3_LX) >= 30) set_val(XB360_RIGHT, 100);
            colorled(0,0,0,0); // lED OFF (D-pad mode)
        }
        set_val(XB360_LX, 0);
        set_val(XB360_LY, 0);
    } else if(profile == RIGHTSTICK) {
        swap(XB360_LX, XB360_RX);
        swap(XB360_LY, XB360_RY);
        colorled(0,1,0,0); // RED (Right-stick mode) LED 2
    }
}

combo StartTap {
    set_val(XB360_START, 100);
    wait(80);
}

// COLOR LED INDICATION for PS4 *NO NEED TO EDIT BELOW*
//--------------------------------------------------------------
function colorled(a,b,c,d) {
set_led(LED_1,a);
set_led(LED_2,b);
set_led(LED_3,c);
set_led(LED_4,d);
}



...will test out more and let you know. Thank you so much, so far!
User avatar
SpecialEffect
Sergeant Major of the Army
Sergeant Major of the Army
 
Posts: 203
Joined: Mon Apr 07, 2014 3:26 pm

Re: Accessible Script Requests for Disabled Users

Postby SpecialEffect » Tue Mar 08, 2016 8:39 pm

Got it working beautifully now. Thanks hugely. I'll pop in the repository once I've tidied the code up a little...
User avatar
SpecialEffect
Sergeant Major of the Army
Sergeant Major of the Army
 
Posts: 203
Joined: Mon Apr 07, 2014 3:26 pm

Re: Accessible Script Requests for Disabled Users

Postby J2Kbr » Fri Mar 11, 2016 2:57 pm

Awesome!! :) Thanks for publishing the script in the Online Library.
ConsoleTuner Support Team
User avatar
J2Kbr
General of the Army
General of the Army
 
Posts: 20323
Joined: Tue Mar 18, 2014 1:39 pm

Re: Accessible Script Requests for Disabled Users

Postby SpecialEffect » Tue May 17, 2016 7:34 pm

I've got my dopey head on today, and can't think how to do this....

I'm looking to have one button (e.g. PS3_LS) to alternate acting as one of two different buttons (e.g. PS3_CROSS or PS3_CIRCLE) changing on each new press.

It would be a lot like this: http://www.consoletuner.com/gpclib/?s=998 - where one-button can act as the left-stick left / left-stick right alternately.

I really should be able to work this out by now, but as I say my head is mush today.

Any help would be really appreciated, as I'm trying to get something working for tomorrow to catch the GAAD (Global Accessibility Awareness Day) and it could be useful longer term to add in the "Accessibility" scripts.

Best wishes,

Barrie
User avatar
SpecialEffect
Sergeant Major of the Army
Sergeant Major of the Army
 
Posts: 203
Joined: Mon Apr 07, 2014 3:26 pm

Re: Accessible Script Requests for Disabled Users

Postby The_Rabid_Taco » Tue May 17, 2016 8:31 pm

Please let me know if this is along the lines of what you are looking for. In this example pressing R2 or RT (depending on your system controller) will press Circle / B and then the next press will press Square / X. This will continue to alternate between the two each time it is pressed.

Code: Select all
int SwapButton = FALSE;

main {

    if(event_press(PS4_R2) && SwapButton) {
        set_val(PS4_CIRCLE, 100);
        SwapButton = !SwapButton;
    } else if (event_press(PS4_R2) && !SwapButton) {
        set_val(PS4_SQUARE, 100);
        SwapButton = !SwapButton;
    }
   
    block(PS4_R2, 500);
}
User avatar
The_Rabid_Taco
Major
Major
 
Posts: 1066
Joined: Wed Mar 16, 2016 6:04 pm
Location: Pensacola, FL

Re: Accessible Script Requests for Disabled Users

Postby SpecialEffect » Wed May 18, 2016 11:31 am

Thanks for getting back. It doesn't seem to work. At best I get a brief flash of Circle or Square working whilst I rapidly tap R2.
User avatar
SpecialEffect
Sergeant Major of the Army
Sergeant Major of the Army
 
Posts: 203
Joined: Mon Apr 07, 2014 3:26 pm

Re: Accessible Script Requests for Disabled Users

Postby SpecialEffect » Wed May 18, 2016 11:48 am

I've cracked it now, but huge thanks for your help getting me to think about it a bit more....

Code: Select all

int ButtonSwapper = FALSE; // FALSE = move right; TRUE = move left;

main {
                 
           // Look LEFT/RIGHT (RIGHT-STICK LEFT/RIGHT)
          if (event_press(PS3_L3)) {ButtonSwapper = !ButtonSwapper;} // Toggles between TRUE/FALSE states
          if (get_val(PS3_L3) && ButtonSwapper) {set_val(PS4_CROSS,100);set_val(PS3_L3,0);} // CROSS
          if (get_val(PS3_L3) && !ButtonSwapper) {set_val(PS4_CIRCLE,100);set_val(PS3_L3,0);} // CIRCLE
          }


This takes L3 (an easy thing to connect an accessibility switch to), swallows it, and outputs either a CROSS or CIRCLE.

Cheers, again.

Barrie
User avatar
SpecialEffect
Sergeant Major of the Army
Sergeant Major of the Army
 
Posts: 203
Joined: Mon Apr 07, 2014 3:26 pm

Re: Accessible Script Requests for Disabled Users

Postby SpecialEffect » Wed May 18, 2016 12:53 pm

...running on from the script above, any help with this would help as I'm rubbish with the maths side of scripting....

Button R3 = d-pad up,right,down,left alternating ..... (I'd look to expand this to left-stick up,right,down,left and also a hybrid stick method of left-stick up, right-stick right, left-stick down, right-stick left which I think would work in a FPS / Walking Simulator giving a single switch user the means to explore.

I could write it in BASIC easily. :) Not sure how to script it. Some kind of a counter on each press of R3, converting R3 to one of four actions.

Any help appreciated. :)
User avatar
SpecialEffect
Sergeant Major of the Army
Sergeant Major of the Army
 
Posts: 203
Joined: Mon Apr 07, 2014 3:26 pm

Re: Accessible Script Requests for Disabled Users

Postby The_Rabid_Taco » Wed May 18, 2016 1:28 pm

Well, I'm glad the first one helped you get started. I did take the one that you got working and did a four way counter on it. This can be expanded out easily by changing the counter in the if and else if statements. Let me know if it is along the lines of what you are looking for. If not I'll see if I can't change it a bit to come up with something that works better!

Code: Select all
int ButtonSwapper;
main {
                 
           // Look LEFT/RIGHT (RIGHT-STICK LEFT/RIGHT)
          if (event_press(PS3_L3)) {
            if (ButtonSwapper < 4) {
                ButtonSwapper = ButtonSwapper + 1; // Increment to next choice unless already at last one.
            } else if (ButtonSwapper == 4) {
                ButtonSwapper = 1// When max choice is hit, reset to first.
            }
          }
          if (get_val(PS3_L3) && ButtonSwapper == 1) {set_val(PS3_UP,100);set_val(PS3_L3,0);} // CROSS
          if (get_val(PS3_L3) && ButtonSwapper == 2) {set_val(PS3_RIGHT,100);set_val(PS3_L3,0);} // CIRCLE
          if (get_val(PS3_L3) && ButtonSwapper == 3) {set_val(PS3_DOWN, 100);set_val(PS3_L3,0);} // TRIANGLE
          if (get_val(PS3_L3) && ButtonSwapper == 4) {set_val(PS3_LEFT, 100);set_val(PS3_L3,0);} // SQUARE
}
User avatar
The_Rabid_Taco
Major
Major
 
Posts: 1066
Joined: Wed Mar 16, 2016 6:04 pm
Location: Pensacola, FL

PreviousNext

Return to GPC1 Script Programming

Who is online

Users browsing this forum: No registered users and 55 guests