RDR 2

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

Re: RDR 2

Postby J2Kbr » Fri Jan 03, 2020 10:25 am

Version 2.0 fixed:
Code: Select all
//#include <titanone.gph>
// Red Dead Redemption 2 v2.0.0
//                                          *****************************
//                                           * ____     _____    __   __ *
//                                          *|  _  \  |  _  \  |  | |  |*
//                                            *| |_| /  | | |  ) |  | |  |*
//                                          *| |\ \   | |_|  ) |  | |  |*
//                                            *|_| \_|  |_____/  |__| |__|*
//                                            *****************************
 
//--For titan users remove // at line 1
//--Double tap R3 to toggle dead eye on/off
//--Tap R1/RB to toggle off and skid stop (bonding lvl 3)
//--Hold RB/R1 & Tap X/SQUARE for Health Tonic.
//--Hold RB/R1 & Tap Y/TRIANGLE for Dead Eye Tonic.
//--Rapidfire is on by default by shooting just hold button down.
 
define HOME  =  0;
define VIEW  =  1;
define MENU  =  2;
define RB    =  3;
define RT    =  4;
define RS    =  5;
define LB    =  6;
define LT    =  7;
define LS    =  8;
define RX    =  9;
define RY    = 10;
define LX    = 11;
define LY    = 12;
define UP    = 13;
define DOWN  = 14;
define LEFT  = 15;
define RIGHT = 16;
define Y     = 17;
define B     = 18;
define A     = 19;
define X     = 20;
 
//--color
data(0,3,0,0,0,0,0,3,
3,0,3,0, 0,0,3,0, 3,3,3,3);
 
int look = 100;
int aim = 125;
int dead_eye = 150;
int eye_time = 8000; //--dead eye timer (8 secs)
int eye;
int sens_xy;           
int gallop_speed = 300; //-- decrease for faster / increase slower speed
int calm = 10000; //-- delay between L3 press to regen stamina (10 secs)
int onoff,d_tap,i;
int tx_v,ty_v;
 
main {
    //--ads   
    if(get_val(7)) {
        //--dead_eye button pressed
        if(event_press(5)) {
            //--dead eye already active
            if(combo_running(EYE_TIME)) {
                combo_stop(EYE_TIME);
                eye = FALSE;
                //--start dead_eye timer
            }else
            combo_run(EYE_TIME);
        }
        //--dead eye active
        if(eye)
        sens_xy = dead_eye;
        //--ads only
        else
        sens_xy = aim;
        //--not ads
    }else
    sens_xy = look;
 
    //--set sensitivity   
    sensitivity(9,NOT_USE,sens_xy);
    sensitivity(10,NOT_USE,sens_xy);
    //--display active
    set_val(30,sens_xy);
 
    //--double tap R3 on/off
    if(event_press(5) && !d_tap)
    combo_run(D_TAP);
    if(event_press(5) && d_tap)
    onoff = !onoff;
    //--click R1/RB for Skid Stop
    if(event_press(3)) {
        onoff = FALSE;
        combo_run(SKID_STOP);
    }
    if(onoff) {
        combo_run(GALLOP);
        combo_run(CALM);
        combo_run(LEDS);
    }else{
        combo_stop(GALLOP);
        combo_stop(CALM);
        leds(1);
    }
    //--hold RB/R1   
    if(get_val(3)) {
        //--Health X/SQUARE
        if(event_press(20)) { tx_v = -45; ty_v = -100; }
        //--dead eye Y/TRIANGLE
        if(event_press(17)) { tx_v = 45;  ty_v = -100; }
        //--tonic combo         
        if(tx_v || ty_v) combo_run(TONIC);
    }
    //-- RS/R3 click
    if(event_press(5)) combo_run(EAGLE_EYE);
 
    if (get_val(4))  {
        combo_run(R_P);}
}
combo EYE_TIME {
    eye = TRUE;
    wait(eye_time);
    eye = FALSE;
}
combo EAGLE_EYE {
    set_val(8,100);
    set_val(5,100);
    wait(150);
    wait(300);
}
combo GALLOP {
    set_val(19,100);
    wait(100);
    wait(gallop_speed);
}
combo CALM {
    wait(calm);
    set_val(19,100);
    wait(1000); //--long press
}
combo R_P{
    set_val(4,100);
    set_val(4,0);
    set_val(4,100);
    set_val(4,0);
    set_val(4,100);
    set_val(4,0);
    set_val(4,100);
    set_val(4,0);
    set_val(4,100);
    set_val(4,0);
    set_val(4,100);
    set_val(4,0);
    set_val(5,100);
    set_val(5,0);
    set_val(5,100);
    wait (10);
}
combo TONIC {
    set_val(6,100);
    wait(500);
    set_val(6,100);
    set_val(3,100);
    wait(300);
    set_val(6,100);
    set_val(9,tx_v);
    set_val(10,ty_v);
    wait(200);
    set_val(9,tx_v);
    set_val(10,ty_v);
    wait(40);
    tx_v = 0;
    ty_v = 0;
}
combo SKID_STOP {
    set_val(3,100);
    set_val(19,100);
    wait(1000); //--long press
}
combo D_TAP {
    d_tap = TRUE;
    wait(300);
    d_tap = FALSE;
}
combo LEDS {
    set_ledx(-1, 0);   
    wait(gallop_speed);
    leds(0);
    wait(100);
}
function leds(f_color) {
    i = 0;
    while(i <= 3) {
        set_led(i,dbyte((f_color * 4) + i));
        i++;
    }
}
ConsoleTuner Support Team
User avatar
J2Kbr
General of the Army
General of the Army
 
Posts: 20323
Joined: Tue Mar 18, 2014 1:39 pm

Previous

Return to GPC1 Script Programming

Who is online

Users browsing this forum: Google [Bot] and 47 guests