SWBF1

This is one of my first scripts I made, I know it is an older game, but it is still played and I thought I could share it if anyone would like to try it out. All instructions are in the script, take some time to look it over and adjust to your own needs. It includes; Auto Run Easy Roll (with a jump at the end) just press L3 while straffeing 2 different Rapid Fire modes Each one optimized to either EE-3 or the EE-4 (which are great with other weapons as well) Firemodes are easily toggled On/Off (for using rockets etc) As well as easily switched between the modes (details are in the script) Anti-Recoil if you wish to use it (optimized for EE-3) and inverted look. (will need to make some adjustments to the script if you do not use Inverted sticks. This was my daily driver when I played SWBF (close to 2k hours) Hope you enjoy it as I did.
Version3.2
AuthorGreedoshotlate
Publish DateThu, 31 Jan 2019 - 08:17
Last UpdateThu, 31 Jan 2019 - 08:17
Downloads388
RATE


2

0

Code: Select all
// GPC Online Library
// SWBF.gpc
// Author: Greedoshotlate with contributions from AKHUGHES90, J2Kbr, & Bonefisher. Big thanks to these guys for all their help.
//==============================================================================         
// COPYRIGHT
 
       // 2017 greedoshotlate from http://www.consoletuner.com. This Script was made and intended for http://www.Consoletuner.com & Titan 0ne ONLY,
       // UNLESS written permission is given by the creator and/or copywritee. 
       // All rights reserved. This material may not be reproduced, displayed, modified or distributed without the express prior written permission
       // of the copyright holder. For permission, contact greedoshotlate via http://www.consoletuner.com/forum
 
//------------------------------------------------------------------------------
// Made for Star Wars Battlefront specifically, (anti-recoil has been optimized for the EE-3.)
//   --------  anything with "//" in front has been disabled, to re-enable it just remove the "//"
define ADS                       = PS4_L2;       // L2 can be changed to L1 for flipped triggers
define FIRE_BUTTON               = PS4_R2;       // R2 can be changed to R1 for flipped triggers
define CROUCH                    = PS4_CIRCLE;   // "Default" button layout is PS4_CIRCLE. "Alternate" button layout is PS4_R3.
define SWITCH                    = PS4_DOWN;
define LX                        = PS4_LX;
define LY                        = PS4_LY;
define RX                        = PS4_RX;
define RY                        = PS4_RY;
define JUMP                      = PS4_CROSS;
define UP                        = PS4_UP;
define DOWN                      = PS4_DOWN;
define LEFT                      = PS4_LEFT;
define RIGHT                     = PS4_RIGHT;
define RELOAD                    = PS4_SQUARE;
 
define ANTI_RECOIL               = 27;           // Change this value to compensate to the vertical recoil
define ANTI_RECOIL_LEFT          = 0;            // Change this value to compensate to the left
define ANTI_RECOIL_RIGHT         = 4;            // Change this value to compensate to the right
 
 
 
 
 
 
// Modz Specific
int InversionON  = TRUE;    // Set this to FALSE if you are not using look inversion enabled in the game setting.  Most people are NOT using look inversion
int AntiRecoilON = FALSE;   // Set this to TRUE if you want Anti-Recoil to be active hen the script is loaded.
int anti_recoil;
int anti_recoil_left;
int anti_recoil_right;
int SWITCHoNoFF;
int FIREMODE;
int ToggleAntiRecoil;
int AutoRunOnOff;
int run_flag   = FALSE;
int AimAbuse;
 
init {
    SWITCHoNoFF      = get_pvar(SPVAR_1, 1, 2, 1);
    FIREMODE         = get_pvar(SPVAR_2, 1, 2, 1);
    ToggleAntiRecoil = get_pvar(SPVAR_3, 1, 2, 1);
    AutoRunOnOff     = get_pvar(SPVAR_4, 1, 2, 2);
    AimAbuse         = get_pvar(SPVAR_5, 1, 2, 1);
    }
 
main {
          //hair trigger mod
    if ( get_val(ADS) > 1 )
    {
        set_val(ADS, 100);
    }
 
    if ( get_val(FIRE_BUTTON) > 1 )
    {
        set_val(FIRE_BUTTON, 100);
    }
 
        //RapidFire On/Off Toggle. (1 Rumble indicates ON), (Zero Rumbles indicates OFF). Triangle will always turn it back on, if already on Triangle does nothing.
        //                                                 ///////      Up on the D-Pad will still function as an independent Toggle for On/Off capabilities if you uncomment Lines 83-87.
    if (get_val(PS4_TRIANGLE)) {   //Comment out lines 72-77 with "//" to disable Triangle as an On switch if you uncomment lines 83-87 to activate On/Off feature.
        if (SWITCHoNoFF == 1) {
            SWITCHoNoFF = 2;
            set_pvar(SPVAR_1, SWITCHoNoFF);
            combo_run(RumbleNotifier);
        }
    }     //Can be changed from "UP" to any on the d-pad. Uncomment below to activate the full On/Off feature (remove "//" from the lines 83-87 below)
    if (event_press(UP)) {       //Up on D-pad turns off Auto Fire, Triangle turns it back on.
        if (SWITCHoNoFF == 2) {
            SWITCHoNoFF = 1;
            set_pvar(SPVAR_1, SWITCHoNoFF);
        } //else if (SWITCHoNoFF == 1) {
            //SWITCHoNoFF = 2;
            //set_pvar(SPVAR_1, SWITCHoNoFF);
            //combo_run(RumbleNotifier);
        //}
    }       // RapidFire Mode Selector. (1 Rumble= EE3), (2 Rumbles= EE4)
    if (SWITCHoNoFF == 2 && event_press(SWITCH) && get_val(RELOAD)) {
        if (FIREMODE == 2) {
            FIREMODE = 1;                           // EE-3 Rapidfire
            set_pvar(SPVAR_2, FIREMODE);
            combo_run(RumbleNotifier);
        } else if (FIREMODE == 1) {
            FIREMODE = 2;                           // EE-4 Rapidfire
            set_pvar(SPVAR_2, FIREMODE);
            combo_run(DoubleRumbleNotifier);
        } 
    }   
    if ( get_val(FIRE_BUTTON) && FIREMODE == 1 && SWITCHoNoFF == 2)
    {
        combo_run(EE3);
    }
    else if ( get_val(FIRE_BUTTON) && FIREMODE == 2 && SWITCHoNoFF == 2)
    {
        combo_run(EE4);
    }
           // Auto/Easy Roll Activates by pressing Sprint-L3 while strafing Left Or Right, just jumps if going straight (like starting a run normally)
    if(event_press(PS4_L3)) {
        combo_run(roll);
    }
       // Anti-Recoil On/Off Toggle. (1 Rumble indicates On), (Zero Rumble indicates Off).
    if (get_val(LEFT) && event_press(CROUCH)) {                                 
        if (ToggleAntiRecoil == 2) {
            ToggleAntiRecoil = 1;
            set_pvar(SPVAR_3, ToggleAntiRecoil);
        } else if (ToggleAntiRecoil == 1) {
            ToggleAntiRecoil = 2;
            set_pvar(SPVAR_3, ToggleAntiRecoil);
            combo_run(RumbleNotifier);
        }
    }
    if (get_val(RIGHT) && event_press(CROUCH)) {                                 
        if (AimAbuse == 2) {
            AimAbuse = 1;
            set_pvar(SPVAR_5, AimAbuse);
        } else if (AimAbuse == 1) {
            AimAbuse = 2;
            set_pvar(SPVAR_5, AimAbuse);
            combo_run(DoubleRumbleNotifier);
        }
    }
    // Anti-Recoil (While ADS and Firing Only)
     if (ToggleAntiRecoil == 2 && get_val(FIRE_BUTTON) && get_val(ADS)) {
        combo_run(AntiRecoil);
    }   //Turn auto run On/Off by pressing L2 + Left on the D-Pad (1 Rumble indicates Auto Run is On), (Zero Rumble is Off)
        if ((event_press(ADS) && get_val(LEFT)) || (event_press(LEFT) && get_val(ADS))) {
        if (AutoRunOnOff == 1) {
            AutoRunOnOff = 2;
        } else if (AutoRunOnOff == 2) {
            AutoRunOnOff = 1;
        }
        set_pvar(SPVAR_4, AutoRunOnOff);
 
        if (AutoRunOnOff == 1) {
            combo_run(RumbleNotifier);
        }
    }
 
    if (AutoRunOnOff == 1 && !get_val(FIRE_BUTTON) && !get_val(ADS)) {
    if(!run_flag && get_val(12) < -97) {
        run_flag = TRUE;
        combo_run(AutoSprint);
    } else if(get_val(12) > -97) {
        run_flag = FALSE;
    }
 
}
    if(AimAbuse == 2 && get_val(PS4_L2) && get_ptime(PS4_L2) > 200) {
         combo_run(AimAssistAbuse);
     }
}
 
combo    RumbleNotifier      {
    set_rumble(RUMBLE_A, 100);
    wait                (300);
    reset_rumble();
}
combo  DoubleRumbleNotifier  {
    set_rumble(RUMBLE_A, 100);
    wait                (300);
    set_rumble  (RUMBLE_A, 0);
    wait                (300);
    set_rumble(RUMBLE_A, 100);
    wait                (300);
    reset_rumble();
}
combo  TripleRumbleNotifier  {
    set_rumble(RUMBLE_A, 100);
    wait                (300);
    set_rumble  (RUMBLE_A, 0);
    wait                (300);
    set_rumble(RUMBLE_A, 100);
    wait                (300);
    set_rumble  (RUMBLE_A, 0);
    wait                (300);
    set_rumble(RUMBLE_A, 100);
    wait                (300);
    reset_rumble();
}
 
 
combo         EE4            {          // Optimized Rapidfire for the EE-4, Also best for DL-18, Relby V10. (2 Rumbles indicates activation).
    set_val(FIRE_BUTTON, 100);
    wait                 (45);
    set_val  (FIRE_BUTTON, 0);
    wait                 (15);
    set_val  (FIRE_BUTTON, 0);
}
combo         EE3            {          // Optimized RapidFire for the EE-3, works great for most weapons unless listed as optimized with another previous Firemode.
    set_val(FIRE_BUTTON, 100);          //                              (1 Rumble indicates activation).
    wait                 (60);
    set_val   (FIRE_BUTTON,0);
    wait                 (15);
    set_val   (FIRE_BUTTON,0);
}
combo         roll           {          // Optimized for the Auto/Easy Roll feature. Activates jump after your roll.
    set_val     (CROUCH, 100);
    wait                (35);
    wait                (35);
    set_val     (CROUCH, 100);
    wait                (35);
    wait                (35);
    set_val      (JUMP, 100);
    wait                (35);
    wait                (35);
    set_val      (JUMP, 100);
    wait                (35);
    wait                (35);
    }
combo AutoSprint {
    set_val(8, 0);
    wait(100);
    set_val(8, 100);
    wait(200);
}
combo AimAssistAbuse {
     set_val(PS4_L2, 100);
     wait(40);
     set_val(PS4_L2, 0);
     wait(30);
     set_val(PS4_L2, 0);
}
combo AntiRecoil {                                           
// Look Inversion Enabled
    if(get_val(FIRE_BUTTON) && !AntiRecoilON && InversionON) { // Using AntiRecoilON toggle for testing and when using multiple weapons
      anti_recoil = get_val(RY) - ANTI_RECOIL;                // SUBTRACT anti_recoil when LOOK INVERSION is ENABLED Normally.
      if(anti_recoil > 100) anti_recoil = 100;
      set_val(RY, anti_recoil);
      anti_recoil_left = get_val(RX) - ANTI_RECOIL_LEFT;
      if(anti_recoil_left < -100) anti_recoil_left = -100;
      set_val(RX, anti_recoil_left);
      anti_recoil_right = get_val(RX) + ANTI_RECOIL_RIGHT;
      if(anti_recoil_right > 100) anti_recoil_right = 100;
      set_val(RX, anti_recoil_right);
    }
}