set_polar() - Script Documentation

Documentation, usage tips and configuration guides for Titan Two scripts and bytecodes published by the community users.

set_polar() - Script Documentation

Postby DontAtMe » Tue Dec 31, 2019 9:17 am

This is the Script Documentation page. For my recent script. set_polar(), It can be found in the Online Resources, and can be downloaded from within GtunerIV

void set_polar(uint8 X, uint8 Y, fix32 ANGLE, fix32 RADIUS)
- X: Axis Identifier. STICK_1_X for the right stick. STICK_2_X for left.
- Y: Axis Identifier. STICK_1_Y for the right stick. STICK_2_Y for left.
- ANGLE: A value between 0.00 - 360.00.
- RADIUS: A Value between 0.00 - 100.00

I'm sure everyone is familiar with the Cartesian Coordinate system.
Image
Code: Select all
main {
  // Cartesian coordinates
  set_val(STICK_1_X70.70);
  set_val(STICK_1_Y, -70.70);
}


Well, there are multiple ways to assign both X and Y values to a plot.
The Polar Coordinate system is one of the alternatives, Sadly not many utilize this system.
Image
Code: Select all
main {
  // Polar Coordinates
  set_val(STICK_1_X, cos(deg2rad(-45.00)) * 100.00);
  set_val(STICK_1_Y, sin(deg2rad(-45.00)) * 100.00);
 }
User avatar
DontAtMe
Captain
Captain
 
Posts: 502
Joined: Tue Oct 02, 2018 4:49 am

Re: set_polar() - Script Documentation

Postby Mad » Tue Dec 31, 2019 10:17 am

Great work as always, well done. :joia:
ConsoleTuner Support Team || ConsoleTuner Discord || InputSense Discord (2K / FPS)
Mad
Major General
Major General
 
Posts: 4533
Joined: Wed May 22, 2019 5:39 am

Re: set_polar() - Script Documentation

Postby J2Kbr » Tue Dec 31, 2019 2:09 pm

DontAtMe wrote:The Polar Coordinate system is one of the alternatives, Sadly not many utilize this system.

Agree. I use polar quite often, very useful in many situations.
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: set_polar() - Script Documentation

Postby bonefisher » Tue Dec 31, 2019 6:17 pm

:joia:
bonefisher
Lieutenant General
Lieutenant General
 
Posts: 5413
Joined: Thu Jan 29, 2015 10:49 am

Re: set_polar() - Script Documentation

Postby GamingScene » Tue Jan 07, 2020 3:59 pm

DontAtMe wrote:This is the Script Documentation page. For my recent script. set_polar(), It can be found in the Online Resources, and can be downloaded from within GtunerIV

void set_polar(uint8 X, uint8 Y, fix32 ANGLE, fix32 RADIUS)
- X: Axis Identifier. STICK_1_X for the right stick. STICK_2_X for left.
- Y: Axis Identifier. STICK_1_Y for the right stick. STICK_2_Y for left.
- ANGLE: A value between 0.00 - 360.00.
- RADIUS: A Value between 0.00 - 100.00

I'm sure everyone is familiar with the Cartesian Coordinate system.
Image
Code: Select all
main {
  // Cartesian coordinates
  set_val(STICK_1_X70.70);
  set_val(STICK_1_Y, -70.70);
}


Well, there are multiple ways to assign both X and Y values to a plot.
The Polar Coordinate system is one of the alternatives, Sadly not many utilize this system.
Image
Code: Select all
main {
  // Polar Coordinates
  set_val(STICK_1_X, cos(deg2rad(-45.00)) * 100.00);
  set_val(STICK_1_Y, sin(deg2rad(-45.00)) * 100.00);
 }


How do you increase the time it takes to complete one rotation?
User avatar
GamingScene
Sergeant Major
Sergeant Major
 
Posts: 104
Joined: Sat May 26, 2018 6:17 pm

Re: set_polar() - Script Documentation

Postby DontAtMe » Tue Jan 07, 2020 7:49 pm

GamingScene wrote:How do you increase the time it takes to complete one rotation?


Example.
Code: Select all
#define SPEED   0.01 // Raise this value for faster Rotation. 
 
const fix32 radius = 50.00;
fix32 angle;
main {
  angle = mod(angle += SPEED, 360.00);
  set_polar(STICK_1_X, STICK_1_Y, angle, radius);
}
Super Slow :smile0525:
User avatar
DontAtMe
Captain
Captain
 
Posts: 502
Joined: Tue Oct 02, 2018 4:49 am

Re: set_polar() - Script Documentation

Postby GamingScene » Thu Jan 09, 2020 9:09 am

DontAtMe wrote:
GamingScene wrote:How do you increase the time it takes to complete one rotation?


Example.
Code: Select all
#define SPEED   0.01 // Raise this value for faster Rotation. 
 
const fix32 radius = 50.00;
fix32 angle;
main {
  angle = mod(angle += SPEED, 360.00);
  set_polar(STICK_1_X, STICK_1_Y, angle, radius);
}
Super Slow :smile0525:



EDIT Fixed it


Hi thanks but it comes up with this error
Code: Select all
GPC: Second-pass started.
GPC error: blank.gpc(9): Identifier not declared 'set_polar'.
GPC error: blank.gpc(9): Illegal operation 'arg:1'.
GPC error: blank.gpc(9): Illegal operation 'arg:1'.
GPC error: blank.gpc(9): Illegal operation 'arg:1'.
GPC error: blank.gpc(9): Illegal operation 'arg:1'.
GPC error: blank.gpc(9): Illegal function call, near ')'
GPC: GPC Build ABORTED with 0 warning(s) and 6 error(s).
Last edited by GamingScene on Thu Jan 09, 2020 9:56 am, edited 1 time in total.
User avatar
GamingScene
Sergeant Major
Sergeant Major
 
Posts: 104
Joined: Sat May 26, 2018 6:17 pm

Re: set_polar() - Script Documentation

Postby Mad » Thu Jan 09, 2020 9:16 am

GamingScene wrote:Hi thanks but it comes up with this error


You need the include the set_polar() function from DontAtMe's script in the online resource section.
ConsoleTuner Support Team || ConsoleTuner Discord || InputSense Discord (2K / FPS)
Mad
Major General
Major General
 
Posts: 4533
Joined: Wed May 22, 2019 5:39 am

Re: set_polar() - Script Documentation

Postby Gjin Yuko » Sun Jan 12, 2020 1:58 pm

Any future plans on Xim Support?
YouTube /Gjin Yuko
Facebook /Gjin Yuko
Twitter /Gjin Yuko
Discord /Gjin Yuko
Xbox /Gjin Yuko
Playstation Dont have one, Xbox is the better Console :P
User avatar
Gjin Yuko
Sergeant Major
Sergeant Major
 
Posts: 95
Joined: Mon Aug 05, 2019 10:00 pm
Location: Germany

Re: set_polar() - Script Documentation

Postby UK_Wildcats » Sun Jan 12, 2020 5:32 pm

What are some applications for using this?
User avatar
UK_Wildcats
Brigadier General
Brigadier General
 
Posts: 2243
Joined: Thu Jan 08, 2015 6:53 pm

Next

Return to User's Script Documentation

Who is online

Users browsing this forum: No registered users and 96 guests