BF5 flying with a plane with Mouse

GPC2 script programming for Titan Two. Code examples, questions, requests.

BF5 flying with a plane with Mouse

Postby Skilah » Thu Jan 30, 2020 9:00 am

Hello guys, I am currently testing to fly with my Mouse and Keyboard on Battlefield 5 and it's really difficult since I don't have a 2 meters arm and mousepad ^^

My issue is that I use the Mouse to go up/down and roll on the side, it works perfectly fine to aim flying targets or ground targets IF they're close.

If I have to make a 45 degree turn, it will take me 1 meters with my mouse.

I tried to raise my sensitivity to the max (10.0) but still doesn't help.
I even tried to move all the blue square from the conversion curve to the top and still can't turn with less than 1 meter on my mousepad. My biggest issue is going fast up or down, the right/left is a roll so only my up/down is very problematic.

Is there a setting I am missing ? How can I set my mouse input for it to have the max turnspeed up/down very fast in the input translator?
My mouse DPI is already set at its max 8200DPI.
User avatar
Skilah
Staff Sergeant
Staff Sergeant
 
Posts: 11
Joined: Sat Jan 18, 2020 9:09 pm

Re: BF5 flying with a plane with Mouse

Postby Skilah » Thu Jan 30, 2020 11:01 am

I've found a workaround and also got some help on Discord (thanks to Buffy)

First of all, game settings from the Input Translator for BF5 (PS4) are not maxed, I maxed them to what I believe are XIM settings, the initial input translator has 15 Axial deadzone, I've setup to 0 now.

Here are the settings I use now, shared by Buffy :
Basic
Soldier Aim Sensitivity: 100%
Solider Zoom Sensitivity: 200%
Vehicle Aim Sensitivity: 100%

Control Schemes
Soldier Buttons: Default
Soldier Sticks: Default

Advanced
Stick Aiming Acceleration: 0%
Uniform Soldier Aiming: Off
Aiming Left/Right Acceleration: 0%
Uniform Vehicle Aiming: Off
Zoom Sensitivity Options: User Choice

(These are hidden. Continue scrolling down the Advanced section to find them)
Solder Aim Ratio: 100%
Soldier Zoom Aim Ratio: 100%
Vehicle Aim Ratio: 100%
Vehicle Zoom Aim Ratio: 100%

Controller Tuning (Left and Right stick)
Center Deadzone: 13%
Axial Deadzone: 0%
Max Input Threshold: 100%


I have to admit it feels better when Aiming, even if I had to reduce my ADS sensitivity.
@J2K maybe you could try those settings and modify the Input Translator Doc if you deem those settings more viable?


About Planes the workaround I found was to map 2 keyboard inputs, one to STICK_1_Y (inverted) and one STICK_1_Y.
It allows me to use my mouse AND my keyboard to go up and down.
User avatar
Skilah
Staff Sergeant
Staff Sergeant
 
Posts: 11
Joined: Sat Jan 18, 2020 9:09 pm

Re: BF5 flying with a plane with Mouse

Postby J2Kbr » Fri Jan 31, 2020 1:28 pm

This is my BFV script, I play with PS Nav + G502 mouse. Note there is a part of it for airplanes gameplay (activated by tapping PS button), hopefully it helps.
Code: Select all
#pragma METAINFO("Battlefield V", 1, 0, "J2Kbr")
 
/******************************************************************************
 * INPUT TRANSLATOR
 ******************************************************************************/

#include <remapper.gph>
#include <keyboard.gph>
#include <display.gph>
#include <mouse.gph>
 
