Need Golf timing script

Gtuner Pro general support. Operation, questions, updates, feature request.

Need Golf timing script

Postby TheBadger » Tue Oct 10, 2017 2:57 am

Hey! Was wondering how I would build a PS4 golf swing timing script for Everybody's Golf.

Script: Press X to start swing. Press X again to set power (0-100%). Press X a third time to try to hit the perfect impact point. The timing from the first press to the third press is the same every time.

Any ideas appreciated.
User avatar
TheBadger
Sergeant
Sergeant
 
Posts: 7
Joined: Wed Dec 09, 2015 8:00 am

Re: Need Golf timing script

Postby J2Kbr » Tue Oct 10, 2017 10:06 am

Hopefully I got this right, Please note the defines at the very beginning of the code where you can adjust the time between the X pressings and also the hold time to set the power.
Code: Select all
define TIME_BETWEEN_X_PRESS     = 500;
define TIME_TO_SET_POWER        = 500;
 
main {
    // Press X to start swing.
    if(event_press(PS4_CROSS)) {
        combo_run(GolfSwing);
    }
    if(combo_running(GolfSwing)) {
        set_val(PS4_CROSS, 0);
    }
}
 
combo GolfSwing {
    // Press X to start swing.
    set_val(PS4_CROSS, 100);
    wait(50);
 
    // wait for the next Press X
    wait(TIME_BETWEEN_X_PRESS);
 
    // Press X again to set power (0-100%).
    set_val(PS4_CROSS, 100);
    wait(TIME_TO_SET_POWER);
 
    // wait for the next Press X
    wait(TIME_BETWEEN_X_PRESS);
 
    // Press X a third time to try to hit the perfect impact point.
    set_val(PS4_CROSS, 100);
    wait(50);
}
 
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: Need Golf timing script

Postby TheBadger » Tue Oct 10, 2017 7:20 pm

Thanks! I forgot to mention that the second Press X (to set the power) is done manually. So the time between the first press (starting the gauge) and the third press (perfect impact) is constant. The second one is user inputted. I tried to modify the script by taking out the second press, but it won't accept me pressing X while the script is running.

Thanks again for taking the time.
User avatar
TheBadger
Sergeant
Sergeant
 
Posts: 7
Joined: Wed Dec 09, 2015 8:00 am

Re: Need Golf timing script

Postby J2Kbr » Tue Oct 17, 2017 6:42 am

Got it, this update will allow you press X while the combo from the first and third press is running.

Code: Select all
define TIME_FOR_THIRD_X_PRESS = 2000;
 
main {
    // Press X to start swing.
    if(event_press(PS4_CROSS)) {
        combo_run(GolfSwing);
    }
}
 
combo GolfSwing {
    // Press X to start swing.
    set_val(PS4_CROSS, 100);
    wait(50);
 
    // wait for the next Press X
    wait(TIME_FOR_THIRD_X_PRESS);
 
    // Press X a third time to try to hit the perfect impact point.
    set_val(PS4_CROSS, 100);
    wait(50);
}
 
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 Gtuner Pro Support

Who is online

Users browsing this forum: No registered users and 46 guests