Problem with User101's rumble-based rapidfire script

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

Problem with User101's rumble-based rapidfire script

Postby TheBruhhh » Wed Jul 14, 2021 11:26 am

I shot over a message to User about this but I he hasn't been online in a couple of days, hoping there's someone who's familiar with the script that can help me here! I'm referring to this script viewtopic.php?f=26&t=12475&p=83908#p83908

So the rapidfire on Black ops 4 seems to activate regardless of what weapon I'm using under two specific circumstances.

First is when I toggle in and out of ADS while firing. I've used the log stat function and I noticed when I toggle in and out of ADS while firing, the rate of fire spikes to 200-400 frequently when the rapidfire would usually activate regardless of the weapon I'm using.

Also occurs when I hold trigger from being in sprint. I use a XIM and I've tried running a subconfig where L3 is unbound while holding R2 but it doesn't help. Same thing happens where I get ROF spikes of 200-400 where the rapidfire would normally trigger without the log on.

I also tried without the XIM and just plugging a controller straight into the Titan Two, but no luck.

Any help appreciated, I love the idea of this script and really want to get it working!!

Code: Select all
#pragma METAINFO("Users Rapid Fire", 1, 0, "USER101")
/********************************USERS RAPID FIRE*****************************************/
/*
<cfgdesc>   
[USERS RAPID FIRE]
collapsible = 0
shortdesc    = <<<MULTILINE
<b><font style="font-size:30px">USERS RAPID FIRE</font>
Licensing/Usage:
    - Open source code.
    - Still in beta and unoptimized.
    - Free to use and modify.
    - Please DO NOT distribute for profit.
 
    If you use this code please credit:
    @User101 - for concept and creation of "Users Rapid Fire"
MULTILINE
color        = #000000
control        = info
 
[RATE OF FIRE]
shortdesc    = <b>RATE OF FIRE:</b> Increase this number until your slowest automatic weapon no longer stutters while firing. Or, enable the log stat below to see the rate of fire of your slowest fully automatic weapon and set this a few milliseconds higher than the highest number displayed.
byteoffset    = 0
bitsize        = 8
control        = slider
default        = 121
minimum        = 0
maximum        = 300
step        = 1
 
[RAPID FIRE SETTINGS]
shortdesc    = <b>RAPID FIRE HOLD TIME:</b> (ms)
byteoffset    = 2
bitsize        = 16
control        = spinbox
decimals    = 1
default        = 20
minimum        = 0
maximum        = 200
step        = 1
 
[RELEASE TIME]
group        = true
shortdesc    = <b>RAPID FIRE RELEASE TIME:</b> (ms)
byteoffset    = 4
bitsize        = 16
control        = spinbox
decimals    = 1
default        = 20
minimum        = 0
maximum        = 200
step        = 1
 
[LOG STAT]
shortdesc   = <b>RATE OF FIRE LOG:</b> While this is enabled it will show your rate of fire in the Output Panel within Gtuner. This must be diabled for the automatic rapid fire to work.
byteoffset  = 1
bitsize     = 1
bitoffset   = 0
control     = checkbox
default     = 0
item        = Enable
 
</cfgdesc>
*/

bool RapidFire = FALSE;
bool WaitModifier = FALSE;
bool LogStat = FALSE;
 
uint8 RapidTimer = 0;
 
uint16 RumbleTimer = 0;
uint16 HoldTime = 0;
uint16 ReleaseTime = 0;
 
fix32 Rumble;
fix32 OldRumble;
 
init{
    pmem_load();
    pmem_read(0, &RapidTimer);
    pmem_read(1, &LogStat);
    pmem_read(2, &HoldTime);
    pmem_read(4, &ReleaseTime);
}
 
main {
    if(is_active(BUTTON_5)){
        if(ffb_get(FFB_1, NULL) > 0.0 && !WaitModifier) {
            WaitModifier = TRUE;
        }
        if(WaitModifier) {
            RumbleTimer += elapsed_time();
            if(ffb_get_actual(FFB_1, NULL) > 0.0)Rumble = ffb_get_actual(FFB_1, 0)*255f/100f;
            if(Rumble > OldRumble){
                OldRumble = Rumble;
                if(LogStat)printf("Rate of Fire:<b> %d</b> ms",RumbleTimer);
                RumbleTimer = 0;
            }
            else if(Rumble < OldRumble)OldRumble = Rumble;
        if(RumbleTimer >= RapidTimer && !LogStat)RapidFire = TRUE;
        }
    }
    if(RapidFire){
        combo_run(Rapid_Fire);
    }
 
    if(event_release(BUTTON_5)){
        RapidFire = FALSE;
        combo_stop(Rapid_Fire);
        RumbleTimer = 0;
        WaitModifier = FALSE;
        OldRumble = 0.0;
    }
}
combo Rapid_Fire {
    set_val(BUTTON_5,100);
    wait(HoldTime);
    set_val(BUTTON_5,0);
    wait(ReleaseTime);
}
 
Last edited by TheBruhhh on Wed Jul 14, 2021 3:11 pm, edited 1 time in total.
User avatar
TheBruhhh
First Sergeant
First Sergeant
 
Posts: 65
Joined: Sun Nov 24, 2019 1:28 pm

Re: Problem with User101's rumble-based rapidfire script

Postby antithesis » Wed Jul 14, 2021 11:33 am

If it’s a GBC file, only User101 can fix it.
Official Australian retailer for Titan One, Titan Two and XIM APEX at Mod Squad
User avatar
antithesis
Colonel
Colonel
 
Posts: 1912
Joined: Sat May 28, 2016 10:45 pm

Re: Problem with User101's rumble-based rapidfire script

Postby TheBruhhh » Wed Jul 14, 2021 3:12 pm

antithesis wrote:If it’s a GBC file, only User101 can fix it.


Oh it's just an open source GPC2 script, I've edited the first post to add it in, he's given permission in the post to edit etc. Should have done that to start with,sorry!
User avatar
TheBruhhh
First Sergeant
First Sergeant
 
Posts: 65
Joined: Sun Nov 24, 2019 1:28 pm

Re: Problem with User101's rumble-based rapidfire script

Postby TheBruhhh » Tue Jul 20, 2021 2:11 am

Still having trouble if anyone can help, User hasn't been online in the last week unfortunately.
User avatar
TheBruhhh
First Sergeant
First Sergeant
 
Posts: 65
Joined: Sun Nov 24, 2019 1:28 pm

Re: Problem with User101's rumble-based rapidfire script

Postby bonefisher » Tue Jul 20, 2021 4:04 pm

nothing wrong with it you just need to adjust in the IC if your going that high usually is at 120....
bonefisher
Lieutenant General
Lieutenant General
 
Posts: 5413
Joined: Thu Jan 29, 2015 10:49 am

Re: Problem with User101's rumble-based rapidfire script

Postby TheBruhhh » Sat Jul 24, 2021 11:27 pm

Went to try the above, sure I've done it before but figured I'd try again. This script is driving me insane. Now it's just refusing to work, literally doing nothing, even the log stat function is just giving me nothing. Any other script I try in the memory slot I run it on works fine. This script before was running, not as I wanted it to but it was doing something. I've been trying to just get it to run flawlessly for months.
User avatar
TheBruhhh
First Sergeant
First Sergeant
 
Posts: 65
Joined: Sun Nov 24, 2019 1:28 pm


Return to GPC2 Script Programming

Who is online

Users browsing this forum: Majestic-12 [Bot] and 106 guests