init {
    port_inhibit_ffb(PORT_USB_A);
 
    remapper_disable(STICK_1_X);
    remapper_disable(STICK_1_Y);
    remapper_disable(ACCEL_1_X);
    remapper_disable(ACCEL_1_Y);
    remapper_disable(ACCEL_1_Z);
    remapper_swap(BUTTON_6, BUTTON_9);
    remapper_mask(RMP_BT_A | RMP_USB_A);
 
    const uint8 kmap[] = {
        KEY_P,              BUTTON_17// SQUARE
        KEY_CLOSEBRACKET,   BUTTON_2,   // TOUCH-CLICK
        KEY_BACKSLASH,      BUTTON_3,   // OPTIONS
    }; keymapping(kmap);
 
    const uint8 mmap[] = {
        MOUSE_X,            STICK_1_X// LOOK X
        MOUSE_Y,            STICK_1_Y// LOOK Y
        MWHEEL_FORWARD,     BUTTON_21// UNUSED
        MWHEEL_BACKWARD,    BUTTON_14// TRIANGLE
        MBUTTON_1,          BUTTON_5,   // R2
        MBUTTON_2,          BUTTON_16// CROSS
        MBUTTON_3,          BUTTON_9,   // L3
        MBUTTON_4,          BUTTON_4,   // R1
        MBUTTON_5,          BUTTON_15// CIRCLE
    }; mousemapping(mmap);
 
    #define sensitivity(n)  n >> 8, n
 
    const uint8 mxyc[] = {
        BUTTON_8,
        sensitivity(2.18i), // Default
        0x01, 0x59, 0x00, 0x2E, 0x0C, 0x87, 0x0C, 0x87, 0x00, 0xE8,
        0x00, 0x00, 0x16, 0xBD, 0x27, 0x35, 0x32, 0x33, 0x37, 0xAE, 0x3B, 0x9C,
        0x3F, 0x87, 0x41, 0xE1, 0x44, 0x3A, 0x46, 0x97, 0x48, 0x28, 0x4A, 0x82,
        0x4C, 0x14, 0x4D, 0xA3, 0x4E, 0x6E, 0x50, 0x00, 0x51, 0x91, 0x52, 0x59,
        0x53, 0xEB, 0x54, 0xB3, 0x56, 0x45,
        sensitivity(2.00i), // Alternate
        0x01, 0x19, 0x00, 0x2E, 0x0C, 0x87, 0x0C, 0x87, 0x00, 0xE8,
        0x00, 0x00, 0x17, 0x87, 0x23, 0x4A, 0x2A, 0x59, 0x30, 0xA1, 0x34, 0x8C,
        0x38, 0x78, 0x3B, 0x9C, 0x3E, 0xBD, 0x41, 0x19, 0x44, 0x3A, 0x45, 0xCC,
        0x48, 0x28, 0x49, 0xB8, 0x4C, 0x14, 0x4D, 0xA3, 0x4F, 0x35, 0x50, 0xC7,
        0x52, 0x59, 0x53, 0xEB, 0x56, 0x45
    }; mxyconverter(mxyc);
}
 
/******************************************************************************
 * MAIN
 ******************************************************************************/

// ---- ASSAUT -------------------- | STANDING | CROUCHED |  PRONE  |  RFIRE  |
#define ASSAUT_STURMGEWEHR_1XRRRL   { 25 ,  -4 , 18 ,  -3 , 13 , -1 , 76 ,  0 }
#define ASSAUT_GEWEHR43_3XRRRR      { 65 ,   0 , 46 ,   0 , 33 ,  0 , 38 , 37 }
#define ASSAUT_M1A1_3XRLLR          { 108,   0 , 66 ,   0 , 54 ,  0 , 38 , 37 }
// ---- MEDIC --------------------- | STANDING | CROUCHED |  PRONE  |  RFIRE  |
#define MEDIC_STEN_1XRRRR           { 17 ,  -3 , 12 ,  -2 , 10 , -2 , 76 ,  0 }
// ---- SUPPORT ------------------- | STANDING | CROUCHED |  PRONE  |  RFIRE  |
#define SUPPORT_KE7_1XLRRR          { 18 ,  -2 , 14 ,  -2 ,  7 ,  0 , 76 ,  0 }
#define SUPPORT_KE7_6XLRRR          { 55 ,  -6 , 36 ,  -4 , 16 , -3 , 76 ,  0 }
// ----------------------------------------------------------------------------
const int8 wcfg[] = ASSAUT_M1A1_3XRLLR;
 
int16 rf_active, rf_release;
 
