Please help with this throttle control script

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

Please help with this throttle control script

Postby SPYKE357 » Wed May 22, 2019 12:28 am

Hi everyone


I'd like to get some help with this scout that I've been working on. It's a throttle control script for race starts.

While I press R2 fully, then when I press L1 it makes R2 36. If like R2 to move through the stages when I release L1 but can't get it to work. Any help will be greatly appreciated



Code: Select all
=============================================================================
*****************************************************************************/
/***************************************************************
    INSTRUCTIONS                                               
 
// ----------------------------------------------------------------
// Class 9. ANTI RECOIL                                             
 
 //1. Profile 1   On  => CEMU_EXTRA1 + D pad Up     
 
 //2. Profile 2   On  => CEMU_EXTRA1 + D pad Right             
 
 //3. Profile 3   On  => CEMU_EXTRA1 + D pad Down     
 
 //4. ANTI RECOIL Off => CEMU_EXTRA1 + D pad Left     
 
********************************************************/

////////////////////////////////////////////////////////                                   
//                                   
//  BUTTON LAYOUT    : DEFAULT                 
//  BUMPERS/TRIGGERS : DEFAULT
//  STICK LAYOUT     : DEFAULT
//------------------------------------------------------
 
 
define SPRINT_BTN    = XB1_LS; // LS                       
define PRONE_BTN     = XB1_B; // B                         
define JUMP_BTN      = XB1_A; // A                         
define SWITCH_WEAPON = XB1_Y; // Y                         
define RELOAD_BTN    = XB1_X; // X                         
define MELEE         = XB1_RS; // RS/R3                     
define LETHAL        = XB1_RB; // RB                       
define TACTICAL      = XB1_LB; // LB                       
define Up            = XB1_UP;                             
define Right         = XB1_RIGHT;                             
define Down          = XB1_DOWN;                             
define Left          = XB1_LEFT;                               
define R_X           = PS4_R2;                             
define R_Y           = XB1_RY;                             
define L_X           = XB1_LX;                             
define L_Y           = XB1_LY;                             
////////////////////////////////////////////////////////
//                       
define dropDelay    =300;
define timelimit    =300;
define NotUse       =  0;
 
////////////////////////////////////////////////////////
//                       
 
int RA;                   
int LX;
int LY;
int hold_time = 30// All Weapons
int rest_time = 10;                 
int hold_timeP = 30// Primary Weapon
int rest_timeP = 10;                 
int hold_timeS = 30; // secondary
int rest_timeS = 10; // secondary
int hold_time_B = 30;   
int rest_time_B = 10;   
 
////////////////////////////////////////////////////////
//  Boolean Variables             
int rapid_onoff          =FALSE
int RF_ALL_weapons       =FALSE
int burst_onoff          =FALSE; // On/Off Burst Fire
int akimbo_onoff         =FALSE; // On/Off Akimbo mode
int Akimbo_Secondary     =FALSE; // On/Off Akimbo mode
int dropshot_OnOff       =FALSE; // On/Off Drop Shot 
int side_shot_OnOff      =FALSE;   
int JumpShot_OnOff       =FALSE;   
int ScopeShot            =FALSE;   
int QuickScope           =FALSE;   
int SniperOnOff          =FALSE;   
int hold_breath_On_Off   =FALSE;   
int Prim_SecondWeapon    =FALSE;   
int PrimaryWeapon        =FALSE;   
int BurstMelee          =FALSE;   
int SecondaryWeapon      =FALSE;   
int SpecialAbility_OnOff =FALSE;   
int InvertYaxis          =FALSE;   
int TogleADS             =FALSE; // On /Off Togle ADS   
 
