ADS script with delay?

Gtuner Plugins support. MaxAim, MaxRemapper, Combo Magick, Game Rec.

ADS script with delay?

Postby Aqid » Tue Nov 29, 2016 5:06 pm

I already posted this in another topic, but instead of hijacking it I figured I'd open my own. Alright, so I'm currently using MaxAim to play CoD on the XB1 and I'm getting stuck on the ADS (Aiming Down Sights) portion of the configuration. Once you aim down sights your sensitivity slows down. This is because of how the game handles controllers, but us K/M people are not used to that. So I found a script to up the sensitivity while aiming down sights. It was set at 110% but that wasn't nearly enough. I found 135% to be the sweet spot. There is one major issue with it tho, the script activates the moment you right click. But the game slowing down your aim does not kick in until you're actually aiming down the sights. Result: moment you press zoom there is a 0.1-0.2 second time frame where your regular sensitivity is boosted to 135% causing a mouse jerk. The wait command does not work inside the "main" and/or "if" statement (why not btw? I wish it did). So right now I have no idea how to solve that. If there's any experts out here I'd be happy to hear it.

My current ADS script:
Code: Select all
 
define ZOOM = XB1_LT; // Change this to your console, usually looking for the Left trigger
define X_AXIS = XB1_RX; // Change this to your console
define Y_AXIS = XB1_RY; // Change this to your console
 
 
main {
    if(get_val(ZOOM)) {
        sensitivity( X_AXIS, 0, 100)
        sensitivity( Y_AXIS, 0, 100)
        sensitivity( X_AXIS, 0, 135)
        sensitivity( Y_AXIS, 0, 135)     
    }
} 
 


As you can see I tried to fix it by setting it to 100% first and then 135% but that didn't really seem to do the job. I don't know how fast these commands process, I guess I could try setting it to 100% like 50 times to cause a delay. Haven't tried that yet. I was wondering if we could do some sort of while loop, but I'd need to know if the script can somehow get back that the game finished zooming. Just brain storming here, any input is welcome!
User avatar
Aqid
Sergeant
Sergeant
 
Posts: 8
Joined: Tue Nov 29, 2016 4:35 pm

Re: ADS script with delay?

Postby J2Kbr » Tue Nov 29, 2016 5:16 pm

You can use the function get_ptime to check for how long the button ZOOM has being pressed down.

http://www.consoletuner.com/kbase/i_o_f ... #get_ptime

For example, to apply the sensitivity modification only after 200ms the ZOOM has being pressed, you can do this:

Code: Select all
define ZOOM = XB1_LT; // Change this to your console, usually looking for the Left trigger
define X_AXIS = XB1_RX; // Change this to your console
define Y_AXIS = XB1_RY; // Change this to your console
 
main {
    if(get_val(ZOOM) && get_ptime(ZOOM) >= 200) {
        sensitivity( X_AXIS, 0, 135);
        sensitivity( Y_AXIS, 0, 135);     
    }
} 
 
ConsoleTuner Support Team
User avatar
J2Kbr
General of the Army
General of the Army
 
Posts: 20323
Joined: Tue Mar 18, 2014 1:39 pm

Re: ADS script with delay?

Postby Aqid » Tue Nov 29, 2016 9:45 pm

That is genius! Thanks, I'm going to try that. I'll let you know how that works.
User avatar
Aqid
Sergeant
Sergeant
 
Posts: 8
Joined: Tue Nov 29, 2016 4:35 pm

Re: ADS script with delay?

Postby Aqid » Tue Nov 29, 2016 9:55 pm

In order to make the switch more gradual, do you think the following code would work?

Code: Select all
 
define ZOOM = XB1_LT; // Change this to your console, usually looking for the Left trigger
define X_AXIS = XB1_RX; // Change this to your console
define Y_AXIS = XB1_RY; // Change this to your console
 
main {
    if(get_val(ZOOM) && get_ptime(ZOOM) >= 50) {
        sensitivity( X_AXIS, 0, 110);
        sensitivity( Y_AXIS, 0, 110);     
    }
    if(get_val(ZOOM) && get_ptime(ZOOM) >= 100) {
        sensitivity( X_AXIS, 0, 120);
        sensitivity( Y_AXIS, 0, 120);     
    }
    if(get_val(ZOOM) && get_ptime(ZOOM) >= 150) {
        sensitivity( X_AXIS, 0, 130);
        sensitivity( Y_AXIS, 0, 130);     
    }
    if(get_val(ZOOM) && get_ptime(ZOOM) >= 200) {
        sensitivity( X_AXIS, 0, 135);
        sensitivity( Y_AXIS, 0, 135);     
    }
} 
 


Also, if you specify sensitivity twice (or 4 times like here), is the second time you specify it the percentage of the base value or of the previous value? So, after 50ms it would be set to BASE x 110%, after 100ms would it be BASE x 120% or BASE x 110% x 120%?
User avatar
Aqid
Sergeant
Sergeant
 
Posts: 8
Joined: Tue Nov 29, 2016 4:35 pm

Re: ADS script with delay?

Postby Aqid » Wed Nov 30, 2016 6:20 am

That resulted in a lot of weirdness. The final script is perfect, it exactly skips that point and there is no mouse jerk.
Code: Select all
 
define ZOOM = XB1_LT; // Change this to your console, usually looking for the Left trigger
define X_AXIS = XB1_RX; // Change this to your console
define Y_AXIS = XB1_RY; // Change this to your console
 
 
main {
    if(get_val(ZOOM)) {
        sensitivity( X_AXIS, 50, 100)
        sensitivity( Y_AXIS, 50, 100)
        if(get_ptime(ZOOM) >= 100) {
            sensitivity( X_AXIS, 55, 150)
            sensitivity( Y_AXIS, 55, 150)
        }
    }
}
User avatar
Aqid
Sergeant
Sergeant
 
Posts: 8
Joined: Tue Nov 29, 2016 4:35 pm

Re: ADS script with delay?

Postby J2Kbr » Wed Nov 30, 2016 2:53 pm

Great!! :) Very glad to see you got it perfected!
ConsoleTuner Support Team
User avatar
J2Kbr
General of the Army
General of the Army
 
Posts: 20323
Joined: Tue Mar 18, 2014 1:39 pm


Return to Gtuner Plugins Support

Who is online

Users browsing this forum: No registered users and 84 guests