Self loading anti-recoil!

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

Re: Self loading anti-recoil!

Postby TrayDay » Sat Apr 27, 2019 11:26 pm

teckx wrote:
bonefisher wrote:
Code: Select all
 
#pragma METAINFO("APEX LEGENDS rumble anti recoil", 1, 0, "bonefisher")
 
#define float  fix32
#define wait(a)  wait((int)a);
//Anti Recoil
bool bUseAntiRecoil = 1;
uint16 ARecoilDelay = 0;
float MinARecoilPercent = 20.0;
float StickNoise = 7.00;
 
main {
  //////////////////////////////////////////////////////////////////////////
    //Anti Recoil
    //////////////////////////////////////////////////////////////////////////
    if (bUseAntiRecoil)
    {
        if (get_actual(BUTTON_5) && time_active(BUTTON_5) >= ARecoilDelay)
        {
            if (abs(get_actual(STICK_1_X)) < StickNoise) set_val(STICK_1_X, 0.0);
            if (abs(get_actual(STICK_1_Y)) < StickNoise) set_val(STICK_1_Y, 0.0);
            if (abs(get_actual(STICK_2_X)) < StickNoise) set_val(STICK_2_X, 0.0);
            if (abs(get_actual(STICK_2_Y)) < StickNoise) set_val(STICK_2_Y, 0.0);
 
        if(ffb_get(FFB_1, NULL) > 27.0 && ffb_get(FFB_1, NULL) < 29.0)
        {
            if(get_actual(BUTTON_5))combo_run(RapidFire);
            AntiRecoil(STICK_1_X, 0.0);
            AntiRecoil(STICK_1_Y, 55.0);
        }
        if(ffb_get(FFB_1, NULL) > 29.0 && ffb_get(FFB_1, NULL) < 30.0)
        {
            if(get_actual(BUTTON_5))combo_run(RapidFire);
            AntiRecoil(STICK_1_X, 0.0);
            AntiRecoil(STICK_1_Y, 40.0);
        }
        if(ffb_get(FFB_1, NULL) > 30.0 && ffb_get(FFB_1, NULL) < 35.0)
        {
            if(get_actual(BUTTON_5))combo_run(RapidFire);
            AntiRecoil(STICK_1_X, 0.0);
            AntiRecoil(STICK_1_Y, 38.0);
        }
        if(ffb_get(FFB_1, NULL) > 39.0 && ffb_get(FFB_1, NULL) < 40.0)
        {
            if(get_actual(BUTTON_5))combo_run(RapidFire);
            AntiRecoil(STICK_1_X, 0.0);
            AntiRecoil(STICK_1_Y, 32.0);
        }
        }
    }
}
 
combo RapidFire
{
    set_val(BUTTON_5, 100.0);
    wait(40.0);
    set_val(BUTTON_5, 0.0);
    wait(40.0);
    set_val(BUTTON_5, 0.0);
}
 
void AntiRecoil(uint8 AxisToApply, float ARecoilToApply)
{
    float CurrentX = get_val(STICK_1_X);
    float CurrentY = get_val(STICK_1_Y);
    float MinARecoilFactor = MinARecoilPercent / 100.0;
    float MinARecoilToApply = MinARecoilFactor * ARecoilToApply;
    //This sets the ARecoil to be dependent on both X and Y axis movement. With more emphasis on Y
    float MovementARecoilToApply = (1.0 - MinARecoilFactor) * ((ARecoilToApply * (100.0 - sqrt(CurrentX*CurrentX + CurrentY*CurrentY))) / (100.0 + abs(CurrentX) + (CurrentY*CurrentY*0.5)));
    set_val(AxisToApply,clamp(MinARecoilToApply + MovementARecoilToApply + get_val(AxisToApply),-100.00,100.00 - MinARecoilToApply));
}
 

Ok you need to setup for yourself by either going in private match or someway of testing. This needs to be also hooked up to pc to see the monitor for ffb_1 strength which each gun has different strengths for recoil but the ones alike are the same for what I came across so far. You need your rumble on the T2 and in game for it to work! THis is a example for APEX LEGENDS is why I had to put a rapid fire for each because a lot use same recoil and rumble strength. I actually really liked how Battlefield came out because the automatics and semi-autos were separate. Really was neat that I didn't have to set up again and whatever weapon I jumped on it was spot on!



How do you connect the xbox controller to PC while playing the game and registering the ffb strength?
is your script already setup for xbox 1?

Simply, have two usb's. One for the ps4 plug into the output, and the PC plug into the prog slot in the back of the Titan Two. You need two USB's cables for this. One for PS4 and One for PC.

Image
User avatar
TrayDay
First Sergeant
First Sergeant
 
Posts: 60
Joined: Wed Nov 02, 2016 11:12 pm

Re: Self loading anti-recoil!

Postby teckx » Thu May 02, 2019 1:05 pm

