XBOX 1 Elite Controller with Paddles on PS4

GPC1 script programming for Titan One. Code examples, questions, requests.

XBOX 1 Elite Controller with Paddles on PS4

Postby shadowzach7 » Sun Jun 23, 2019 12:14 am

So basically I found a script on this forum a while ago for NBA 2K19 that allowed saving a shot timing and then getting consistent greens with that same player. I am trying to use the XBOX 1 Elite Paddles to perform various actions related to the script. I have Paddle 2 remapped to XB1 X with the actual xbox remapping so both buttons work, the other paddles are unmapped. For some reason though it appears the paddles don't get picked up or work at all. Any help is appreciated. Oh and I have tried get_val instead of event_press and same problem. I thought you could use the paddles for scripts while they were unmapped?

Here is the code I currently have,
Code: Select all
 
define SHOT_BUTTON  = XB1_X;                       
define timelimit= 300;
define HoldTime = 150;
 
int b_Zapis;
int w_StandingStill;
int w_recordedTime;
int b_Standing;
int CanUse1;                                                                                   
int Edit_On;                               
 
init
{
     w_StandingStill = get_pvar(SPVAR_1, 0,4000,0);
}
 
main
{
    set_val(TRACE_1,w_StandingStill/10);
    set_val(TRACE_3,w_recordedTime/10);
    set_val(TRACE_5,b_Standing);
    set_val(TRACE_6,Edit_On);
 
    if(abs(get_val(XB1_LX))<80 && abs(get_val(XB1_LY))<80)
        {           
            b_Standing=TRUE;                                     
        }
    else
        {                                                     
            b_Standing=FALSE;                                   
        }                                                         
 
    if(b_Standing && CanUse1)
        {
            if(w_StandingStill > HoldTime)
            {
                if(get_val(XB1_P2) && get_ptime(XB1_P2)>= w_StandingStill)
                {
                    set_val(XB1_P2,0);
                }
            }
        }                             
 
    if(get_val(XB1_P2) && get_ptime(XB1_P2) > HoldTime)
    {
        b_Zapis=TRUE;
    }
 
    if(b_Zapis)
    {
        if(event_release(XB1_P2))
        {
            b_Zapis=FALSE;
            w_recordedTime=get_ptime(20);
        }
    }
 
    // Record / Delete
    if(event_press(XB1_P1))
    {
        w_StandingStill = w_recordedTime;
        CanUse1=TRUE;
    }
    //if(event_press())
    //{
    //    w_StandingStill=0;
    //    CanUse1=FALSE;
    //}
    //
 
    // Adjust shot time
    if(event_press(XB1_P3))
    {
        w_StandingStill = w_StandingStill + 1;
        Edit_On = TRUE;
    }
    if(event_press(XB1_P4))
    {
        w_StandingStill = w_StandingStill - 1;
        Edit_On = TRUE;
    }
    //
    if(Edit_On == TRUE)
    {
        combo_run(Save_Timing);
    } 
}
combo Save_Timing
{
     if(w_StandingStill> HoldTime) set_pvar(SPVAR_1, w_StandingStill);
     Edit_On = FALSE;
}
 

I found the script I modified it from.
This is the original script that works but does not make use of paddles,
Code: Select all
 
/* Perfect Shot
 
You want to record the shot immediately after you have taken the shot and have greened it.
The shot does not have to be saved into memory if you want to change the shot timing frequently.
 
After you have recorded your standing shot or/and moving shot, you'll want to load it from memory
(Hold D-Pad Up and Press Share)
 
To perform the perfect standing shot you hold square and it will release at the correct time.
To perform the moving shot you just have to hold your stick in a direction while you shoot holding square should release at correct time.
 
Record Standing Shot (Hold D-Pad Up and Press Square)
Record Moving Shot (Hold D-Pad Up and Press Triangle)
 
INCREASE STANDING SHOT MS
Hold R3 + D-RIGHT increase +2 ms.
Hold R3 + D-LEFT decrease -2 ms.
 
INCREASE MOVING SHOT MS
Hold R3 + D-UP   increase +2 ms.
Hold R3 + D-DOWN decrease -2 ms.
 
Save Shot into Memory (Hold D-Pad Up and Press Options)
Load Shot from Memory (Hold D-Pad Up and Press Share)
 
RESET RECORDED SHOTS
(Hold D-Pad Up and Press Cross(X))
*/

 
define SHOT_BUTTON  = XB1_X;                 
define holdBtnA     = XB1_LT;         
define timelimit=300;
define HoldTime = 150;
 
 
int b_Zapis;
int w_StandingStill;
int w_RunningShot;
int w_recordedTime;
int b_Standing;
int CanUse1,CanUse2;                                                                                   
int Edit_On;                               
 
