Recoil help

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

Recoil help

Postby mofotyler » Wed Feb 17, 2021 10:00 pm

I'm using the T1 and have a few good scripts I use regularly but the one I dont have is for semi auto. I'm looking for recoil control for 1 single shot instead for as long as you hold the trigger. So I would pull the trigger and the recoil would adjust for a set amount and time immediately when I pull the trigger. This way after each pull of the tigger the reticle will move back on it's own and I can choose my rate of fire as needed
User avatar
mofotyler
Corporal
Corporal
 
Posts: 5
Joined: Thu Jan 21, 2021 8:23 am

Re: Recoil help

Postby Mad » Tue Feb 23, 2021 9:04 am

Hi,

Here is a basic example:
Code: Select all
define VERTICAL = 20;
 
main { if(event_press(XB1_RT)) combo_run(AR); }
 
combo AR {
    set_val(XB1_RY, VERTICAL);
    wait(100);
}
ConsoleTuner Support Team || ConsoleTuner Discord || InputSense Discord
Mad
Major General
Major General
 
Posts: 4536
Joined: Wed May 22, 2019 5:39 am

Re: Recoil help

Postby mofotyler » Fri Feb 26, 2021 1:02 pm

Mad wrote:Hi,

Here is a basic example:
Code: Select all
define VERTICAL = 20;
 
main { if(event_press(XB1_RT)) combo_run(AR); }
 
combo AR {
    set_val(XB1_RY, VERTICAL);
    wait(100);
}




Ty so much I am new to this and have spent a few days looking at scripts and learning how they work. After using it I decided I liked it adjustable on the fly...Only question is how do I make it so when i press Rt to fire it does not overlap with the antirecoil? On BF5 i will shoot and bullet will be lower than where i aimed do to antirecoil kicking in same time as i fire


Code: Select all
// Single shot abjustable recoil
 
 
//Hold VIEW and press LEFT to toggle on/off
//Hold Y and press UP/DOWN to increase and decrease recoil
//Hold B and press UP/DOWN to increase and decrease wait time (50ms at a time)
 
//Only active when aiming (LT)
 
 
define ONLY_WHEN_AIM = TRUE;
 
int VERTICAL = 20;
int MS = 300;
int SEMIRECOIL_ENABLE = TRUE;
 
main {
    if(get_val(1)  && event_press(15))  {
        SEMIRECOIL_ENABLE=!SEMIRECOIL_ENABLE;
        }   
    if(!ONLY_WHEN_AIM || get_val(7) && get_val(4 )) {
        combo_run(AR);
        }   
    if(get_val(17)){ 
        if(event_press(13)){
            VERTICAL = VERTICAL +1;
        }
        if(event_press(14)){
            VERTICAL = VERTICAL -1;
            }
        }
 
    if(get_val(18)){ 
        if(event_press(13)){
            MS = MS +50;
            }
        if(event_press(14)){
            MS = MS -50;
            }
        }
    }
 
 
combo AR {
    if(SEMIRECOIL_ENABLE)
    set_val(XB1_RY, VERTICAL);
    wait(MS);
}
 
 
User avatar
mofotyler
Corporal
Corporal
 
Posts: 5
Joined: Thu Jan 21, 2021 8:23 am


Return to GPC1 Script Programming

Who is online

Users browsing this forum: No registered users and 84 guests