Could someone please explain?

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

Could someone please explain?

Postby Justin420time » Sun Oct 23, 2022 2:12 am

Why is it the TitanTwo can make the STICK_2_Y hold at -100.00 with this code here:
Code: Select all
 
 // WORKING CODE
    if (MOVESTICKFORWARD) {
        if (check_active(BUTTON_7,500)) {
            set_val(XB1_LY, -100.00);
        }
    }


And not this code here:
Code: Select all
 
 // NOT WORKING CODE
    if (MOVESTICKFORWARD) {
        if (check_active(BUTTON_7,500)) {
            set_val(STICK_2_Y, -100.00);
        }
    }
 


First code with XB1_LY works, but when I try STICK_2_Y it doesn't do anything...

Do I have something wrong with my scripts?
paypal.me/xkjtx
UserBenchmarks:Game 96%,Desk 95%,Work 90%
CPU:AMD Ryzen 5 3600XT-87.5%
GPU:Nvidia RTX 3060-104.1%
RAM:Unknown 8G 135-K 4x8GB-94.7%
MBD:Gigabyte GA-B550 AORUS PRO AC
User avatar
Justin420time
First Sergeant
First Sergeant
 
Posts: 44
Joined: Fri Nov 02, 2018 6:48 pm

Re: Could someone please explain?

Postby Mad » Sun Oct 23, 2022 7:29 am

Both codes are fine. Probably defined STICK_2_Y as something else in your script.
ConsoleTuner Support Team || ConsoleTuner Discord || InputSense Discord (2K / FPS)
Mad
Major General
Major General
 
Posts: 4533
Joined: Wed May 22, 2019 5:39 am

Re: Could someone please explain?

Postby Justin420time » Sun Oct 23, 2022 12:19 pm

Mad wrote:Both codes are fine. Probably defined STICK_2_Y as something else in your script.


I thought that too, but couldn't find anything.. Also, it doesn't set anything to -100 in button list, so I am thinking it might be one of my included files.. I have to check.. Thought there was something else wrong, but if you say they should both work, I got something wrong on in one of my scripts.
paypal.me/xkjtx
UserBenchmarks:Game 96%,Desk 95%,Work 90%
CPU:AMD Ryzen 5 3600XT-87.5%
GPU:Nvidia RTX 3060-104.1%
RAM:Unknown 8G 135-K 4x8GB-94.7%
MBD:Gigabyte GA-B550 AORUS PRO AC
User avatar
Justin420time
First Sergeant
First Sergeant
 
Posts: 44
Joined: Fri Nov 02, 2018 6:48 pm

Re: Could someone please explain?

Postby Justin420time » Thu Oct 27, 2022 10:47 am

Wow, now I am getting a "Ghost" button pressed when my combo is running.

I do not even have "BUTTON_11" in my script or anything that would lead to
that button, and its being pressed.. I delete combo code, then retype exactly
the same and combo works again without BUTTON_11 being pressed..

**WIRED HAPPENINGS**: "Ghost" Button added to my code that I never added and
couldn't see listed in the code. (I searched the code with the search function)
Very weird..

**FIX**: When this happens, I delete and retype all BUTTON's in the combo and code
starts working again.

I hope you understand that? Thanks for reading..

-Justin
paypal.me/xkjtx
UserBenchmarks:Game 96%,Desk 95%,Work 90%
CPU:AMD Ryzen 5 3600XT-87.5%
GPU:Nvidia RTX 3060-104.1%
RAM:Unknown 8G 135-K 4x8GB-94.7%
MBD:Gigabyte GA-B550 AORUS PRO AC
User avatar
Justin420time
First Sergeant
First Sergeant
 
Posts: 44
Joined: Fri Nov 02, 2018 6:48 pm

Re: Could someone please explain?

Postby Scachi » Thu Oct 27, 2022 8:07 pm

I never had issues with "ghost button presses" and never heard of anyone having an issue like that.
I think you do have a bug somewhere in your code.
if this would be caused by some firmware/general issue it would have been reported several times already as a lot of people do scripts for the T2 for quite a long time now without any similar issue reported.

Some time ago an issue existed with some xbox button getting unresponsive/stuck I think but that is the only thing I know that was close to what you are reporting.

To avoid getting the T2 to lag/get unresponsive:
Make sure to not spam set led or set rumble commands every main run.
Do not output too many printf statements to the output panel.
Using unoptimized code with key_status, rumble status or led status functions.
Decouple resource intensive function calls (like rumble, led) into combos instead if possible to not trigger the functions calls on input events of gyro/sensor data that can cause the T2 to run the main loop faster than 1ms as that then can cause cpu usages spikes and some hard to track down lags)
User avatar
Scachi
Brigadier General
Brigadier General
 
Posts: 3044
Joined: Wed May 11, 2016 6:25 am
Location: Germany

Re: Could someone please explain?

Postby Justin420time » Thu Oct 27, 2022 9:45 pm

Scachi wrote:I never had issues with "ghost button presses" and never heard of anyone having an issue like that.
I think you do have a bug somewhere in your code.
if this would be caused by some firmware/general issue it would have been reported several times already as a lot of people do scripts for the T2 for quite a long time now without any similar issue reported.

Some time ago an issue existed with some xbox button getting unresponsive/stuck I think but that is the only thing I know that was close to what you are reporting.

