Increasing variance range

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

Increasing variance range

Postby Flyers1987 » Thu Oct 17, 2019 8:21 pm

Looking to increase the X axis variance. It is currently -100 to 100 I would like to increase into the thousands if possible


Code: Select all
 
/* The Golf Club 2019
 
 
v1.2
Added X_VARIANCE. Maximum amount X axis will vary (+-)
 
 
 
v1.1
Chip - LT/L2 + A/Cross
Swing Strenth - Hold A/Cross then Up/Down (+- 5 each tap) TRACE_4 shows max backswing value
------------------------------------------------------------------------------------------
v1.0
***IF YOU USE LEFT STICK TO SWING SET SWING_STICK = LEFT;***
 
To use Random Delay Times at Top of The Swing set RANDOM_DELAY_TOP = TRUE
 
Full Swing - HOLD LT/L2 then tap RT/R2
 
Smooth Follow Through on Putt - Pull swing stick back untill putter head is at desired location then tap
either LT/L2 or RT/R2
**/
//--Change to LEFT for Left Stick Swing
//--Change to FALSE to Use a Random Delay Time
//--Maximum Amount X will Vary (+-) During Swing
//--------------------------------------------------
//--swing strength
//--swing
//--chip
//--putt smooth follow through
//--------------------------------------------------------------
//--Swing
//--new RX every 50 ms
//--------------------------------------------------------------
//--PUTT
//--------------------------------------------------------------
//--SCROLL VALS
 
 
define RIGHT = 10;
define LEFT = 12;
define SWING_STICK = RIGHT;
define RANDOM_DELAY_TOP = TRUE;
define X_VARIANCE = 15;
define BACK_SWING_LOWER = 10;
define BACK_SWING_UPPER = 20;
define DOWN_SWING_LOWER = 30;
define DOWN_SWING_UPPER = 40;
define DELAY_TOP_LOWER = 700;
define DELAY_TOP_UPPER = 800;
 
int SP[12];
 
int rnd_back, back_val;
int rnd_down, down_val;
int rnd_delay, delay;
int rnd_x, rx_val, rx_count;
int ry_val, back_max_val;
int swing, set, swing_y, swing_x, back, down;
int putt, putt_val, idx;
int b;
int bb;
int bb_array[3];
init{
  SP[0] = 100;
  SP[1]95;
  SP[2]90;
  SP[3] =   85;
  SP[4] =   80;
  SP[5] =   75;
  SP[6] = 0;
  SP[7]12;
  SP[8] =   14;
  SP[9] =   16;
  SP[10] =   18;
  SP[11]20;
  swing_y = SWING_STICK;
  swing_x = SWING_STICK - 1;
  back_max_val = 100;
}
 
 
main {
  set_val(30, back_val);
  set_val(31, down_val);
  set_val(32, delay / 10);
  set_val(33, back_max_val);
  set_val(34, rx_val);
  if (get_val(XB1_A) && event_press(XB1_DOWN)) back_max_val = back_max_val - 5;
  if (get_val(XB1_A) && event_press(XB1_UP)) {
    back_max_val =  back_max_val+5;
    if (back_max_val > 100) back_max_val = 100;
  }
  if (get_val(XB1_LT) && event_press(XB1_RT)) {
    swing = TRUE;
    set = FALSE;
    if (!RANDOM_DELAY_TOP) delay = 750;
  }
  if (get_val(XB1_LT) && event_press(XB1_A)) {
    swing = TRUE;
    set = FALSE;
    delay = 900;
  }
  if (get_val(swing_y) > 20 && event_press(XB1_LT)) {
    putt = TRUE;
    ry_val = get_val(swing_y);
    if (ry_val < 30) putt_val = 5;
    if (ry_val > 30 && ry_val < 70) putt_val = 10;
    if (ry_val > 70) putt_val = 20;
  }
  if (swing) {
    if (!set) {
      combo_run(c_SET);
    }
    else {
      if (back) {
        ry_val = ry_val +back_val;
        if (ry_val > back_max_val) {
          ry_val = back_max_val;
          back = FALSE;
          combo_run(c_DELAY_TOP);
        }
      }
      if (down) {
        ry_val =ry_val- down_val;
        if (ry_val <- 100) {
          ry_val = -100;
          down = FALSE;
          swing = FALSE;
          back_max_val = 100;
        }
      }
      rx_count = rx_count+ 1;
      if (rx_count == 5) {
        rx_val = rnd_x;
        rx_count = 0;
      }
      set_val(swing_y, ry_val);
      set_val(swing_x, rx_val);
    }
  }
  if (putt) {
    ry_val = ry_val-putt_val;
    if (ry_val <= - 100) {
      ry_val =- 100;
      putt = FALSE;
    }
    set_val(swing_y, ry_val);
  }
  rnd_back =rnd_back +1;
  rnd_down =rnd_down+1;
  rnd_x = rnd_x+1;
  rnd_delay =rnd_delay +10;
  if (rnd_back > BACK_SWING_UPPER) rnd_back = BACK_SWING_LOWER;
  if (rnd_down > DOWN_SWING_UPPER) rnd_down = DOWN_SWING_LOWER;
  if (rnd_x > X_VARIANCE) rnd_x = inv(X_VARIANCE);
  if (rnd_delay > DELAY_TOP_UPPER) rnd_delay = DELAY_TOP_LOWER;
}
 
 
combo c_SET {
  wait(1000);
  rx_val = rnd_x;
  back_val = rnd_back;
  down_val = rnd_down;
  if (RANDOM_DELAY_TOP) delay = rnd_delay;
  set = TRUE;
  back = TRUE;
}
 
