Please Help convert for Titan One

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

Please Help convert for Titan One

Postby sebascu » Sat Oct 19, 2019 3:02 am

Code: Select all
 
//Anti Recoil
int ANTI_RECOIL      = 20; //Decrease the value if it goes to the ground
 
 
 
 
 
 
//                                        Made by JewFire aka JewishLuck
//                     Thanks to Baby Cham for helping me put this together and fixing a few things.
//                                   Tested With TLOU-Remastered and PS4 Controller
 
 
// 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
 
 
//DECLARARATIONS
//--------------------------------------------------------------
define SHOOT_BUTTON      = PS4_R2;
define RAPIDFIRE_BUTTON = PS4_L2;
define RATE_OF_FIRE       = 180; // Range: 1 to 25 RPS (Round/s)
define AUTOSPOT_BUTTON  = PS4_L2;
define SPOT_BUTTON      =PS4_R3;
//VARIABLES
//--------------------------------------------------------------
//             *DO NOT EDIT/DELETE THIS SECTION*
int hold_time;
int rest_time;
int Attack                   = FALSE;
 
 
int Timeout_Melee            = 0;
int DbleClick_Square         = 0;
 
 
//INITIALIZATION - init
//--------------------------------------------------------------
init {
     hold_time = 5450 / RATE_OF_FIRE;
     rest_time = hold_time - 5450;
     if(rest_time < 23) rest_time = 0;
}
 
define FIRE_BTN   = PS4_R2;
define ADS_BTN    = PS4_L2;
define CROUCH_BTN = PS4_CIRCLE;
define SPRINT_BTN = PS4_L1;
define JUMP_BTN   = PS4_CROSS;
define NEXT_PIECE = PS4_R2;
define LEFT_BUMP  = PS4_L2;
define SWAP_BTN   = PS4_SHARE;
define BUILD_BTN  = PS4_PS;
define RELOAD_BTN = PS4_R2;
//_____________________________________________________________________|
//########## VARIABLES BELOW USED BY SCRIPT (DO NOT TOUCH) #############|
//----------------------------------------------------------------------|
//--------------------------------------   
// use the name of the color               
define Blue          =  1;                 
define Red           =  2;                 
define Green         =  3;                 
define Pink          =  4;                 
define SkyBlue       =  5;                 
define Yellow        =  6;                 
define White         =  7;                 
 
data( 1,                 
  2,0,0,0 , //1. Blue                 
  0,2,0,0 , //2. Red                   
  0,0,2,0 , //3. Green                 
  0,0,0,2 , //4. Pink                 
  2,0,2,0 , //5. SkyBlue               
  0,2,2,0 , //6. Yellow               
  2,2,2,2   //7. White                 
) // end of data segment--------------   
 
///////////////////////////////////////   
// variables                               
int RF_onoff         = FALSE;               
int AimAssist_onoff  = TRUE;               
int shake            = 20;
int AntiRecoil_onoff = TRUE;                           
int ANTI_RECOIL_H    =  0;               
int anti_recoil;                         
int anti_recoil_H;                       
//--------------------------------------------------------------------------------------
//  MAIN BLOCK BEGIN                                 
 