To avoid getting the T2 to lag/get unresponsive:
Make sure to not spam set led or set rumble commands every main run.
Do not output too many printf statements to the output panel.
Using unoptimized code with key_status, rumble status or led status functions.
Decouple resource intensive function calls (like rumble, led) into combos instead if possible to not trigger the functions calls on input events of gyro/sensor data that can cause the T2 to run the main loop faster than 1ms as that then can cause cpu usages spikes and some hard to track down lags)


I will record it so you can see when it happens and what code I have.. I created a NEW file and only put that code in(copy and pasted), and it would create the same "ghost key" effect, but when I retyped it in, instead of Copy Paste, it works normal!

Like I said, its been very strange and I believe I do have my own bug that is in my main scripts that load with Gtuner..

Even though I reinstalled everything over again, still its doing the same "Ghost" buttons that I never put in the code..

Its always the D-PAD buttons that get pushed.. Kinda strange, because I have no D-Pad buttons in my code at all!

-Justin

P.S. I have
GIGABYTE B550 AORUS Pro AC
** AMD Ryzen:tm: 5 3600XT(3.8ghz-4.5ghz) **
** GEFORCE GTX 1050 TI GAMING X (4G)**

I mine with this computer, so I understand what I am working with..

P.S.S I also have issues with "combo_stop" commands not working at all.. Then I restarted Gtuner and the "combo_stop" started working again.
paypal.me/xkjtx
UserBenchmarks:Game 96%,Desk 95%,Work 90%
CPU:AMD Ryzen 5 3600XT-87.5%
GPU:Nvidia RTX 3060-104.1%
RAM:Unknown 8G 135-K 4x8GB-94.7%
MBD:Gigabyte GA-B550 AORUS PRO AC
User avatar
Justin420time
First Sergeant
First Sergeant
 
Posts: 44
Joined: Fri Nov 02, 2018 6:48 pm

Re: Could someone please explain?

Postby Scachi » Thu Oct 27, 2022 9:57 pm

Can't see what mining has to do with gpc2 scripting.
Just trying to understand your issue.. being able to get an idea what is going on I need some details on how you are using the T2.
So you are using the T2 on PC ? Output Protocol set to xbox360 ?
Output and Prog prog connected to the same PC running gtuner ?
Using kmg capture or keyboard mouse directly connected to T2 or gamepad connect directly to T2 via usb or bluetooth ?

Feel free to msg me on discord and send me your script and setup details and I will try to reproduce the issue: Scachi#6830

...


Your ghost button press may be a result of you use the titanone.gph header combined with T2 gpc identifiers.
This would explain your issue you have posted in your first post as well.
Do not use titanone.gph and gpc2 io identifiers.
If you do coding for T2 just use plain gpc2 code and function without using titanone.gph header.

Example what causes issues:
Code: Select all
#include <titanone.gph>
 
main {
    // XB1 keywords are getting translated to T1 outputs and handled correctly by titanone.gph set_val version
    //  T2 identifiers are not translated and will result in wrogn output being performed by titanone.gph set_val version
    set_val(XB1_LY, -100.00)// translates to T1: index 11, Stick Left Y
    set_val(STICK_2_Y, -100.00); // not translated, wrong result: index 24, Gyro X
}
User avatar
Scachi
Brigadier General
Brigadier General
 
Posts: 3044
Joined: Wed May 11, 2016 6:25 am
Location: Germany

Re: Could someone please explain?

Postby Justin420time » Thu Oct 27, 2022 10:44 pm

Scachi wrote:Can't see what mining has to do with gpc2 scripting.
Just trying to understand your issue.. being able to get an idea what is going on I need some details on how you are using the T2.
So you are using the T2 on PC ? Output Protocol set to xbox360 ?
Output and Prog prog connected to the same PC running gtuner ?
Using kmg capture or keyboard mouse directly connected to T2 or gamepad connect directly to T2 via usb or bluetooth ?

Feel free to msg me on discord and send me your script and setup details and I will try to reproduce the issue: Scachi#6830


Thank you! Yes, I will let you know exactly when it happens next time, but when I get a problem, I try to figure it out before I post anything.. I am posting this after I fixed it myself with retyping the code and restarting Gtuner.. Thats what fixes it..

I am coding for hours with Gtuner, and hitting the compile button many times. So I am sure its an over time issue..

Yes, I will get on Discord and show you when it happens, the next time. Its pretty crazy.. Like I said before I even created a new GPC file and put just that code in that was making issues and it still didnt work properly until I retyped the whole code again.. So weird..

Yes, T2 with PC using my XboxOneX controller connected with brand new USB(I disconnected the BlueTooth chip).

I love this thing!

-Justin
paypal.me/xkjtx
UserBenchmarks:Game 96%,Desk 95%,Work 90%
CPU:AMD Ryzen 5 3600XT-87.5%
GPU:Nvidia RTX 3060-104.1%
RAM:Unknown 8G 135-K 4x8GB-94.7%
MBD:Gigabyte GA-B550 AORUS PRO AC
User avatar
Justin420time
First Sergeant
First Sergeant
 
Posts: 44
Joined: Fri Nov 02, 2018 6:48 pm


Return to GPC2 Script Programming

Who is online

Users browsing this forum: No registered users and 119 guests