int Invert = 1;                       
int b_hold_ADS           =FALSE; // if Toggle ADS in use * / need to be reset
int b_ADS_Delay          =FALSE; // On /Off ADS Delay   
int JumpActive           =FALSE;                       
int InstantDrop          =FALSE; // Slide or instant drop
int bLAUNCH_CONTROL         = TRUE;
define AR_Release     = 60; // change this value to determine when antirecoil stops working (min: antirecoil value + 10)
int LAUNCH_CONTROL       = 0; //Set this value to compensate for the recoil vertical (0 - 100)
int ANTI_RECOIL_LEFT  = 0; //Set this value to compensate for the recoil left  (0 - 100)
int ANTI_RECOIL_RIGHT = 0; //Set this value to compensate for the recoil right (0 - 100)
int rev_control;       
int anti_recoil_left; 
int anti_recoil_right;
int b_switch;   
int NotReloading         = TRUE;   
int DblClick_JUMP;         
int TimeToJump;           
int LongJump             = TRUE
int b_running;                   
int b_tap ;                   // boolean variable 
int timerLJump;               
int wait_sec_tap = 300;               
 
//////////////////////////////////////////////////////////
//                         
int timer;                 
int Sens         =  20;   
int SlideOrDrop  =  20;   
int DelayScope   =  20;     
int ADS_Delay    =  150;// ADS delay value
//INITIALIZATION - init                       
//--------------------------------------------------------------
init {//#############################################     
    if(InvertYaxis) Invert = -1;                                                       
    if(InstantDrop)SlideOrDrop=20;                         
    else SlideOrDrop=10;                                   
}//##################################################     
//MAIN BLOCK RUTINES                                       
//--------------------------------------------------------------
main {  // Start of MAIN BLOCK                                 
//--------------------------------------------------------------
// FIND DIRECTION of Left Analogue                           
if(get_val(L_X)<-20 || get_val(L_X)>20)LX=get_val(L_X);     
//--------------------------------------------------------------
//////////////////////////////////////////////////////////////////////////
//  ANTI RECOIL PROFILES  ////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
 
     // ANTI RECOIL - UserProfile 1:None Switch:CEMU_EXTRA1
     if( get_val(PS4_R2) ){                       
       // USER PROFILE 1 :START REVS                         
       if(get_val(PS4_L1)&& get_val(PS4_R2)){                           
         bLAUNCH_CONTROL=TRUE;                           
         LAUNCH_CONTROL       = -64; // vertical (0 - 100) 
 
       }                                               
       // USER PROFILE 2 :LAUNCH CONTROL                       
       if(event_release(PS4_L1)&& get_val(PS4_R2)){   
        bLAUNCH_CONTROL=TRUE;                                     
 
 
   if(!bLAUNCH_CONTROL){//---------------------------------------------
 
          LAUNCH_CONTROL = 0; // DON'T MODIFY THIS VALUE, ANTIRECOIL VALUES ARE BELOW
 
    if(get_ptime(PS4_R2) >=50)  {  // Burst before antirecoil
        LAUNCH_CONTROL =-64; // After 200ms fireing, antirecoil = 20 up to 700ms fireing
 
        }
 if(get_ptime(PS4_R2) >=150)  {  // Burst before antirecoil
        LAUNCH_CONTROL =-64; // After 200ms fireing, antirecoil = 20 up to 700ms fireing
 
        }
        if(get_ptime(PS4_R2) >=200)  {  // Burst before antirecoil
        LAUNCH_CONTROL =-64; // After 200ms fireing, antirecoil = 20 up to 700ms fireing
 
        }
        if(get_ptime(PS4_R2) >=250)  {  // Burst before antirecoil
        LAUNCH_CONTROL =-55; // After 200ms fireing, antirecoil = 20 up to 700ms fireing
 
        }
        if(get_ptime(PS4_R2) >=300)  {  // Burst before antirecoil
        LAUNCH_CONTROL =-55; // After 200ms fireing, antirecoil = 20 up to 700ms fireing
 
        }
        if(get_ptime(PS4_R2) >=350)  {  // Burst before antirecoil
        LAUNCH_CONTROL =-45; // After 200ms fireing, antirecoil = 20 up to 700ms fireing
 
        }
        if(get_ptime(PS4_R2) >=400)  {  // Burst before antirecoil
        LAUNCH_CONTROL =-45; // After 200ms fireing, antirecoil = 20 up to 700ms fireing
 
        }
        if(get_ptime(PS4_R2) >=450)  {  // Burst before antirecoil
        LAUNCH_CONTROL =-35; // After 200ms fireing, antirecoil = 20 up to 700ms fireing
 
        }
        if(get_ptime(PS4_R2) >=500)  {  // Burst before antirecoil
        LAUNCH_CONTROL =-35; // After 200ms fireing, antirecoil = 20 up to 700ms fireing
 
        }
        if(get_ptime(PS4_R2) >=550)  {  // Burst before antirecoil
        LAUNCH_CONTROL =-25; // After 200ms fireing, antirecoil = 20 up to 700ms fireing
 
        }
         if(get_ptime(PS4_R2) >=600)  {  // Burst before antirecoil
        LAUNCH_CONTROL =-25; // After 200ms fireing, antirecoil = 20 up to 700ms fireing
 
        }
         if(get_ptime(PS4_R2) >=650)  {  // Burst before antirecoil
        LAUNCH_CONTROL =-20; // After 200ms fireing, antirecoil = 20 up to 700ms fireing
 
        }
         if(get_ptime(PS4_R2) >=700)  {  // Burst before antirecoil
        LAUNCH_CONTROL =-20; // After 200ms fireing, antirecoil = 20 up to 700ms fireing
 
        }
         if(get_ptime(PS4_R2) >=750)  {  // Burst before antirecoil
        LAUNCH_CONTROL =-15; // After 200ms fireing, antirecoil = 20 up to 700ms fireing
 
        } if(get_ptime(PS4_R2) >=800)  {  // Burst before antirecoil
        LAUNCH_CONTROL =-15; // After 200ms fireing, antirecoil = 20 up to 700ms fireing
 
        }
         if(get_ptime(PS4_R2) >=850)  {  // Burst before antirecoil
        LAUNCH_CONTROL =-10; // After 200ms fireing, antirecoil = 20 up to 700ms fireing
 
        }
         if(get_ptime(PS4_R2) >=900)  {  // Burst before antirecoil
        LAUNCH_CONTROL =-10; // After 200ms fireing, antirecoil = 20 up to 700ms fireing
 
        }
         if(get_ptime(PS4_R2) >=950)  {  // Burst before antirecoil
        LAUNCH_CONTROL =0; // After 200ms fireing, antirecoil = 20 up to 700ms fireing
 
        }
 
       }                                               
 
       // USER PROFILE 4 : Turn OFF Anti Recoil       
       if(get_val(PS4_R1)){                           
       bLAUNCH_CONTROL=FALSE;                           
       }                                             
 
     }               
 
// ANTI RECOIL 
 
     // ANTI RECOIL - Class 9 Scope Disabled 
     if(bLAUNCH_CONTROL){//--------------------- 
        if(get_val(PS4_R2)&& get_val(PS4_L1) ){
            combo_run(LC2STEP);
            combo_stop (Launchcontrol);
        } 
          if(get_val(PS4_R2)&& event_release(PS4_L1)) {
        combo_run(Launchcontrol);
         combo_stop (LC2STEP);
        }
        else if(get_val(PS4_L1)) {
            combo_stop(Launchcontrol);
 
            }
     }//-------------------------------------- 
 
 
    if(event_release(PS4_R2)  )  { 
        combo_stop (LC2STEP);
        combo_stop (Launchcontrol);
    }                                             
}
}
combo LC2STEP {         
    //---------------------------------
     rev_control = get_val(PS4_R2) + (LAUNCH_CONTROL*Invert);
     if(rev_control > 100) rev_control = 100;               
     set_val(PS4_R2, rev_control);                         
 
     //-------------------------------------------------------
}   
combo Launchcontrol {         
    //---------------------------------
     rev_control = get_val(PS4_R2) + (LAUNCH_CONTROL*Invert);
     if(rev_control > 100) rev_control = 100;               
     set_val(PS4_R2, rev_control);                         
 
     //-------------------------------------------------------
}       
//------------------------------------------------------------------------------------
// end of script
User avatar
SPYKE357
Private
Private
 