main {
    // - AIRPLANE MODE - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    static bool airplane_mode;
    if(event_release(BUTTON_1) && time_active(BUTTON_1) < 200) {
        airplane_mode = !airplane_mode;
        if(airplane_mode) {
            led_set(LED_3, -1.0, 0);
            led_set(LED_4, -1.0, 0);
            combo_run(AirPlaneChangeView);
        } else led_reset();
    } inhibit(BUTTON_1, 200);
    if(airplane_mode) {
        // YAW Right/Left (mouse)
        set_val(STICK_1_X, clamp(get_val(STICK_1_X)*2.00, -100.0, 100.0));
        // PITCH Up/Down (stick + mouse)
        if(is_active(STICK_1_Y)) {
            set_val(STICK_2_Y, clamp(get_val(STICK_2_Y)+inv(get_val(STICK_1_Y)), -100.0, 100.0));
        } set_val(STICK_1_Y, 0.0);
        // YAW Left/Right
        if(get_val(BUTTON_17)) {
            set_val(STICK_1_X, -100.0);
            set_val(BUTTON_17, 0.0);
        } if(mouse_status(MBUTTON_5)) {
            set_val(STICK_1_X, 100.0);
            set_val(BUTTON_15, 0.0);
        }
        // Accelerate, Break
        static bool low_speed;
        if(mouse_status(MBUTTON_2)) {
            set_val(STICK_1_Y, -100.0);
            set_val(BUTTON_16, 0.0);
            low_speed = FALSE;
        } if(get_val(BUTTON_7)) {
            low_speed = (time_active(BUTTON_7) < 200);
            set_val(STICK_1_Y, 100.0);
            set_val(BUTTON_7, 0.0);
        } else if(low_speed) set_val(STICK_1_Y, 75.0);
        // Auto change view mode with L2
        static uint8 change_view;
        if(event_active(BUTTON_8) || event_release(BUTTON_8)) ++change_view;
        if(change_view && !AirPlaneChangeView) {
            combo_run(AirPlaneChangeView);
            --change_view;
        } if(get_val(BUTTON_8) < 90.0) set_val(BUTTON_8, 0.0);
        // Auto fire secondary weapon with L3
        static uint8 switch_weapon;
        if(event_active(BUTTON_9) || event_release(BUTTON_9)) ++switch_weapon;
        if(switch_weapon && !AirPlaneSwitchWeapon) {
            combo_run(AirPlaneSwitchWeapon);
            --switch_weapon;
        } set_val(BUTTON_9, 0.0);
        if(!AirPlaneSwitchWeapon && get_actual(BUTTON_9)) set_val(BUTTON_5, 100.0);
        // Repair with R1
        if(get_val(BUTTON_4)) {
            set_val(BUTTON_7, 100.0);
            set_val(BUTTON_4, 0.0);
        }
        // Rapidfire
        if(get_val(BUTTON_5)) combo_run(Rapidfire);
        // Exit
        if(get_val(BUTTON_15)) {
            if(time_active(BUTTON_15) >= 400) {
                airplane_mode = FALSE; led_reset();
            } set_val(BUTTON_17, 100.0);
        }
        goto END_OF_MAIN;
    }
 
    // - WEAPON TRACKING - - - - - - - - - - - - - - - - - - - - - - - - - - -
    #define WEAPON_PRIMARY      0
    #define WEAPON_SECONDARY    1
    static uint8 weapon;
    if(!get_actual(BUTTON_7)) {
        if(event_active(BUTTON_21)) {
            weapon = WEAPON_PRIMARY;
            combo_run(WeaponPrimary);
            display_overlay(_P_, 500);
        } else if(event_active(BUTTON_14)) {
            weapon = WEAPON_SECONDARY;
            combo_run(WeaponSecondary);
            display_overlay(_S_, 500);
        } set_val(BUTTON_14, 0.0);
    }
 
    // - STANCE TRACKING - - - - - - - - - - - - - - - - - - - - - - - - - - -
    #define STANCE_STANDING     0
    #define STANCE_CROCHED      1
    #define STANCE_PRONE        2
    static uint8 stance;
    if(event_active(BUTTON_16)) {
        stance = STANCE_STANDING;
        goto STANCE_LIGHTBAR;
    } else if(event_release(BUTTON_6)) {
        if(time_active(BUTTON_6) <= 400) {
            if(stance || get_actual(STICK_2_Y) > -100.0) {
                switch(stance) {
                    case STANCE_STANDING: stance = STANCE_CROCHED;  break;
                    case STANCE_CROCHED:  stance = STANCE_STANDING; break;
                    case STANCE_PRONE:    stance = STANCE_CROCHED;  break;
                } combo_run(StanceToggle);
            } else combo_run(StanceSlide);
        } else stance = STANCE_PRONE;
        STANCE_LIGHTBAR:
        led_reset();
        switch(stance) {
            case STANCE_STANDING: led_set(LED_1, -1.0, 0); break;
            case STANCE_CROCHED:  led_set(LED_3, -1.0, 0); break;
            case STANCE_PRONE:    led_set(LED_2, -1.0, 0); break;
        }
    } else if(get_actual(BUTTON_6) && time_active(BUTTON_6) <= 400) {
        set_val(BUTTON_6, 0.0);
    }
 
    // - ANTI RECOIL - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    if(event_active(BUTTON_5)) {
        if(get_actual(BUTTON_8)) {                                     // ADS
            mxyconverter_voffset(wcfg[2*stance+0]);
            mxyconverter_hoffset(wcfg[2*stance+1]);
        } else {                                                       // HIP
            mxyconverter_voffset(0);
            mxyconverter_hoffset(0);
        }
    } else if(event_active(BUTTON_8) && get_actual(BUTTON_5)) {        // ADS
        mxyconverter_voffset(wcfg[2*stance+0]);
        mxyconverter_hoffset(wcfg[2*stance+1]);
    } if(event_release(BUTTON_5)) {                                    // STOP
        mxyconverter_voffset(0);
        mxyconverter_hoffset(0);
    }
 
    // - RAPIDFIRE - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    if(get_actual(BUTTON_5)) {
        if(weapon) {                                              // SECONDARY
            if(event_active(BUTTON_5)) {
                rf_active = 38;
                rf_release = 37;
            } combo_run(Rapidfire);
        } else {                                                  // PRIMARY
            if(event_active(BUTTON_5)) {
                rf_active = wcfg[6];
                rf_release = wcfg[7];
            } combo_run(Rapidfire);
        }
    } else combo_stop(Rapidfire);
 
    // - COMMON MODS - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    if(key_status(KEY_OPENBRACKET)) {
        set_val(BUTTON_5, 100.0);                             // HAIR TRIGGGER
    }
    if(get_actual(BUTTON_8)) {
        if(get_actual(BUTTON_8) >= 100.00) {
            set_val(BUTTON_9, 100.0);                         // HOLD BREATH
        }
        set_val(BUTTON_8, 100.0);                             // HAIR TRIGGGER
    }
 
    // - DPAD SHORTCUT - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    static bool do_grenade;
    if(get_actual(BUTTON_7)) {
        if(event_active(BUTTON_7)) {
            do_grenade = TRUE;
        }
        if(get_actual(BUTTON_21)) {
            do_grenade = FALSE;
            set_val(BUTTON_10, 100.0);
        }
        if(get_actual(BUTTON_15)) {
            do_grenade = FALSE;
            set_val(BUTTON_13, 100.0);
            set_val(BUTTON_15, 0.0);
        }
        if(get_actual(BUTTON_17)) {
            do_grenade = FALSE;
            set_val(BUTTON_12, 100.0);
            set_val(BUTTON_17, 0.0);
        }
        if(get_actual(BUTTON_4)) {
            do_grenade = FALSE;
            set_val(BUTTON_11, 100.0);
            set_val(BUTTON_4, 0.0);
        }
        set_val(BUTTON_7, 0.0);
        if(get_actual(BUTTON_6)) {
            do_grenade = FALSE;
            set_val(BUTTON_7, 100.0);
            set_val(BUTTON_6, 0.0);
        }
    } else if(do_grenade) {
        do_grenade = FALSE;
        if(time_active(BUTTON_7) < 400) {
            combo_run(GrenadeRelease);
        }
    }
 
    // - COMMAND ROSE  - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    static bool reinforcement;
    if(get_val(BUTTON_4)) {
        if(time_release(BUTTON_4) < 156) {
            reinforcement = TRUE;
        } if(reinforcement) set_val(BUTTON_7, 100.0);
        if(time_active(BUTTON_4) > 228) {
            combo_restart(CommandRose);
        }
    } else reinforcement = FALSE;
 
    // - END OF MAIN - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    END_OF_MAIN:;
}
 
