Will some kind person convert this script to titan 2 please

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

Will some kind person convert this script to titan 2 please

Postby Stopit33 » Mon May 01, 2023 9:53 am

Code: Select all
// Golf
 
/*
3-Click Golf swing with Toggle ON/OFF
 
Hold L3 and press TRIANGLE to Toggle 3-Click Golf swing ON/OFF
Press L2 for 100% swing
Press R2 for 103% swing
Press R1 for 107% swing
Press R3 for 110% swing
*/

 
int onoff;  // 3-Click Golf swing
 
 
main {
 
 
// 3-Click Golf swing ON/OFF
   if(get_val(PS4_L3)) {
   if(event_press(PS4_TRIANGLE)) {
   onoff = !onoff;                   // Toggle ( Activate Or Deactivate 3-Click Golf swing )
   }
   set_val(PS4_TRIANGLE,0)
   }   
 
// 3-Click Golf swing
   if(onoff) {
   if(event_press(PS4_L2))
   combo_run(swing_100);
 
   if(event_press(PS4_R2))
   combo_run(swing_103);
 
   if(event_press(PS4_R1))
   combo_run(swing_107);
 
   if(event_press(PS4_R3))
   combo_run(swing_110);
   }
   }
 
   combo swing_100 {      // swing that has a timing for 100%
   set_val(PS4_CROSS,100);
   wait(1000);            // Press the CROSS Button for 1000ms  / 1000=1sec. 500=0,5sec. 200=0,2sec.
   wait(40);              // Release the CROSS Button for 40ms  / 1000=1sec. 500=0,5sec. 200=0,2sec.
   set_val(PS4_CROSS,100);
   wait(1000);
   wait(40);
   set_val(PS4_CROSS,100);
   wait(1000);
   wait(40);
   }
 
   combo swing_103 {      // swing that has a timing for 103%
   set_val(PS4_CROSS,100);
   wait(500);             // Press the CROSS Button for 500ms  / 1000=1sec. 500=0,5sec. 200=0,2sec.
   wait(40);              // Release the CROSS Button for 40ms / 1000=1sec. 500=0,5sec. 200=0,2sec.
   set_val(PS4_CROSS,100);
   wait(500);
   wait(40);
   set_val(PS4_CROSS,100);
   wait(500);
   wait(40);
   }
 
   combo swing_107 {      // swing that has a timing for 107%
   set_val(PS4_CROSS,100);
   wait(400);             // Press the CROSS Button for 400ms  / 1000=1sec. 500=0,5sec. 200=0,2sec.
   wait(40);              // Release the CROSS Button for 40ms / 1000=1sec. 500=0,5sec. 200=0,2sec.
   set_val(PS4_CROSS,100);
   wait(400);
   wait(40);
   set_val(PS4_CROSS,100);
   wait(400);
   wait(40);
   }
 
   combo swing_110 {      // swing that has a timing for 110%
   set_val(PS4_CROSS,100);
   wait(200);             // Press the CROSS Button for 200ms  / 1000=1sec. 500=0,5sec. 200=0,2sec.
   wait(40);              // Release the CROSS Button for 40ms / 1000=1sec. 500=0,5sec. 200=0,2sec.
   set_val(PS4_CROSS,100);
   wait(200);
   wait(40);
   set_val(PS4_CROSS,100);
   wait(200);
   wait(40);
   }
User avatar
Stopit33
Sergeant
Sergeant
 
Posts: 6
Joined: Mon Mar 11, 2019 1:29 pm

Re: Will some king person convert this script to titan 2 ple

Postby MrBrgv » Mon May 22, 2023 3:48 pm

change all your event_press to event_active

add this above //Golf <ps4.gph>
User avatar
MrBrgv
Sergeant First Class
Sergeant First Class
 
Posts: 16
Joined: Sun Dec 27, 2020 9:32 pm

Re: Will some king person convert this script to titan 2 ple

Postby Stopit33 » Tue May 23, 2023 1:16 am

MrBrgv wrote:change all your event_press to event_active

add this above //Golf <ps4.gph>

thank you
User avatar
Stopit33
Sergeant
Sergeant
 
Posts: 6
Joined: Mon Mar 11, 2019 1:29 pm

Re: Will some king person convert this script to titan 2 ple

Postby Peter373637 » Thu Jun 01, 2023 12:58 pm

tried adjusting but still getting errors
User avatar
Peter373637
Corporal
Corporal
 
Posts: 4
Joined: Thu Oct 27, 2022 11:25 am

Re: Will some king person convert this script to titan 2 ple

Postby Scachi » Thu Jun 01, 2023 4:38 pm

remove that #include <ps4.gph> if you added it and add this instead:
Code: Select all
#include <titanone.gph>

also it is useful to show the actual error output if you are looking for help
User avatar
Scachi
Brigadier General
Brigadier General
 
Posts: 3044
Joined: Wed May 11, 2016 6:25 am
Location: Germany


Return to GPC2 Script Programming

Who is online

Users browsing this forum: No registered users and 93 guests