combo c_DELAY_TOP {
  wait(delay);
  down = TRUE;
}
 
User avatar
Flyers1987
Sergeant Major
Sergeant Major
 
Posts: 74
Joined: Mon Apr 29, 2019 7:22 pm

Re: Increasing variance range

Postby DontAtMe » Thu Oct 17, 2019 8:59 pm

This is not possible with the Titan one, as the output values are stored as 8 bit integers.

I would consider the Titan Two, Its able to store numbers well above a thousand.
You can even store numbers as decimals. (0.00015).
User avatar
DontAtMe
Captain
Captain
 
Posts: 502
Joined: Tue Oct 02, 2018 4:49 am

Re: Increasing variance range

Postby Flyers1987 » Thu Oct 17, 2019 9:47 pm

Thanks bro
User avatar
Flyers1987
Sergeant Major
Sergeant Major
 
Posts: 74
Joined: Mon Apr 29, 2019 7:22 pm

Re: Increasing variance range

Postby Flyers1987 » Thu Oct 17, 2019 9:53 pm

DontAtMe wrote:This is not possible with the Titan one, as the output values are stored as 8 bit integers.

I would consider the Titan Two, Its able to store numbers well above a thousand.
You can even store numbers as decimals. (0.00015).



So if I set a range of -7 to 7 it would do everything in between including decimal points?
User avatar
Flyers1987
Sergeant Major
Sergeant Major
 
Posts: 74
Joined: Mon Apr 29, 2019 7:22 pm

Re: Increasing variance range

Postby DontAtMe » Thu Oct 17, 2019 10:25 pm

With the Titan Two yes,
User avatar
DontAtMe
Captain
Captain
 
Posts: 502
Joined: Tue Oct 02, 2018 4:49 am

Re: Increasing variance range

Postby Flyers1987 » Thu Oct 17, 2019 10:48 pm

What do I have to change the script to work for the Titan 2 I've already ordered it from Amazon I just got to get my ducks in order
User avatar
Flyers1987
Sergeant Major
Sergeant Major
 
Posts: 74
Joined: Mon Apr 29, 2019 7:22 pm

Re: Increasing variance range

Postby Flyers1987 » Thu Oct 17, 2019 11:15 pm

I can't download the g tuner for Titan 2 do I need to cancel my purchase
User avatar
Flyers1987
Sergeant Major
Sergeant Major
 
Posts: 74
Joined: Mon Apr 29, 2019 7:22 pm

Re: Increasing variance range

Postby DontAtMe » Thu Oct 17, 2019 11:23 pm

Not sure what you mean, Are you getting an error ?
Titan Two uses Gtuner IV.

It runs on Windows and Mac, if you were able to use Gtuner Pro then there should be no issue running Gtuner IV.
User avatar
DontAtMe
Captain
Captain
 
Posts: 502
Joined: Tue Oct 02, 2018 4:49 am

Re: Increasing variance range

Postby Flyers1987 » Thu Oct 17, 2019 11:59 pm

I use CR0NUSMAX now but I'm looking to switch over if you can use decimal points because it will work much better for the golf club 2019 on the swing variance on the x-axis
User avatar
Flyers1987
Sergeant Major
Sergeant Major
 
Posts: 74
Joined: Mon Apr 29, 2019 7:22 pm

Re: Increasing variance range

Postby Flyers1987 » Fri Oct 18, 2019 12:18 am

I want to make sure that this script is going to work on the Titan 2 and will include decimal points as it sits? Please tell me that's true
User avatar
Flyers1987
Sergeant Major
Sergeant Major
 
Posts: 74
Joined: Mon Apr 29, 2019 7:22 pm

Next

Return to GPC1 Script Programming

Who is online

Users browsing this forum: No registered users and 155 guests