//MAIN BLOCK RUTINES
//--------------------------------------------------------------
main { 
    // COLOR INDICATION FOR the RAPID FIRE ON / OFF
    if(get_val(RAPIDFIRE_BUTTON) && get_val(SHOOT_BUTTON)) {
        colorled(0,0,1,0)// OFF (Dim Lime/Green) *you can edit here*
        colorled(3,3,3,3); // (White) *you can edit here*
        combo_run(RapidFire);
    } else if(combo_running(RapidFire)) {
        combo_stop(RapidFire);
        reset_leds(); }
 
 
    // COLOR INDICATION FOR the RAPID SPOT ON / OFF
    if(get_val(RAPIDFIRE_BUTTON)) {
        combo_run(RapidSpot);
    } else if(combo_running(RapidSpot)) {
        combo_stop(RapidSpot);
        reset_leds(); }
 
 
       if(RF_onoff) LED_CM (Red);
       else         LED_CM (Blue);
    /////////////////////////////////////////////////////////////////////////////////
    // HAIR TRIGGER                                                                 
    if(get_val(ADS_BTN))  set_val(ADS_BTN, 100);                                     
    if(get_val(FIRE_BTN)) set_val(FIRE_BTN,100);                                   
 
    //////////////////////////////////////////////////////////////////////
    // DEAD ZONE CORECTION : RIGHT STICK                                 
    if(abs(get_val(PS4_RY)) < 18 && abs(get_val(PS4_RX)) < 18 ){         
        set_val(PS4_RY,0);                                                 
        set_val(PS4_RX,0);                                               
 
 
 
 
 
 
 
    /////////////////////////////////////////////////////////////////////////////////
 
 
        if (get_val(ADS_BTN)&& get_val(FIRE_BTN))     
            combo_run(AntiRecoil);                     
 
 
 
 
 
 
  // Double click Square to turn off/on Melee.
    if(DbleClick_Square > 0) DbleClick_Square = DbleClick_Square - get_rtime();
    if(event_press(PS4_SQUARE) && DbleClick_Square <= 0) {
        DbleClick_Square = 300; }
        else if(event_press(PS4_SQUARE) && DbleClick_Square > 0) {
        Attack = !Attack;
        Timeout_Melee = 0;
    }
    if(Attack) {
        set_val(TRACE_1, Timeout_Melee);
        Timeout_Melee = Timeout_Melee + get_rtime();
        if(Timeout_Melee <= 350) combo_run(Brawl);
        else combo_run(StrongAttack);
    } else if(combo_running(Brawl)) {
        combo_stop(Brawl);
        reset_leds(); }
 
 
   // Rapid fire on Square button.
    if(get_val(PS4_SQUARE)) { combo_run(Action); }
    else if(combo_running(Action)) { combo_stop(Action); }
}}
 
 
 
//COMBO BLOCKS
//--------------------------------------------------------------
combo RapidFire {
    set_val(SHOOT_BUTTON, 100);
    wait(hold_time);
    set_val(SHOOT_BUTTON, 0);
    wait(rest_time);
    set_val(SHOOT_BUTTON, 0);
}
 
 
combo RapidSpot {
    set_val(SPOT_BUTTON, 100);
    wait(hold_time);
    set_val(SPOT_BUTTON, 0);
    wait(rest_time);
    set_val(SPOT_BUTTON, 0);
}
 
 
combo Brawl {
    set_val(PS4_SQUARE, 100);
    set_led(LED_4, 2);
    wait(80);
    set_val(PS4_SQUARE, 0);
    set_led(LED_2, 0);
    wait(60);
    set_val(PS4_SQUARE, 0);
    set_led(LED_4, 0);
}   
 
 
combo StrongAttack {
    set_val(PS4_TRIANGLE, 100);
    wait(100);
    set_val(PS4_TRIANGLE, 0);
    Timeout_Melee = 0;
}
 
 
combo Action {
    set_val(PS4_SQUARE, 100);
    wait(40);
    set_val(PS4_SQUARE, 0);
    wait(20);
    set_val(PS4_SQUARE, 0);
}
 
 
// 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);
}
 
 
 
combo AntiRecoil { // This combo must be the last one
        anti_recoil = get_val(10) + ANTI_RECOIL;     
        if (anti_recoil > 100) anti_recoil = 100;     
        set_val(10, anti_recoil);                     
        anti_recoil_H = get_val(9) + ANTI_RECOIL_H;
        if(anti_recoil_H > 100) anti_recoil_H = 100;
        set_val(9, anti_recoil_H);                     
}                                             
// COLOR LED function   
//-------------------------------------------------------------- 
function LED_CM(Colour) {           
    set_led(LED_1,dbyte(( Colour * 4)- 3     ));
    set_led(LED_2,dbyte(((Colour * 4)- 3) + 1));
    set_led(LED_3,dbyte(((Colour * 4)- 3) + 2));
    set_led(LED_4,dbyte(((Colour * 4)- 3) + 3))}
 
 
 main {
    if(get_val(PS4_L1) && get_val(PS4_R1)) {
        combo_run(Turbo_1);
    }
}
 
 
combo Turbo_1 {
    set_val(PS4_R1, 100);
    wait(17);
    set_val(PS4_R1, 0);
    wait(17);
    set_val(PS4_R1, 0);
}
User avatar
sebascu
Sergeant Major
Sergeant Major
 
Posts: 68
Joined: Sat Aug 03, 2019 5:32 pm

Re: Please Help convert for Titan One