antithesis wrote:Go to Global Settings in XIM Manager and enable Rumble Passthrough.
Enable FFB on INPUT-A in Gtuner IV, assuming that's the port you've plugged your Apex into the T2.


I connect M+KB to T2 then T2 to XIM w/ controller into xbox

i have binds for mouse + kb thats why i do this

is there a way for my m+kb binds to still work if i have them on the xim first then connected to the T2?
User avatar
teckx
Sergeant Major of the Army
Sergeant Major of the Army
 
Posts: 194
Joined: Tue Mar 27, 2018 1:53 pm

Re: Self loading anti-recoil!

Postby anderson78 » Sat May 04, 2019 4:55 am

Any more updates on this since? (for simpletons like myself)

@DontAtMe - Your earlier xbox one script detected all 6 weapon-groups in Apex Legends, did you ever get around to adding the anti-recoil values?

If anyone else is happy with their completed Apex Legends Xbox script could you please post it here, it would be greatly appreciated
User avatar
anderson78
Corporal
Corporal
 
Posts: 5
Joined: Sat Apr 13, 2019 11:49 pm

Re: Self loading anti-recoil!

Postby teckx » Sat May 04, 2019 3:33 pm

SEems like a dead thread
User avatar
teckx
Sergeant Major of the Army
Sergeant Major of the Army
 
Posts: 194
Joined: Tue Mar 27, 2018 1:53 pm

Re: Self loading anti-recoil!

Postby bonefisher » Sat May 04, 2019 4:26 pm

It's not dead just doing other long builds that I should of never started!
bonefisher
Lieutenant General
Lieutenant General
 
Posts: 5413
Joined: Thu Jan 29, 2015 10:49 am

Re: Self loading anti-recoil!

Postby teckx » Sat May 04, 2019 6:29 pm

bonefisher wrote:It's not dead just doing other long builds that I should of never started!

Sweet. Thanks Hey when you get a chance could you take a look at my question above. Wondering if I can use this script with my mouse binds

M
User avatar
teckx
Sergeant Major of the Army
Sergeant Major of the Army
 
Posts: 194
Joined: Tue Mar 27, 2018 1:53 pm

Re: Self loading anti-recoil!

Postby undazpoon » Tue May 07, 2019 2:20 am

Unfortunately, the controller rumble does not work with Xim Apex on PS4, even I turned on rumble option on Xim manager. If I detach Xim Apex, this script runs well. I'll continue trying!
User avatar
undazpoon
Sergeant First Class
Sergeant First Class
 
Posts: 19
Joined: Fri Nov 18, 2016 2:52 am

Re: Self loading anti-recoil!

Postby bonefisher » Tue May 07, 2019 3:08 am

Code: Select all
 
#pragma METAINFO("Red Dot Fire", 1, 0, "bonefisher")
 
main
{
    if(get_actual(BUTTON_5))
    {
        set_val(BUTTON_5, 0.0);
        if(ffb_get_actual(FFB_2, NULL) <= 31.37)
        {
            combo_run(fire);
        }
        if(ffb_get_actual(FFB_1, NULL) >= 31.37)
        {
            combo_run(fire);
        }
    }
}
 
combo fire
{
    set_val(BUTTON_5, 100.0);
    wait(50);
}
 
 

This test was done on Xbox One X! I was trying to find a way which I'm to beat up and sick at the moment to think... To generate rumbles working when aiming where when the red rectical comes up it fires without the the start up of first bullet to get rumbles rolling. Anyway at the moment we can call this the bullet saver lol! This is for BO4 automatics( for most of them) and works in reverse of semi-autos which can work with different set up around to work. So it will fire pre-shots slow til it lights up the rectical red which is the hit box then it turns into firing full unless you come off of aim then goes back to firing on bullet slow fire. It's pretty cool so maybe you brainy acts can come up with something to make this better... :smile0517:
bonefisher
Lieutenant General
Lieutenant General
 
Posts: 5413
Joined: Thu Jan 29, 2015 10:49 am

Re: Self loading anti-recoil!

Postby bonefisher » Tue May 07, 2019 7:53 am

Haha! Use it on the spitfire which it retards the fire not having any recoil on it and once your on target fires full.
bonefisher
Lieutenant General
Lieutenant General
 
Posts: 5413
Joined: Thu Jan 29, 2015 10:49 am

Re: Self loading anti-recoil!

Postby teckx » Fri May 10, 2019 12:31 pm

bonefisher wrote:Haha! Use it on the spitfire which it retards the fire not having any recoil on it and once your on target fires full.


does your controller plug into Titan or your mouse? Also are you using apex?

im going KB&M -> T2 T2 & Controller -> APEX -> Xbox
User avatar
teckx
Sergeant Major of the Army
Sergeant Major of the Army
 
Posts: 194
Joined: Tue Mar 27, 2018 1:53 pm

PreviousNext

Return to GPC2 Script Programming

Who is online

Users browsing this forum: No registered users and 127 guests