/******************************************************************************
 * COMBOS
 ******************************************************************************/

combo AirPlaneChangeView {
    set_val(BUTTON_9, 100.0);
    wait(38);
}
 
combo AirPlaneSwitchWeapon {
    wait(38);
    set_val(BUTTON_14, 100.0);
    wait(38); wait(38);
}
 
combo WeaponSecondary {
    call(WeaponPrimary);
    wait(37);
    set_val(BUTTON_14, 100.0);
    wait(38);
}
 
combo WeaponPrimary {
    set_val(BUTTON_14, 100.0);
    wait(38); wait(38);
    set_val(BUTTON_11, 100.0);
    wait(38); wait(38);
    set_val(BUTTON_11, 100.0);
    wait(38);
}
 
combo StanceToggle {
    set_val(BUTTON_6, 100.0);
    wait(38);
}
 
combo StanceSlide {
    set_val(BUTTON_6, 100.0);
    wait(38); wait(38);
    set_val(BUTTON_6, 100.0);
    wait(38);
}
 
combo Rapidfire {
    set_val(BUTTON_5, 100.0);
    wait(rf_active);
    set_val(BUTTON_5, rf_release ? 0.0 : 100.0);
    wait(rf_release);
    set_val(BUTTON_5, rf_release ? 0.0 : 100.0);
}
 