Postby DontAtMe » Sat Oct 19, 2019 3:18 am

Code: Select all
 
//Anti Recoil
//Decrease the value if it goes to the ground
//                                        Made by JewFire aka JewishLuck
//                     Thanks to Baby Cham for helping me put this together and fixing a few things.
//                                   Tested With TLOU-Remastered and PS4 Controller
// 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
//DECLARARATIONS
//--------------------------------------------------------------
// Range: 1 to 25 RPS (Round/s)
//VARIABLES
//--------------------------------------------------------------
//             *DO NOT EDIT/DELETE THIS SECTION*
//INITIALIZATION - init
//--------------------------------------------------------------
//_____________________________________________________________________|
//########## VARIABLES BELOW USED BY SCRIPT (DO NOT TOUCH) #############|
//----------------------------------------------------------------------|
//--------------------------------------   
// use the name of the color               
//1. Blue                 
//2. Red                   
//3. Green                 
//4. Pink                 
//5. SkyBlue               
//6. Yellow               
//7. White                 
// end of data segment--------------   
///////////////////////////////////////   
// variables                               
//--------------------------------------------------------------------------------------
//  MAIN BLOCK BEGIN                                 
//MAIN BLOCK RUTINES
//--------------------------------------------------------------
// COLOR INDICATION FOR the RAPID FIRE ON / OFF
// OFF (Dim Lime/Green) *you can edit here*
// (White) *you can edit here*
// COLOR INDICATION FOR the RAPID SPOT ON / OFF
/////////////////////////////////////////////////////////////////////////////////
// HAIR TRIGGER                                                                 
//////////////////////////////////////////////////////////////////////
// DEAD ZONE CORECTION : RIGHT STICK                                 
/////////////////////////////////////////////////////////////////////////////////
// Double click Square to turn off/on Melee.
// Rapid fire on Square button.
//COMBO BLOCKS
//--------------------------------------------------------------
// COLOR LED INDICATION for PS4 *NO NEED TO EDIT BELOW*
//--------------------------------------------------------------
// This combo must be the last one
// COLOR LED function   
//-------------------------------------------------------------- 
 
 
define SHOOT_BUTTON = PS4_R2;
define RAPIDFIRE_BUTTON = PS4_L2;
define RATE_OFIRE = 180;
define AUTOSPOT_BUTTON = PS4_L2;
define SPOT_BUTTON = PS4_R3;
define FIRE_BTN = PS4_R2;
define ADS_BTN = PS4_L2;
define CROUCH_BTN = PS4_CIRCLE;
define SPRINT_BTN = PS4_L1;
define JUMP_BTN = PS4_CROSS;
define NEXT_PIECE = PS4_R2;
define LEFT_BUMP = PS4_L2;
define SWAP_BTN = PS4_SHARE;
define BUILD_BTN = PS4_PS;
define RELOAD_BTN = PS4_R2;
define Blue = 1;
define Red = 2;
define Green = 3;
define Pink = 4;
define SkyBlue = 5;
define Yellow = 6;
define White = 7;
 
data( 1,
2, 0, 0, 0 ,
0, 2, 0, 0 ,
0, 0, 2, 0 ,
0, 0, 0, 2 ,
2, 0, 2, 0 ,
0, 2, 2, 0 ,
2, 2, 2, 2
);
 
int ANTI_RECOIL = 20;
int hold_time;
int rest_time;
int Attack = FALSE;
int Timeout_Melee = 0;
int DbleClick_Square = 0;
int Ronoff = FALSE;
int AimAssist_onoff = TRUE;
int shake = 20;
int AntiRecoil_onoff = TRUE;
int ANTI_RECOIL_H = 0;
int anti_recoil;
int anti_recoil_H;
 
