GPC Library

Crysis 1 quick stealth/speed/strength/armor using PS4 controller touchpad swipes

I tried some other touchpad swiping scripts and they were flaky, so I made my own very accurate simple version with minimal resources. Not limited to PC or Crysis and haven't tried other Crysis versions. Leds and Timeout are for show with PS4 controller and are optional. Touchpad pushes per 4 quadrants are commented out but ready for your code.

XXXXXXXXXXXXXXXXXX/\XXXX
XXXXXXXXXXXXXXXXX//\\XXX <-this swipe upwards is Combo1 action
XXXXXXXXXXXXXXXX///\\\XX
or
XXXXXXXXXXXXXXXX\\\///XX
XXXXXXXXXXXXXXXXX\\//XXX <-this swipe downwards is Combo2 action
XXXXXXXXXXXXXXXXXX\/XXXX
or
XXXX/\XXXXXXXXXXXXXXXXXX
XXX//\\XXXXXXXXXXXXXXXXX <-this swipe upwards is Combo4 action
XX///\\\XXXXXXXXXXXXXXXX
or
XX\\\///XXXXXXXXXXXXXXXX
XXX\\//XXXXXXXXXXXXXXXXX <-this swipe downwards is Combo3 action
XXXX\/XXXXXXXXXXXXXXXXXX
Version 1.0
Author Lelmus
Publish Date 2014-12-10 23:47:05
Update Date 2015-01-17 00:24:39
Downloads 87
RATE


1

0

Release Notes: Initial release with comments
Code:Select all

int TY = 0; //unsigned
int TYlast = 0;
int TYlastanalog; //unsigned
int TX = 0; //unsigned
int TT = 0; //unsigned
int TTlast = 0;

int Timeout = 0;



init
{
    //reset_leds();
    //turn_off(); //wireless off

    Timeout = 0;

    TY = get_val(PS4_TOUCHY) + 100; //add 100 to get rid of negative range
    TX = get_val(PS4_TOUCHX) + 100; //add 100 to get rid of negative range

    TYlastanalog = TY;
    TX = 0;
    TY = 0;
    TT = 0;
    TYlast = 0;
}



main
{
//27 PS4_TOUCH
//28 PS4_TOUCHX
//29 PS4_TOUCHY

//PS4T_P1 one finger is currently touching
//PS4T_P2 two fingers are currently touching

//+100->200 = bottom most value of Y
//-100->  0 = top most value of Y

//+100->200 = right most value of X
//-100->  0 = left most value of X

    if(Timeout == 0) 
    {
        set_led(LED_1, 0);
        set_led(LED_2, 0);
        set_led(LED_3, 0);
        set_led(LED_4, 0);
        
        Timeout = 1000;
    }
    else
    {
        Timeout = Timeout - 1;
    }

    if(ps4_touchpad(PS4T_P1))
    {
        if(ps4_touchpad(PS4T_P2) == 0) //two fingers are not allowed
        {
            TY = get_val(PS4_TOUCHY) + 100; //add 100 to get rid of negative range
            TX = get_val(PS4_TOUCHX) + 100; //add 100 to get rid of negative range

            if(TX > 100)
                TX = 1; //right zone
            else
                TX = 0; //left zone

            //test for initial touchdown location, and measure for swiping
            if(  ( (TY > (TYlastanalog+1)) && (TY < (TYlastanalog+50)) ) || ( (TY < (TYlastanalog-1)) && (TY > (TYlastanalog-50)) )  )
            {
                //swiping occuring
                TYlastanalog = TY;

                if(TY > 100)
                    TY = 0; //bottom zone
                else
                    TY = 1; //top zone
            }
            else
            {
                //first area touched
                TYlastanalog = TY;

                if(TY > 100)
                    TY = 0; //bottom zone
                else
                    TY = 1; //top zone

                TYlast = TY; //prevent below from acting on it
            }

/*
            //touchpad quadrant pushing actions
            TT = get_val(PS4_TOUCH);

            if(TT == 100)
            {
                TYlast = TY;

                if( (TT != TTlast) && (TY == 0) )
                {
                    if(TX == 0)
                    {
                        //left zone
                        combo_run(Combo0);
                    }
                    else
                    {
                        //right zone
                        combo_run(Combo0);
                    }
                }

                if( (TT != TTlast) && (TY == 1) )
                {
                    if(TX == 0)
                    {
                        //left zone
                        combo_run(Combo0);
                    }
                    else
                    {
                        //right zone
                        combo_run(Combo0);
                    }
                }
            }

            TTlast = TT;
*/

            //touchpad quadrant swiping actions
            if(TY != TYlast)
            {
                TYlast = TY;

                if(TY == 0)
                {
                    if(TX == 0)
                    {
                        //left zone / swip downward
                        combo_run(Combo3); //strength
                    }
                    else
                    {
                        //right zone / swip downward
                        combo_run(Combo2); //normal armor
                    }
                }
                else
                {
                    if(TX == 0)
                    {
                        //left zone / swipe upward
                        combo_run(Combo4); //speed
                    }
                    else
                    {
                        //right zone / swipe upward
                        combo_run(Combo1); //stealth
                    }
                }
            }

        }
    }

}

