Temporarily disable left analog up/down while holding fire?

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

Temporarily disable left analog up/down while holding fire?

Postby TheBruhhh » Thu Mar 26, 2020 5:01 pm

Hi folks, this is basically a short script request. Sometimes when using rapid fire on a burst fire weapon, if I'm sprinting and then start firing while still holding the left analog forward, my character will keep sprinting forward between bursts because the sprint is still active.

So basically I was looking for a script that disables the left analog Y axis (up/down) input for a split second when the R2 button is pressed, just long enough to cancel the sprint so that my character doesn't try to sprint between shots when using rapid fire on a burst weapon. You can take a guess as to what this value might be and I can then edit and test the script until it's working perfectly, but I'm unsure of how to set it up in the first place.

Thanks for any help!
User avatar
TheBruhhh
Master Sergeant
Master Sergeant
 
Posts: 28
Joined: Sun Nov 24, 2019 1:28 pm

Re: Temporarily disable left analog up/down while holding fi

Postby Mad » Thu Mar 26, 2020 9:20 pm

Code: Select all
if(time_active(4) < 300) {
    set_val(24, 0);
}
ConsoleTuner Support Team || Discord || Custom Scripts
Mad
Colonel
Colonel
 
Posts: 1676
Joined: Wed May 22, 2019 5:39 am

Re: Temporarily disable left analog up/down while holding fi

Postby TheBruhhh » Fri Mar 27, 2020 12:53 am

Mad wrote:
Code: Select all
if(time_active(4) < 300) {
    set_val(24, 0);
}


Spot on as usual Mad, thanks! Did some tweaking and 100 seems to be the perfect value.
User avatar
TheBruhhh
Master Sergeant
Master Sergeant
 
Posts: 28
Joined: Sun Nov 24, 2019 1:28 pm

Re: Temporarily disable left analog up/down while holding fi

Postby Mad » Fri Mar 27, 2020 1:09 am

TheBruhhh wrote:Spot on as usual Mad, thanks! Did some tweaking and 100 seems to be the perfect value.

You're welcome :joia: :joia:
ConsoleTuner Support Team || Discord || Custom Scripts
Mad
Colonel
Colonel
 
Posts: 1676
Joined: Wed May 22, 2019 5:39 am


Return to GPC2 Script Programming

Who is online

Users browsing this forum: No registered users and 23 guests