Posts: 1
Joined: Wed Mar 26, 2014 1:47 pm

Re: Please help with this throttle control script

Postby J2Kbr » Mon May 27, 2019 10:38 am

Please check if the change made fix the issue.
Code: Select all
/*******************************************************************/
/*******************************************************************
    INSTRUCTIONS                                               
 
// ----------------------------------------------------------------
// Class 9. ANTI RECOIL                                             
 
 //1. Profile 1   On  => CEMU_EXTRA1 + D pad Up     
 
 //2. Profile 2   On  => CEMU_EXTRA1 + D pad Right             
 
 //3. Profile 3   On  => CEMU_EXTRA1 + D pad Down     
 
 //4. ANTI RECOIL Off => CEMU_EXTRA1 + D pad Left     
 
********************************************************/

////////////////////////////////////////////////////////                                   
//                                   
//  BUTTON LAYOUT    : DEFAULT                 
//  BUMPERS/TRIGGERS : DEFAULT
//  STICK LAYOUT     : DEFAULT
//------------------------------------------------------
 
 
define SPRINT_BTN    = XB1_LS; // LS                       
define PRONE_BTN     = XB1_B; // B                         
define JUMP_BTN      = XB1_A; // A                         
define SWITCH_WEAPON = XB1_Y; // Y                         
define RELOAD_BTN    = XB1_X; // X                         
define MELEE         = XB1_RS; // RS/R3                     
define LETHAL        = XB1_RB; // RB                       
define TACTICAL      = XB1_LB; // LB                       
define Up            = XB1_UP;                             
define Right         = XB1_RIGHT;                             
define Down          = XB1_DOWN;                             
define Left          = XB1_LEFT;                               
define R_X           = PS4_R2;                             
define R_Y           = XB1_RY;                             
define L_X           = XB1_LX;                             
define L_Y           = XB1_LY;                             
////////////////////////////////////////////////////////
//                       
define dropDelay    =300;
define timelimit    =300;
define NotUse       =  0;
 
