Mike CV Script Detects scope but doesn’t change Zoom

GCV scripting for Gtuner IV and Titan Two. Configuration, examples, questions.

Mike CV Script Detects scope but doesn’t change Zoom

Postby pigy33 » Tue Mar 15, 2022 12:25 am

So the Mike CV script works fine except some reason when I switch to a scope that’s higher than 1X it changes the name of the script but says it’s still 1X ex: Generic (1X) -> Bruiser (1X) and it makes 2-4X scopes have only 1X recoil comp when recoil comp needs to be doubled to quadrupled.

This one is a doozy for me so :smile0203: :smile0203: :smile0203: to anyone who can help me!
User avatar
pigy33
Sergeant First Class
Sergeant First Class
 
Posts: 25
Joined: Tue Mar 20, 2018 9:58 pm

Re: Mike CV Script Detects scope but doesn’t change Zoom

Postby pigy33 » Tue Mar 15, 2022 4:15 am

I think I figured out that my .gpc script isn't setup to work with apex_antirecoil_m.py

How would I get them to talk to each other better? At the moment I can set in my .gpc script the Horizontal/Vertical ADS and also hip fire values thanks to Mad :D. However, changing the values in the .py script doesn't do anything

Here is my script
Code: Select all
#include <keyboard.gph>
#include <mouse.gph>
#define Speed 22// Cross speed (50= 50 ms)
 
#define M_X 0
#define M_Y 1
#define M_W 2
#define M_1 3
#define M_2 4
#define M_3 5
 
// adjust scale here !!! usb hid mouse/keyboard is a lot different than raw or controller data so it may not work at all !
fix32 HSCALE = 0.0245; // horizontal scale
fix32 VSCALE = 0.00760; // vertical scale
 
// DO NOT EDIT
bool    mb1;
bool    passthru, mouseout;
int32 m[] = { 0, 0, 0, 0, 0, 0};
 
int16 hoffset, voffset;
fix32 hf, vf;
fix32 hr, vr;
int8 arDirX=0;
int8 arDirY=0;
fix32 ValYreal;
fix32 ValXreal;
 
init {
    keymapping();
    const uint8 mmap[] = {
        MBUTTON_1, BUTTON_5,
    }; mousemapping(mmap);   
}
 
main {   
    key_passthru();
 
    static bool rapidfire;
    if(gcv_ready()) {
        switch(gcv_read(0)) {
            case 0: {
                rapidfire = gcv_read(1);
            } break;
            case 1: {
                printf("unsupported data set selected in .py");
            } break;
            case 2: {
                gcv_read(1, &hoffset);
                gcv_read(3, &voffset);
                hf = HSCALE * (fix32)hoffset;
                vf = VSCALE * (fix32)voffset;
            } break;
        }
    }
 
   if(mouse_status(MBUTTON_1) && !mouse_status(MBUTTON_2)) {
        HSCALE = 0.9; // horizontal scale
        VSCALE = 0.9; // vertical scale
    }       
 
    if(mouse_status(MBUTTON_1) && mouse_status(MBUTTON_2)) {
        HSCALE = 0.0245; // horizontal scale
        VSCALE = 0.00765; // vertical scale
    }
 
    if(key_status(KEY_2)) {
        key_set(KEY_SPACEBAR, TRUE);
    }
 
    if(key_status(KEY_SPACEBAR)){
        combo_run(TurboCross);
    }
 
    if(elapsed_time()) {
        m[M_X]=0;
        m[M_Y]=0;
        m[M_W]=0;
        m[M_1]=0;
        m[M_2]=0;
        m[M_3]=0;
 
        if (mouse_status(MREPORT_UPDATED)) {
            passthru = TRUE;
            m[M_X]=mouse_status(MOUSE_X);
            m[M_Y]=mouse_status(MOUSE_Y);
            m[M_W]=mouse_status(MOUSE_WHEEL);
            m[M_1]=mouse_status(MBUTTON_1);
            m[M_2]=mouse_status(MBUTTON_2);
            m[M_3]=mouse_status(MBUTTON_3);
        }
 
        if(mouse_status(MBUTTON_1)) {
            if(rapidfire) combo_run(c_Rapidfire);
            fMouseAntiRecoil();
        } else {
            hr = 0.0; vr = 0.0;
            combo_stop(c_Rapidfire);
        }
 
        if (passthru || mouseout) {
            passthru = FALSE;
            mouseout = FALSE;
            fMouseOut();
        }
    }
}
 
