Burst Fire (anti-spread) (combo) ran at different intervals

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

Burst Fire (anti-spread) (combo) ran at different intervals

Postby Derivates » Thu Apr 18, 2019 5:04 pm

So, I am back playing Overwatch and I'm looking forward to tweak every hero I play to give the best performance, I started with Soldier and the first thing I wanted to look up was countering his weapon spread.

Noticed Rapid-Fire is not an option for him because it actually makes the gun slower (very clever), so I realized the spread starts at around 500-600ms of R2 being held, so this is what I did: (after that period of 500-600ms I start a Rapid-Fire macro):

Code: Select all
bool RapidFire = TRUE;
main {
    if (RapidFire) {
        if (check_active(BUTTON_5, 575)) combo_run(cRapidFire);
            if (event_release(BUTTON_5)) combo_stop(cRapidFire);
}
combo cRapidFire {
  set_val(BUTTON_5,100);
  wait(64);
  set_val(BUTTON_5,0);
  wait(17);
}


After 575ms (of R2 being held) the Rapid-Fire combo will start and eventually counter the spread BUT on the other hand will decrease the RoF.. I'm looking forward to stop that macro after (i.e 250ms) then wait another 575ms (before spread comes again) and then run it again, if I didn't explain myself too-well, here's the thing:

1. Hold R2 for 575ms (max. time until spread appears)
2. After 575ms have passed, initiate the Rapid-Fire macro for (120ms) and then stop it
3. After those 120ms have passed (macro stopped), go back to step 1 and hold again for 575ms, and then repeat step 2.

This would a loop pretty much, I'm confident it's possible, just need to figure out how exactly timing works on here...

Any help is appreciated, thanks.
User avatar
Derivates
Sergeant Major
Sergeant Major
 
Posts: 75
Joined: Sat Jan 19, 2019 6:15 pm

Re: Burst Fire (anti-spread) (combo) ran at different interv

Postby antithesis » Thu Apr 18, 2019 11:48 pm

Dump the 575 hold check, it's not needed. Just use a regular rapid fire mod and set the hold time to 100ms per bullet, e.g if you want to fire in 5 bullet bursts, set the first wait to 500. The second wait also needs to be quite high to reset the bloom.

Code: Select all
 
 
#define SHOOT       BUTTON_5
 
//------------------------------------------------------------------------------
// AUTO-BURST
 
    // Fine-tune the time between bursts
    uint16 BurstHold = 450; // time in ms. Overwatch shoots 1 bullet / 100 ms
    uint16 BurstRest = 300;
 
//==============================================================================
// MAIN
 
main
{
 
if (get_val (SHOOT) { combo_run (AutoBurst); }
 
} // end main
 
//==============================================================================
// COMBOS
 
combo AutoBurst
{   
    set_val(SHOOT, 100);
    wait(BurstHold);
    set_val(SHOOT, 0);
    wait(BurstRest);
    set_val(SHOOT, 0);
}
 


Note that while burst-firing does improve accuracy by reducing bloom, it also nerfs Soldier's damage output in mid to close engagements. You'll also nerf his ultimate damage output.

You can turn the combo on & off with a toggle, but that's easy to mess up in an engagement. It's honestly better to manually burst or to simply keep firing. Watch the OW pros play Soldier, they don't bother with burst-firing.
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: Burst Fire (anti-spread) (combo) ran at different interv

Postby Derivates » Fri Apr 19, 2019 2:14 am

antithesis wrote:Dump the 575 hold check, it's not needed. Just use a regular rapid fire mod and set the hold time to 100ms per bullet, e.g if you want to fire in 5 bullet bursts, set the first wait to 500. The second wait also needs to be quite high to reset the bloom.

Code: Select all
 
 
#define SHOOT       BUTTON_5
 
//------------------------------------------------------------------------------
// AUTO-BURST
 
    // Fine-tune the time between bursts
    uint16 BurstHold = 450; // time in ms. Overwatch shoots 1 bullet / 100 ms
    uint16 BurstRest = 300;
 
//==============================================================================
// MAIN
 
main
{
 
if (get_val (SHOOT) { combo_run (AutoBurst); }
 
} // end main
 
//==============================================================================
// COMBOS
 
combo AutoBurst
{   
    set_val(SHOOT, 100);
    wait(BurstHold);
    set_val(SHOOT, 0);
    wait(BurstRest);
    set_val(SHOOT, 0);
}
 


Note that while burst-firing does improve accuracy by reducing bloom, it also nerfs Soldier's damage output in mid to close engagements. You'll also nerf his ultimate damage output.

You can turn the combo on & off with a toggle, but that's easy to mess up in an engagement. It's honestly better to manually burst or to simply keep firing. Watch the OW pros play Soldier, they don't bother with burst-firing.

Believe or not, what I'm using now suits better, I have 575ms of original dps, and then I use the combo to reduce bloom, the values for hold an release are wrong, but I've found this video that will become handy once I get home to fix this:
[YouTube]
https://youtu.be/2Hz7YCkHe5U
[/YouTube]

Now that you're here, do you know how would I merge a compilation of scripts I have for different operators (Soldier, Junkrat, etc...) I was thinking in assigning F1 for a soldier, F2 Junkrat and so on; I'm pretty sure I can make the hero bools to toggle between them...any IDEAS? Thanks a lot for your answer.
Last edited by Derivates on Fri Apr 19, 2019 7:03 am, edited 1 time in total.
User avatar
Derivates
Sergeant Major
Sergeant Major
 
Posts: 75
Joined: Sat Jan 19, 2019 6:15 pm

Re: Burst Fire (anti-spread) (combo) ran at different interv

Postby DontAtMe » Fri Apr 19, 2019 6:53 am

Derivates wrote:1. Hold R2 for 575ms (max. time until spread appears)
2. After 575ms have passed, initiate the Rapid-Fire macro for (120ms) and then stop it
3. After those 120ms have passed (macro stopped), go back to step 1 and hold again for 575ms, and then repeat step 2.

This would a loop pretty much, I'm confident it's possible, just need to figure out how exactly timing works on here...

Any help is appreciated, thanks.


This script should follow all 3 steps you listed.
Code: Select all
#define HOLD_FIRE_TIME  575
#define RAPID_FIRE_TIME 120
 
#define COMBO_HOLD_TIME    64
#define COMBO_RELEASE_TIME 17
//---------------------------------
// You should only need to adjust the definitions above.
 
main {
  uint16 hold_timer, macro_rapid_timer;
 
  if(is_active(BUTTON_5)){
      if(elapsed_time()){
        if(macro_rapid_timer){ combo_run(rapid_fire); --macro_rapid_timer; }
        if(!rapid_fire && !(++hold_timer%HOLD_FIRE_TIME)){
          macro_rapid_timer = RAPID_FIRE_TIME;
        }
      }
    if((int)get_actual(BUTTON_5) <= 25) { macro_rapid_timer = hold_timer = 0; }
  }
}
 
combo rapid_fire {
  set_val(BUTTON_5,0);
  wait(COMBO_RELEASE_TIME);
  wait(COMBO_HOLD_TIME);
}
Only things I was unsure of, were the combos Hold and Release times.
so I just used the same values that you used in your script.

and also you first mention the wait time should be 250ms
Derivates wrote:I'm looking forward to stop that macro after (i.e 250ms)

but then you seem to change this to 120ms?
Derivates wrote:initiate the Rapid-Fire macro for (120ms) and then stop it


The script is using 120ms.
You can change the definition at the top of the script, if it needs to be adjusted.
User avatar
DontAtMe
Captain
Captain
 
Posts: 502
Joined: Tue Oct 02, 2018 4:49 am

Re: Burst Fire (anti-spread) (combo) ran at different interv

Postby Derivates » Fri Apr 19, 2019 7:07 am

DontAtMe wrote:
Derivates wrote:1. Hold R2 for 575ms (max. time until spread appears)
2. After 575ms have passed, initiate the Rapid-Fire macro for (120ms) and then stop it
3. After those 120ms have passed (macro stopped), go back to step 1 and hold again for 575ms, and then repeat step 2.

This would a loop pretty much, I'm confident it's possible, just need to figure out how exactly timing works on here...

Any help is appreciated, thanks.


This script should follow all 3 steps you listed.
Code: Select all
#define HOLD_FIRE_TIME  575
#define RAPID_FIRE_TIME 120
 
#define COMBO_HOLD_TIME    64
#define COMBO_RELEASE_TIME 17
//---------------------------------
// You should only need to adjust the definitions above.
 
main {
  uint16 hold_timer, macro_rapid_timer;
 
  if(is_active(BUTTON_5)){
      if(elapsed_time()){
        if(macro_rapid_timer){ combo_run(rapid_fire); --macro_rapid_timer; }
        if(!rapid_fire && !(++hold_timer%HOLD_FIRE_TIME)){
          macro_rapid_timer = RAPID_FIRE_TIME;
        }
      }
    if((int)get_actual(BUTTON_5) <= 25) { macro_rapid_timer = hold_timer = 0; }
  }
}
 
combo rapid_fire {
  set_val(BUTTON_5,0);
  wait(COMBO_RELEASE_TIME);
  wait(COMBO_HOLD_TIME);
}
Only things I was unsure of, were the combos Hold and Release times.
so I just used the same values that you used in your script.

and also you first mention the wait time should be 250ms
Derivates wrote:I'm looking forward to stop that macro after (i.e 250ms)

but then you seem to change this to 120ms?
Derivates wrote:initiate the Rapid-Fire macro for (120ms) and then stop it


The script is using 120ms.
You can change the definition at the top of the script, if it needs to be adjusted.

Huge thanks bro, will test tomorrow when I wake up, I changed the values because any of those two were random values I'm looking forward to test, sorry if that made any misunderstandings, I think I forgot to mention but there should also be a macro stop if BUTTON_5 is released (like on my code above), don't know how to place it into yours :(
User avatar
Derivates
Sergeant Major
Sergeant Major
 
Posts: 75
Joined: Sat Jan 19, 2019 6:15 pm

Re: Burst Fire (anti-spread) (combo) ran at different interv

Postby DontAtMe » Fri Apr 19, 2019 7:52 am

Derivates wrote:I think I forgot to mention but there should also be a macro stop if BUTTON_5 is released (like on my code above), don't know how to place it into yours :(
This script already handles this condition, without the need of the combo_stop() function. :)
Which is why I did not bother including it.

But if you want to add it in anyways,
Just replace line (19) with this
Code: Select all
if((int)get_actual(BUTTON_5) <= 25) { macro_rapid_timer = hold_timer = 0combo_stop(rapid_fire);}
User avatar
DontAtMe
Captain
Captain
 
Posts: 502
Joined: Tue Oct 02, 2018 4:49 am

Re: Burst Fire (anti-spread) (combo) ran at different interv

Postby Derivates » Fri Apr 19, 2019 5:11 pm

DontAtMe wrote:
Derivates wrote:I think I forgot to mention but there should also be a macro stop if BUTTON_5 is released (like on my code above), don't know how to place it into yours :(
This script already handles this condition, without the need of the combo_stop() function. :)
Which is why I did not bother including it.

But if you want to add it in anyways,
Just replace line (19) with this
Code: Select all
if((int)get_actual(BUTTON_5) <= 25) { macro_rapid_timer = hold_timer = 0combo_stop(rapid_fire);}

Thanks.
User avatar
Derivates
Sergeant Major
Sergeant Major
 
Posts: 75
Joined: Sat Jan 19, 2019 6:15 pm


Return to GPC2 Script Programming

Who is online

Users browsing this forum: No registered users and 153 guests

cron