////////////////////////////////////////////////////////
//                       
 
int RA;                   
int LX;
int LY;
int hold_time = 30// All Weapons
int rest_time = 10;                 
int hold_timeP = 30// Primary Weapon
int rest_timeP = 10;                 
int hold_timeS = 30; // secondary
int rest_timeS = 10; // secondary
int hold_time_B = 30;   
int rest_time_B = 10;   
 
////////////////////////////////////////////////////////
//  Boolean Variables             
int rapid_onoff          =FALSE
int RF_ALL_weapons       =FALSE
int burst_onoff          =FALSE; // On/Off Burst Fire
int akimbo_onoff         =FALSE; // On/Off Akimbo mode
int Akimbo_Secondary     =FALSE; // On/Off Akimbo mode
int dropshot_OnOff       =FALSE; // On/Off Drop Shot 
int side_shot_OnOff      =FALSE;   
int JumpShot_OnOff       =FALSE;   
int ScopeShot            =FALSE;   
int QuickScope           =FALSE;   
int SniperOnOff          =FALSE;   
int hold_breath_On_Off   =FALSE;   
int Prim_SecondWeapon    =FALSE;   
int PrimaryWeapon        =FALSE;   
int BurstMelee          =FALSE;   
int SecondaryWeapon      =FALSE;   
int SpecialAbility_OnOff =FALSE;   
int InvertYaxis          =FALSE;   
int TogleADS             =FALSE; // On /Off Togle ADS   
 
int Invert = 1;                       
int b_hold_ADS           =FALSE; // if Toggle ADS in use * / need to be reset
int b_ADS_Delay          =FALSE; // On /Off ADS Delay   
int JumpActive           =FALSE;                       
int InstantDrop          =FALSE; // Slide or instant drop
int bLAUNCH_CONTROL         = TRUE;
define AR_Release     = 60; // change this value to determine when antirecoil stops working (min: antirecoil value + 10)
int LAUNCH_CONTROL       = 0; //Set this value to compensate for the recoil vertical (0 - 100)
int ANTI_RECOIL_LEFT  = 0; //Set this value to compensate for the recoil left  (0 - 100)
int ANTI_RECOIL_RIGHT = 0; //Set this value to compensate for the recoil right (0 - 100)
int rev_control;       
int anti_recoil_left; 
int anti_recoil_right;
int b_switch;   
int NotReloading         = TRUE;   
int DblClick_JUMP;         
int TimeToJump;           
int LongJump             = TRUE
int b_running;                   
int b_tap ;                   // boolean variable 
int timerLJump;               
int wait_sec_tap = 300;               
 