init {
    hold_time = 5450 / RATE_OFIRE;
    rest_time = hold_time - 5450;
    if (rest_time < 23) rest_time = 0;
}
 
 
main {
    if (get_val(RAPIDFIRE_BUTTON) && get_val(SHOOT_BUTTON)) {
        colorled(0, 0, 1, 0);
        colorled(3, 3, 3, 3);
        combo_run(RapidFire);
    }
    else if (combo_running(RapidFire)) {
        combo_stop(RapidFire);
        reset_leds();
    }
    if (get_val(RAPIDFIRE_BUTTON)) {
        combo_run(RapidSpot);
    }
    else if (combo_running(RapidSpot)) {
        combo_stop(RapidSpot);
        reset_leds();
    }
    if (Ronoff) LED_CM(Red);
    else  LED_CM(Blue);
    if (get_val(ADS_BTN)) set_val(ADS_BTN, 100);
    if (get_val(FIRE_BTN)) set_val(FIRE_BTN, 100);
    if (abs(get_val(PS4_RY)) < 18 && abs(get_val(PS4_RX)) < 18) {
        set_val(PS4_RY, 0);
        set_val(PS4_RX, 0);
        if (get_val(ADS_BTN) && get_val(FIRE_BTN)) combo_run(AntiRecoil);
        if (DbleClick_Square > 0) DbleClick_Square = DbleClick_Square - get_rtime();
        if (event_press(PS4_SQUARE) && DbleClick_Square <= 0) {
            DbleClick_Square = 300;
        }
        else if (event_press(PS4_SQUARE) && DbleClick_Square > 0) {
            Attack =! Attack;
            Timeout_Melee = 0;
        }
        if (Attack) {
            set_val(TRACE_1, Timeout_Melee);
            Timeout_Melee = Timeout_Melee + get_rtime();
            if (Timeout_Melee <= 350) combo_run(Brawl);
            else  combo_run(StrongAttack);
        }
        else if (combo_running(Brawl)) {
            combo_stop(Brawl);
            reset_leds();
        }
        if (get_val(PS4_SQUARE)) {
            combo_run(Action);
        }
        else if (combo_running(Action)) {
            combo_stop(Action);
        }
    }
        if (get_val(PS4_L1) && get_val(PS4_R1)) {
        combo_run(Turbo_1);
    }
}
 
 
combo RapidFire {
    set_val(SHOOT_BUTTON, 100);
    wait(hold_time);
    set_val(SHOOT_BUTTON, 0);
    wait(rest_time);
    set_val(SHOOT_BUTTON, 0);
}
 
combo RapidSpot {
    set_val(SPOT_BUTTON, 100);
    wait(hold_time);
    set_val(SPOT_BUTTON, 0);
    wait(rest_time);
    set_val(SPOT_BUTTON, 0);
}
 
combo Brawl {
    set_val(PS4_SQUARE, 100);
    set_led(LED_4, 2);
    wait(80);
    set_val(PS4_SQUARE, 0);
    set_led(LED_2, 0);
    wait(60);
    set_val(PS4_SQUARE, 0);
    set_led(LED_4, 0);
}
 
combo StrongAttack {
    set_val(PS4_TRIANGLE, 100);
    wait(100);
    set_val(PS4_TRIANGLE, 0);
    Timeout_Melee = 0;
}
 
combo Action {
    set_val(PS4_SQUARE, 100);
    wait(40);
    set_val(PS4_SQUARE, 0);
    wait(20);
    set_val(PS4_SQUARE, 0);
}
 
combo AntiRecoil {
    anti_recoil = get_val(10) + ANTI_RECOIL;
    if (anti_recoil > 100) anti_recoil = 100;
    set_val(10, anti_recoil);
    anti_recoil_H = get_val(9) + ANTI_RECOIL_H;
    if (anti_recoil_H > 100) anti_recoil_H = 100;
    set_val(9, anti_recoil_H);
}
 
combo Turbo_1 {
    set_val(PS4_R1, 100);
    wait(17);
    set_val(PS4_R1, 0);
    wait(17);
    set_val(PS4_R1, 0);
}
 
 
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);
}
 
function LED_CM(Colour) {
    set_led(LED_1, dbyte((Colour * 4) - 3));
    set_led(LED_2, dbyte(((Colour * 4) - 3) + 1));
    set_led(LED_3, dbyte(((Colour * 4) - 3) + 2));
    set_led(LED_4, dbyte(((Colour * 4) - 3) + 3));
}
User avatar
DontAtMe
Captain
Captain
 
Posts: 502
Joined: Tue Oct 02, 2018 4:49 am

Re: Please Help convert for Titan One

Postby sebascu » Sat Oct 19, 2019 3:28 am

Thank you
User avatar
sebascu
Sergeant Major
Sergeant Major
 
Posts: 68
Joined: Sat Aug 03, 2019 5:32 pm


Return to GPC1 Script Programming

Who is online

Users browsing this forum: No registered users and 107 guests