NBA 2K20 Shot timer (Request)

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

NBA 2K20 Shot timer (Request)

Postby itsPANDA » Sun Mar 29, 2020 7:14 pm

So in NBA 2K20 you hold a button (or right stick) to prepare a shot, when you do this a bar pops up that fills up showing you when your prime shot is. If you time your shot perfectly it turns green meaning its more than likely going in. So when thinking about it today I was wondering if it'd be possible to have a script that'd time the shot perfectly for me if not everytime at least everytime for atleast one player or shot type. The shot bar fills differently depending on what kind of shot you are taking or lay ups etc. If i were able to press X (xbox's x) to initiate its script to time the shot for me, i'd still be able to use the right stick to do manual shots, layups, dunks, dribbles etc. I dont know this was a thought I had and its also something i wouldnt know where to start on with coding. If someone has any knowledge on how to do this please feel free to give it a try if you'd like as I'd love to try it and im sure many other 2k fans would. Thanks.
User avatar
itsPANDA
Sergeant
Sergeant
 
Posts: 6
Joined: Wed Sep 25, 2019 3:57 am

Re: NBA 2K20 Shot timer (Request)

Postby Mad » Mon Mar 30, 2020 1:28 am

You can use this one to print out the hold time of X
Code: Select all
#include <xb1.gph>
 
main {
    if(event_release(XB1_X)) {
      printf("Held for %i ms", time_active(XB1_X));
    }
}

Then you could use this and change shot_time
Code: Select all
#include <xb1.gph>
 
#define shot_time 2000
 
main {
    if(event_active(XB1_X)) {
      combo_run(TimedShot);
    }
}
 
combo TimedShot {
    set_val(XB1_X, 100);
    wait(shot_time);
}
ConsoleTuner Support Team || ConsoleTuner Discord || InputSense Discord
Mad
Major General
Major General
 
Posts: 4536
Joined: Wed May 22, 2019 5:39 am

Re: NBA 2K20 Shot timer (Request)

Postby itsPANDA » Thu Apr 02, 2020 6:41 pm

So i put those 2 together what do i change or add?
User avatar
itsPANDA
Sergeant
Sergeant
 
Posts: 6
Joined: Wed Sep 25, 2019 3:57 am

Re: NBA 2K20 Shot timer (Request)

Postby Mad » Thu Apr 02, 2020 7:52 pm

itsPANDA wrote:So i put those 2 together what do i change or add?

No, use the first script by itself. Keep your T2 connected to the PC with Gtuner open. It will record the shot time and print it out in the output panel.

Then edit the second script "shot_time" with the value that was printed out.
ConsoleTuner Support Team || ConsoleTuner Discord || InputSense Discord
Mad
Major General
Major General
 
Posts: 4536
Joined: Wed May 22, 2019 5:39 am

Re: NBA 2K20 Shot timer (Request)

Postby chef_tonyo » Sun Apr 19, 2020 9:19 am

did it work?
User avatar
chef_tonyo
Sergeant
Sergeant
 
Posts: 6
Joined: Mon Dec 02, 2019 10:50 am

Re: NBA 2K20 Shot timer (Request)

Postby Buffy » Mon Apr 20, 2020 11:25 pm

chef_tonyo wrote:did it work?


You should try it :smile0517: looking forward to results.
ConsoleTuner Support Team || Discord || Custom Scripts
User avatar
Buffy
Lieutenant
Lieutenant
 
Posts: 422
Joined: Wed Jul 20, 2016 5:23 am


Return to GPC2 Script Programming

Who is online

Users browsing this forum: No registered users and 155 guests