combo Combo0
{    
    set_rumble(RUMBLE_A, 100); // Vibrate the controller for 1/2 second
    wait(500);
    set_rumble(RUMBLE_A, 0); // Turn the rumble off
}
combo Combo1
{    
    set_led(LED_1, 0);
    set_led(LED_2, 0);
    set_led(LED_3, 0);
    set_led(LED_4, 1);

    set_val(PS4_L2, 100);
    wait(150);

    set_val(PS4_L2, 100);
    set_val(PS4_RX, 75);
    set_val(PS4_RY, 75);
    wait(25);
    
    Timeout = 10; //leds poweroff timeout
}
combo Combo2
{
    set_led(LED_1, 0);
    set_led(LED_2, 1);
    set_led(LED_3, 0);
    set_led(LED_4, 0);

    set_val(PS4_L2, 100);
    wait(150);

    set_val(PS4_L2, 100);
    set_val(PS4_RX, -75);
    set_val(PS4_RY, -75);
    wait(25);

    Timeout = 10; //leds poweroff timeout
}
combo Combo3
{
    set_led(LED_1, 1);
    set_led(LED_2, 0);
    set_led(LED_3, 0);
    set_led(LED_4, 0);

    set_val(PS4_L2, 100);
    wait(150);

    set_val(PS4_L2, 100);
    set_val(PS4_RX, 75);
    set_val(PS4_RY, -75);
    wait(25);

    Timeout = 10; //leds poweroff timeout
}
combo Combo4
{
    set_led(LED_1, 0);
    set_led(LED_2, 0);
    set_led(LED_3, 1);
    set_led(LED_4, 0);

    set_val(PS4_L2, 100);
    wait(150);

    set_val(PS4_L2, 100);
    set_val(PS4_RX, 0);
    set_val(PS4_RY, -100);
    wait(25);

    Timeout = 10; //leds poweroff timeout
}

  • Rating

    10 / 10 here !

    If you own a ps3 and prefer an xbox controller, or even use a keyboard and mouse, this is a must to remap your keyboard to a controller. Go buy it now you won't be disappointed !

  • Rating

    Amazing device

    If you're like me and love your PS4 controller but want to use an Xbox One GET THIS you won't be sorry.

  • Rating

    Worth every penny

    The controller feels and performs as it does on the xbox right there on my ps3, awesome job guys, and worth every penny !!!

  • Rating

    Amazing Macro combos

    tested Super Street Fighter IV Arcade Edition. I was able to perform normal & FADC combos with some characters like Ryu and Ken with a single click. Amazing.

  • Rating

    As good as a XIM

    If you are a pc gamer, that needs a pc solution for console, get yourself a CronusMAX you will not regret it.

  • Rating

    KB & Mouse RULES!

    All I can say playing 10 minutes with CronusMAX properly configured it felt better then PC....YES I said it even better then PC, it's that smooth.

  • Rating

    Six-Axis 360!

    WOW! I can finally get that six-axis awesomeness on my Xbox 360. The best money I ever spent.

  • Rating

    Beats all rapidfire mods

    I've tried the Intensafire, Godfather even the new Wolf controller. The CronusMAX beats them hands down and no wires or soldering too. 5 Stars!

  • Rating

    Just perfect!

    I can't believe how much this can do for the price tag - it blew me away. Best controller upgrade ever.

  • Rating

    Hugh Thanks!

    Without your help I couldn't be playing Xbox, thanks guys.

  • Rating

    Wow!

    I have to say after reading the forums for Destiny Mouse and Keyboard setup I was flying into getting it set up in 20 minutes. It works outstanding! I'm more then satisfied and its worth every penny!

  • Rating

    Achievement Unlocked!

    Idle boosting Complete 150 Multiplayer games, James Cameron's Avatar. My friend said it would be hard, I laughed then linked him.

  • Rating

    A++!

    Now this is a company you can count on and trust...keep up the great work guys!

  • Rating

    What Disability?

    I would like to thank you for making the CronusMax. I have this problem hitting L3 and R3, and today that problem was fixed. I love the remap feature on the Cronus max. You made my life easier.

  • Rating

    Awesome stuff guys!

    Playing Forza 5 with my original MS 360 wireless wheel makes the XB1 complete for me, thanks to the CronusMax. Thumbs up!