void fMouseAntiRecoil() {
    static bool lastMB1=FALSE;
    if (!lastMB1 && mouse_status(MBUTTON_1)) {
        lastMB1=TRUE;
        ValXreal = ValYreal = 0.0;
    }
 
    if (!mouse_status(MBUTTON_1)) { lastMB1=FALSE; return; }
 
    ValXreal += (fix32)(hf);
    ValYreal += (fix32)(vf);
 
    if (abs(ValYreal) >= 1.0) {
        mouseout=TRUE;
        if (vf < 0.0) {
            if (arDirY != -1) ValYreal = 0.0;
            arDirY = -1;
            m[M_Y] += (int)ceil((ValYreal));
        }
        else if (vf > 0.0) {
            if (arDirY != 1) ValYreal = 0.0;
            arDirY = 1;
            m[M_Y] += (int)floor((ValYreal));
        }
        ValYreal = mod(ValYreal,1.0);
    } 
 
    if (abs(ValXreal) >= 1.0) {
        mouseout=TRUE;
        if (hf < 0.0) {
            if (arDirX != -1) ValXreal = 0.0;
            arDirX = -1;
            m[M_X] += (int)ceil((ValXreal));
        }
        else if (hf > 0.0) {
            if (arDirX != 1) ValXreal = 0.0;
            arDirX = 1;
            m[M_X] += (int)floor((ValXreal));
        }
        ValXreal = mod(ValXreal,1.0);
    }
}
 
combo c_Rapidfire {
    mb1 = TRUE;
    mouseout = TRUE;
    wait(0);
    wait(50);
    mb1 = FALSE;
    mouseout = TRUE;
    wait(0);
    wait(50);
}
 
combo TurboCross {               
    key_set(KEY_SPACEBAR, TRUE);
    wait(Speed);
    key_set(KEY_SPACEBAR, FALSE);
    wait(Speed);
}
 
void fMouseOut() {
    mouse_set(MOUSE_X,m[M_X]);
    mouse_set(MOUSE_Y,m[M_Y]);
    mouse_set(MOUSE_WHEEL,m[M_W]);
    if (c_Rapidfire) {
        mouse_set(MBUTTON_1, mb1);
    } else {
        mouse_set(MBUTTON_1, mouse_status(MBUTTON_1));
    }
    uint8 mb;
    for (mb=MBUTTON_2;mb<=MBUTTON_16;mb++) {
        mouse_set(mb,mouse_status(mb));
    }
}
User avatar
pigy33
Sergeant First Class
Sergeant First Class
 
Posts: 25
Joined: Tue Mar 20, 2018 9:58 pm

Re: Mike CV Script Detects scope but doesn’t change Zoom

Postby Qzkago » Wed Mar 16, 2022 2:52 pm

pigy33 wrote:but says it’s still 1X ex: Generic (1X) -> Bruiser (1X) and it makes 2-4X scopes have only 1X recoil comp when recoil comp needs to be doubled to quadrupled.


probably an issue with the optic detection from the image. Especially if it can detect the weapon but not the optic

pigy33 wrote:However, changing the values in the .py script doesn't do anything

Are you changing the 1x, 2x, 3x etc or HSCALE/VSCALE? changing HSCALE/VSCALE will not do anything so long as you have
(and the other one too)
Code: Select all
if(mouse_status(MBUTTON_1) && !mouse_status(MBUTTON_2)) {
        HSCALE = 0.9; // horizontal scale
        VSCALE = 0.9; // vertical scale
    }   

