Execute gpc combo when button is pressed and a color changed

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

Execute gpc combo when button is pressed and a color changed

Postby mentos265 » Fri Feb 12, 2021 8:44 pm

I dont even know how to start, could someone pls provide an example for running a combo execution when a button is pressed and part of a lifebar is changed to the color red?

Thx
User avatar
mentos265
Sergeant Major
Sergeant Major
 
Posts: 72
Joined: Sat Jul 25, 2015 6:38 am

Re: Execute gpc combo when button is pressed and a color cha

Postby J2Kbr » Mon Feb 15, 2021 11:02 am

mentos265 wrote:I dont even know how to start, could someone pls provide an example for running a combo execution when a button is pressed and part of a lifebar is changed to the color red?

Thx

First, you need create an GCV (Python Computer Vision Script) to monitor the lifebar color (this shouldn't be hard). The GCV script should then communicate to the GPC (Titan Two script) when the lifebar is red. This is done by passing a byte array at the second element of the returning tuple, for example:

lifebar NOT red:
Code: Select all
return (frame, bytearray([0x00]))

lifebar IS red:
Code: Select all
return (frame, bytearray([0x01]))

On the Titan Two script you can read this value as the following:
Code: Select all
main {
    // GCV Feedback
    if(gcv_ready()) {
        if(gcv_read(0) == 0x01) {
            combo_run(MyCombo);
        }
    }
}
 
combo MyCombo {
    //
    // Coombo sequence here
    //
}
 
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: Execute gpc combo when button is pressed and a color cha

Postby mentos265 » Wed Feb 17, 2021 1:36 pm

The game only captures at 13 FPS, so I went ahead and made an autohotkey script. Is it possible to make the titan two communicate with it?
User avatar
mentos265
Sergeant Major
Sergeant Major
 
Posts: 72
Joined: Sat Jul 25, 2015 6:38 am

Re: Execute gpc combo when button is pressed and a color cha

Postby Scachi » Wed Feb 17, 2021 2:10 pm

Just use GTuner IV : Computer Vision. Python + opencv.
This can do the same as/better job than your autohotkey script as you can easily communicate with the T2.

Speed of capturing depends on the method / device used for capturing your games video.
Default usb3.0 hdmi capture speed is 60fps. Window capture is limited to 30fps.
Check your capture device configuration.
Your resulting speed in GTuner IV depends also on your GPU, CPU and your python code.
User avatar
Scachi
Brigadier General
Brigadier General
 
Posts: 3044
Joined: Wed May 11, 2016 6:25 am
Location: Germany


Return to Gtuner Computer Vision

Who is online

Users browsing this forum: No registered users and 39 guests