combo GrenadeRelease {
    set_val(BUTTON_7, 100.0);
    wait(38);
}
 
combo CommandRose {
    set_val(STICK_1_X, get_val(STICK_2_X));
    set_val(STICK_1_Y, get_val(STICK_2_Y));
    set_val(STICK_2_X, 0.0);
    set_val(STICK_2_Y, 0.0);
    wait(256);
}
 
ConsoleTuner Support Team
User avatar
J2Kbr
General of the Army
General of the Army
 
Posts: 20323
Joined: Tue Mar 18, 2014 1:39 pm

Re: BF5 flying with a plane with Mouse

Postby jelly44 » Fri Jun 19, 2020 10:58 am

Hey folks, I currently play BFV on PS4 with the Battlefield V (PS4) input translator.

Would I need to change the script J2Kbr shared above in order to play with planes only and use the input translator?

I think what I most interested in knowing is whether I'd have to be constantly moving in mouse in order to move the nose of the plane.

Thanks a lot!
- My recommendation for learning C programming: 'C Programming Absolute Beginner's Guide'
- Create your own scripts with GPC2 Scripting
User avatar
jelly44
Sergeant Major of the Army
Sergeant Major of the Army
 
Posts: 220
Joined: Tue Feb 05, 2019 3:49 pm

Re: BF5 flying with a plane with Mouse

Postby bonefisher » Sun Jun 21, 2020 1:41 am

The script above has it's own translator so you don't need anything else!
bonefisher
Lieutenant General
Lieutenant General
 
Posts: 5413
Joined: Thu Jan 29, 2015 10:49 am

Re: BF5 flying with a plane with Mouse

Postby jelly44 » Sun Jun 21, 2020 8:38 am

Thanks for the reply, bonefisher!
- My recommendation for learning C programming: 'C Programming Absolute Beginner's Guide'
- Create your own scripts with GPC2 Scripting
User avatar
jelly44
Sergeant Major of the Army
Sergeant Major of the Army
 
Posts: 220
Joined: Tue Feb 05, 2019 3:49 pm

Re: BF5 flying with a plane with Mouse

Postby vans130816 » Sun Jan 17, 2021 3:43 am

i am getting an error message

what's wrong help please
User avatar
vans130816
Sergeant
Sergeant
 
Posts: 6
Joined: Sun Jan 17, 2021 2:42 am

Re: BF5 flying with a plane with Mouse

Postby Mad » Sun Jan 17, 2021 4:23 am

vans130816 wrote:i am getting an error message

what's wrong help please

Compiles fine for me. Make sure you're copying the entire script.
ConsoleTuner Support Team || ConsoleTuner Discord || InputSense Discord
Mad
Major General
Major General
 
Posts: 4536
Joined: Wed May 22, 2019 5:39 am

Re: BF5 flying with a plane with Mouse

Postby vans130816 » Mon Jan 18, 2021 11:52 pm

Mad wrote:
vans130816 wrote:i am getting an error message

what's wrong help please

Compiles fine for me. Make sure you're copying the entire script.






I've done everything and even then says 12 error :ashamed:
User avatar
vans130816
Sergeant
Sergeant
 
Posts: 6
Joined: Sun Jan 17, 2021 2:42 am

Re: BF5 flying with a plane with Mouse

Postby J2Kbr » Tue Jan 19, 2021 12:06 pm

Please copy and paste the errors messages so we can help you to fix. Thanks.
ConsoleTuner Support Team
User avatar
J2Kbr
General of the Army
General of the Army
 
Posts: 20323
Joined: Tue Mar 18, 2014 1:39 pm

Next

Return to GPC2 Script Programming

Who is online

Users browsing this forum: No registered users and 176 guests