in your main{

Try michael's update to the CV script, he added options for hipfire and ADS sensitivity
User avatar
Qzkago
Staff Sergeant
Staff Sergeant
 
Posts: 11
Joined: Mon Sep 20, 2021 12:55 pm

Re: Mike CV Script Detects scope but doesn’t change Zoom

Postby pigy33 » Wed Mar 16, 2022 10:52 pm

Qzkago wrote:
pigy33 wrote:but says it’s still 1X ex: Generic (1X) -> Bruiser (1X) and it makes 2-4X scopes have only 1X recoil comp when recoil comp needs to be doubled to quadrupled.


probably an issue with the optic detection from the image. Especially if it can detect the weapon but not the optic

pigy33 wrote:However, changing the values in the .py script doesn't do anything

Are you changing the 1x, 2x, 3x etc or HSCALE/VSCALE? changing HSCALE/VSCALE will not do anything so long as you have
(and the other one too)
Code: Select all
if(mouse_status(MBUTTON_1) && !mouse_status(MBUTTON_2)) {
        HSCALE = 0.9; // horizontal scale
        VSCALE = 0.9; // vertical scale
    }   

in your main{

Try michael's update to the CV script, he added options for hipfire and ADS sensitivity


I'm already using micheal's "apex_antirecoil_M.py* script and the optic detection is working fine as when I have out the 3X scope it shows "HCOG RANGER (1X)" but the zoom doesn't work fine as it should be "(3X) they are separated since there are some optics that have variable zooms.

Is this a glitch in general with Micheal's script or just my problem? As I just copied the script over as is and it still does this where it recognizes the Optics but never changes the Zoom to account for it.
User avatar
pigy33
Sergeant First Class
Sergeant First Class
 
Posts: 25
Joined: Tue Mar 20, 2018 9:58 pm

Re: Mike CV Script Detects scope but doesn’t change Zoom

Postby Qzkago » Thu Mar 17, 2022 3:16 pm

pigy33 wrote:when I have out the 3X scope it shows "HCOG RANGER (1X)" but the zoom doesn't work fine as it should be "(3X)

I think I understand your issue now. When I ADS, the "HCOG RANGER (1X)" -> "HCOG RANGER (3X)" but in your situation, it is stuck at "HCOG RANGER (1X)" which I am guessing is why you have
Code: Select all
 
    if(mouse_status(MBUTTON_1) && mouse_status(MBUTTON_2)) {
        HSCALE = 0.0245; // horizontal scale
        VSCALE = 0.00765; // vertical scale
    }
 

to compensate for the lack of sensitivity change.

Did you try this script? Values may take some tweaking but this script works well for me
https://www.consoletuner.com/greslib/?w773

Are you using Michael's Feb 9, 2022 version? There shouldn't be any issues with his script or CV especially since I am using a modified version from SEP 2021
https://www.consoletuner.com/greslib/?w1232
User avatar
Qzkago
Staff Sergeant
Staff Sergeant
 
Posts: 11
Joined: Mon Sep 20, 2021 12:55 pm

Re: Mike CV Script Detects scope but doesn’t change Zoom

Postby pigy33 » Thu Mar 17, 2022 7:34 pm

Did you try this script? Values may take some tweaking but this script works well for me
https://www.consoletuner.com/greslib/?w773


I basically am as I'm using Sachi's GPC script that he posted in my other forum post: viewtopic.php?f=15&t=18136 I don't ever use "game pack" scripts and have also tried the other script put in the main Apex Legends CV post for HID Output.

Are you using Michael's Feb 9, 2022 version? There shouldn't be any issues with his script or CV especially since I am using a modified version from SEP 2021
https://www.consoletuner.com/greslib/?w1232


Yes, I tried the one from September 8th too and still the same issue, I use a capture card and just tried using PS4 Remote Play and while the image looked crisp and clean in HD it still showed up as "Bruiser (1X)".

Is there a way to force 2X zoom when I have the Bruiser scope equipped and 3X when I have the HCOG RANGER scope equipped? I don't use the variable zoom scopes so if someone would be kind enough to modify the complex "apex_antirecoil_M.py" to do this then I think I'd be all set :D.
User avatar
pigy33
Sergeant First Class
Sergeant First Class
 
Posts: 25
Joined: Tue Mar 20, 2018 9:58 pm

Re: Mike CV Script Detects scope but doesn’t change Zoom

Postby Qzkago » Fri Mar 18, 2022 12:27 pm

pigy33 wrote:I basically am as I'm using Sachi's GPC script that he posted in my other forum post: viewtopic.php?f=15&t=18136

Try the script I linked, Scachi made it as well but there is a ~3 month difference. There is some differences but I do not feel like copy-pasting all the changes in the code here

pigy33 wrote:Is there a way to force 2X zoom when I have the Bruiser scope equipped and 3X when I have the HCOG RANGER scope equipped? I don't use the variable zoom scopes so if someone would be kind enough to modify the complex "apex_antirecoil_M.py" to do this then I think I'd be all set :D.

Fix 1 issue and 2 more will take it's place. Try changing this code in "apex_antirecoil_M.py"
Code: Select all
# Track Magnification (Zoom)
            if woptics and gtuner.get_actual(gtuner.BUTTON_8):
                if woptics == 1:
                    wzoomag = 1
                elif woptics == 2:
                    if self.ztrack():
                        wzoomag = 1
                elif woptics == 3:
                    wzoomag = 2
                elif woptics == 4:
                    if self.ztrack():
                        wzoomag = 3
                    else:
                        wzoomag = 1

to
Code: Select all
# Track Magnification (Zoom)
            if woptics:
                if woptics == 1:
                    wzoomag = 1
                elif woptics == 2:
                    if self.ztrack():
                        wzoomag = 1
                elif woptics == 3:
                    wzoomag = 2
                elif woptics == 4:
                    if self.ztrack():
                        wzoomag = 3
                    else:
                        wzoomag = 1

I'll guess that the gtuner.get_actual(gtuner.BUTTON_8) in this section is tracking the ADS action, so taking it out will force the script to constantly track the magnification zoom.
User avatar
Qzkago
Staff Sergeant
Staff Sergeant
 
Posts: 11
Joined: Mon Sep 20, 2021 12:55 pm


Return to Gtuner Computer Vision

Who is online

Users browsing this forum: Google Feedfetcher and 63 guests

cron