//////////////////////////////////////////////////////////
//                         
int timer;                 
int Sens         =  20;   
int SlideOrDrop  =  20;   
int DelayScope   =  20;     
int ADS_Delay    =  150;// ADS delay value
//INITIALIZATION - init                       
//--------------------------------------------------------------
init {//#############################################     
    if(InvertYaxis) Invert = -1;                                                       
    if(InstantDrop)SlideOrDrop=20;                         
    else SlideOrDrop=10;                                   
}//##################################################     
//MAIN BLOCK RUTINES                                       
//--------------------------------------------------------------
main {  // Start of MAIN BLOCK                                 
//--------------------------------------------------------------
// FIND DIRECTION of Left Analogue                           
if(get_val(L_X)<-20 || get_val(L_X)>20)LX=get_val(L_X);     
//--------------------------------------------------------------
//////////////////////////////////////////////////////////////////////////
//  ANTI RECOIL PROFILES  ////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
 
     // ANTI RECOIL - UserProfile 1:None Switch:CEMU_EXTRA1
     if( get_val(PS4_R2) ){                       
       // USER PROFILE 1 :START REVS                         
       if(get_val(PS4_L1)&& get_val(PS4_R2)){                           
         bLAUNCH_CONTROL=TRUE;                           
         LAUNCH_CONTROL       = -64; // vertical (0 - 100) 
 
       }                                               
       // USER PROFILE 2 :LAUNCH CONTROL                       
       if(event_release(PS4_L1)&& get_val(PS4_R2)){   
        bLAUNCH_CONTROL=TRUE;                                     
 
 
   if(!bLAUNCH_CONTROL){//---------------------------------------------
 
          LAUNCH_CONTROL = 0; // DON'T MODIFY THIS VALUE, ANTIRECOIL VALUES ARE BELOW
 }
    if(get_ptime(PS4_R2) >=50)  {  // Burst before antirecoil
        LAUNCH_CONTROL =-64; // After 200ms fireing, antirecoil = 20 up to 700ms fireing
 
        }
 if(get_ptime(PS4_R2) >=150)  {  // Burst before antirecoil
        LAUNCH_CONTROL =-64; // After 200ms fireing, antirecoil = 20 up to 700ms fireing
 
        }
        if(get_ptime(PS4_R2) >=200)  {  // Burst before antirecoil
        LAUNCH_CONTROL =-64; // After 200ms fireing, antirecoil = 20 up to 700ms fireing
 
        }
        if(get_ptime(PS4_R2) >=250)  {  // Burst before antirecoil
        LAUNCH_CONTROL =-55; // After 200ms fireing, antirecoil = 20 up to 700ms fireing
 
        }
        if(get_ptime(PS4_R2) >=300)  {  // Burst before antirecoil
        LAUNCH_CONTROL =-55; // After 200ms fireing, antirecoil = 20 up to 700ms fireing
 
        }
        if(get_ptime(PS4_R2) >=350)  {  // Burst before antirecoil
        LAUNCH_CONTROL =-45; // After 200ms fireing, antirecoil = 20 up to 700ms fireing
 
        }
        if(get_ptime(PS4_R2) >=400)  {  // Burst before antirecoil
        LAUNCH_CONTROL =-45; // After 200ms fireing, antirecoil = 20 up to 700ms fireing
 
        }
        if(get_ptime(PS4_R2) >=450)  {  // Burst before antirecoil
        LAUNCH_CONTROL =-35; // After 200ms fireing, antirecoil = 20 up to 700ms fireing
 
        }
        if(get_ptime(PS4_R2) >=500)  {  // Burst before antirecoil
        LAUNCH_CONTROL =-35; // After 200ms fireing, antirecoil = 20 up to 700ms fireing
 
        }
        if(get_ptime(PS4_R2) >=550)  {  // Burst before antirecoil
        LAUNCH_CONTROL =-25; // After 200ms fireing, antirecoil = 20 up to 700ms fireing
 
        }
         if(get_ptime(PS4_R2) >=600)  {  // Burst before antirecoil
        LAUNCH_CONTROL =-25; // After 200ms fireing, antirecoil = 20 up to 700ms fireing
 
        }
         if(get_ptime(PS4_R2) >=650)  {  // Burst before antirecoil
        LAUNCH_CONTROL =-20; // After 200ms fireing, antirecoil = 20 up to 700ms fireing
 
        }
         if(get_ptime(PS4_R2) >=700)  {  // Burst before antirecoil
        LAUNCH_CONTROL =-20; // After 200ms fireing, antirecoil = 20 up to 700ms fireing
 
        }
         if(get_ptime(PS4_R2) >=750)  {  // Burst before antirecoil
        LAUNCH_CONTROL =-15; // After 200ms fireing, antirecoil = 20 up to 700ms fireing
 
        } if(get_ptime(PS4_R2) >=800)  {  // Burst before antirecoil
        LAUNCH_CONTROL =-15; // After 200ms fireing, antirecoil = 20 up to 700ms fireing
 
        }
         if(get_ptime(PS4_R2) >=850)  {  // Burst before antirecoil
        LAUNCH_CONTROL =-10; // After 200ms fireing, antirecoil = 20 up to 700ms fireing
 
        }
         if(get_ptime(PS4_R2) >=900)  {  // Burst before antirecoil
        LAUNCH_CONTROL =-10; // After 200ms fireing, antirecoil = 20 up to 700ms fireing
 
        }
         if(get_ptime(PS4_R2) >=950)  {  // Burst before antirecoil
        LAUNCH_CONTROL =0; // After 200ms fireing, antirecoil = 20 up to 700ms fireing
 
        }
 
 
       // USER PROFILE 4 : Turn OFF Anti Recoil       
       if(get_val(PS4_R1)){                           
       bLAUNCH_CONTROL=FALSE;                           
       }                                             
 
     }               
 
// ANTI RECOIL 
 
     // ANTI RECOIL - Class 9 Scope Disabled 
     if(bLAUNCH_CONTROL){//--------------------- 
        if(get_val(PS4_R2)&& get_val(PS4_L1) ){
            combo_run(LC2STEP);
            combo_stop (Launchcontrol);
        } 
          if(get_val(PS4_R2)&& event_release(PS4_L1)) {
        combo_run(Launchcontrol);
         combo_stop (LC2STEP);
        }
        else if(get_val(PS4_L1)) {
            combo_stop(Launchcontrol);
 
            }
     }//-------------------------------------- 
 
 
    if(event_release(PS4_R2)  )  { 
        combo_stop (LC2STEP);
        combo_stop (Launchcontrol);
    }                                             
}
}
combo LC2STEP {         
    //---------------------------------
     rev_control = get_val(PS4_R2) + (LAUNCH_CONTROL*Invert);
     if(rev_control > 100) rev_control = 100;               
     set_val(PS4_R2, rev_control);                         
 
     //-------------------------------------------------------
}   
combo Launchcontrol {         
    //---------------------------------
     rev_control = get_val(PS4_R2) + (LAUNCH_CONTROL*Invert);
     if(rev_control > 100) rev_control = 100;               
     set_val(PS4_R2, rev_control);                         
 
     //-------------------------------------------------------
}       
//------------------------------------------------------------------------------------
// end of script
ConsoleTuner Support Team
User avatar
J2Kbr
General of the Army
General of the Army
 
Posts: 20323
Joined: Tue Mar 18, 2014 1:39 pm


Return to GPC1 Script Programming

Who is online

Users browsing this forum: No registered users and 94 guests