init
{
     w_StandingStill = get_pvar(SPVAR_1, 0,4000,0);
     w_RunningShot   = get_pvar(SPVAR_2, 0,4000,0);
}
 
 
main
{
set_val(TRACE_1,w_StandingStill/10);
set_val(TRACE_2,w_RunningShot/10);
set_val(TRACE_3,w_recordedTime/10);
set_val(TRACE_5,b_Standing);
set_val(TRACE_6,Edit_On);
 
    if(abs(get_val(XB1_LX))<80 && abs(get_val(XB1_LY))<80)
      {           
          b_Standing=TRUE;                                     
      }
          else
        {                                                     
            b_Standing=FALSE;                                   
        }                                                         
 
    if(b_Standing && CanUse1)
      {
          if(w_StandingStill > HoldTime)
      {
          if(get_val(XB1_X) && get_ptime(XB1_X)>= w_StandingStill)
          {
            set_val(XB1_X,0);
        }
      }
      }
    else if(!b_Standing && CanUse2)
    {
        if(w_RunningShot > HoldTime)
        {
            if(get_val(XB1_X) && get_ptime(XB1_X)>= w_RunningShot)
            {
            set_val(XB1_X,0);
            }
        }
    }                             
 
    if(get_val(XB1_X) && get_ptime(XB1_X) > HoldTime)b_Zapis=TRUE;
 
     if(b_Zapis)
     {
       if(event_release(XB1_X))
       {
          b_Zapis=FALSE;
          w_recordedTime=get_ptime(20);
       }
    }
 
    if(get_val(XB1_UP))
    { 
          if( event_press(SHOT_BUTTON))
          {
          w_StandingStill = w_recordedTime;
          CanUse1=TRUE;
          }
 
          if( event_press(XB1_Y))
          {
          w_RunningShot = w_recordedTime;
          CanUse2=TRUE;
          }
 
          if( event_press(XB1_MENU))
          {
              combo_run(Save_Timing);
          }
 
          if( event_press(XB1_VIEW))
          {
             if(w_StandingStill> HoldTime) CanUse1=TRUE;
             if(w_RunningShot> HoldTime) CanUse2=TRUE;
          }
 
          if( event_press(XB1_A))
          {
           w_StandingStill=0;
            CanUse1=FALSE;
          }
 
          if( event_press(XB1_B))
          {
           w_RunningShot=0;
           CanUse2=FALSE;
          }
          set_val(XB1_A,0);
          set_val(XB1_B,0);
          set_val(XB1_VIEW,0);
          set_val(XB1_MENU,0);
          set_val(XB1_Y,0);
          set_val(SHOT_BUTTON,0);
    }
 
 
    if(get_val(XB1_RS))
    {
        if(event_press(XB1_UP))
        {
              w_RunningShot = w_RunningShot + 2;
              Edit_On =TRUE;
        }
 
        if(event_press(XB1_DOWN))
        {
              w_RunningShot = w_RunningShot - 2;
              Edit_On =TRUE;
        }
 
        if(event_press(XB1_RIGHT))
        {
              w_StandingStill = w_StandingStill + 2;
              Edit_On =TRUE;
        }
 
        if(event_press(XB1_LEFT)) 
        {
              w_StandingStill = w_StandingStill - 2;
              Edit_On =TRUE;
        }
 
    }
    else if(Edit_On )
    {
        combo_run(Save_Timing);
    } 
}
combo Save_Timing
{
     if(w_StandingStill> HoldTime) set_pvar(SPVAR_1, w_StandingStill);
     if(w_RunningShot> HoldTime) set_pvar(SPVAR_2, w_RunningShot);
     Edit_On = FALSE;
}
 


Basically at the end of the day I want to be able to use the normal shoot button for shooting off of my own timing with other players and have the P2 which is mapped to X with xbox accessories through the controller profile be used to execute the recorded standing still shot time. I dont care for the other features like storing moving shot time, etc in the original script.
User avatar
shadowzach7
Sergeant
Sergeant
 
Posts: 9
Joined: Sun Jun 23, 2019 12:07 am

Re: XBOX 1 Elite Controller with Paddles on PS4

Postby J2Kbr » Sat Jun 29, 2019 12:01 pm

I tested with Elite controller and worked as expected, the paddles are being recognized. Please check using Gtuner's Device Monitor if you is able to see the XB_P1, XB_P3, XB_P4 being activated when pressing the corresponding paddles.
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: XBOX 1 Elite Controller with Paddles on PS4

Postby shadowzach7 » Sat Jun 29, 2019 7:01 pm

Yes it appears to show up in device monitor just fine.
Last edited by shadowzach7 on Sat Jun 29, 2019 7:15 pm, edited 1 time in total.
User avatar
shadowzach7
Sergeant
Sergeant
 
Posts: 9
Joined: Sun Jun 23, 2019 12:07 am

Re: XBOX 1 Elite Controller with Paddles on PS4

Postby shadowzach7 » Sat Jun 29, 2019 7:14 pm

Nevermind! Sorry to have wasted your time. I simply needed to release paddle 2 and xb1 X. Thanks for the response! Made me realize my error. However I still wanna ask, is their a way so that I can press P4 and not activate PS4 touch but still have it be useful for the script? Thank you!
User avatar
shadowzach7
Sergeant
Sergeant
 
Posts: 9
Joined: Sun Jun 23, 2019 12:07 am

Re: XBOX 1 Elite Controller with Paddles on PS4

Postby shadowzach7 » Sat Jun 29, 2019 7:28 pm

Nevermind just unmapped the PS4_SHARE button and then remapped PS4_TOUCH. Works perfect now!
User avatar
shadowzach7
Sergeant
Sergeant
 
Posts: 9
Joined: Sun Jun 23, 2019 12:07 am

Re: XBOX 1 Elite Controller with Paddles on PS4

Postby J2Kbr » Sun Jun 30, 2019 12:58 am

:smile0517:
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 GPC1 Script Programming

Who is online

Users browsing this forum: No registered users and 79 guests