Learning GPC * GPC2

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

Learning GPC * GPC2

Postby Yearoh » Thu Aug 27, 2020 5:27 pm

Are the bulk of the online references for GPC also relevant in GPC2?
I'm just talking about the core language etc, as more examples would be helpful trying to learn the concepts of GPC2
User avatar
Yearoh
Master Sergeant
Master Sergeant
 
Posts: 38
Joined: Fri Jul 10, 2020 9:32 am

Re: Learning GPC * GPC2

Postby Scachi » Thu Aug 27, 2020 6:00 pm

Yearoh wrote:Are the bulk of the online references for GPC also relevant in GPC2?
I'm just talking about the core language etc, as more examples would be helpful trying to learn the concepts of GPC2

See my signature for getting started with gpc2 scripting.
User avatar
Scachi
Brigadier General
Brigadier General
 
Posts: 3044
Joined: Wed May 11, 2016 6:25 am
Location: Germany

Re: Learning GPC * GPC2

Postby Yearoh » Fri Aug 28, 2020 1:13 am

Scachi wrote:
Yearoh wrote:Are the bulk of the online references for GPC also relevant in GPC2?
I'm just talking about the core language etc, as more examples would be helpful trying to learn the concepts of GPC2

See my signature for getting started with gpc2 scripting.


Thanks, what I meant also was commands like arrays, they’re in the GPC online documentation but I didn’t see it in the GPC2 section.. is it that the GPC2 section details the extra capabilities? So both online references are valid?
User avatar
Yearoh
Master Sergeant
Master Sergeant
 
Posts: 38
Joined: Fri Jul 10, 2020 9:32 am

Re: Learning GPC * GPC2

Postby Scachi » Fri Aug 28, 2020 1:53 am

No, you should stick to the T2 online documentation when coding for the T2.
Yes, gpc2 does support arrays too.
GPC2 is more like C than gpc1 I think. So arrays and syntax is almost the same but not 100%.
GPC and GPC2 shares a lot of stuff and function names. But gpc2 doesn't use all the commands of gpc1 and use slightly different syntax in some cases. In GPC2 some functions are renamed, have new/different functions and supports different data types now (t1 did only support scalar integer, int: 16 bits signed [-32768 ~ +32767]).
GPC2 supports backward compatibility by using a header file named "titanone.gph" (but you shouldn't mix T2 and T1 code in a single script to avoid problems).
So you can use T1 stuff easily on the T2 but not the other way around as the T2 is more powerful.

You should stick to the T2 Online Language Reference and its own documentation when coding for the T2:
https://www.consoletuner.com/wiki/
User avatar
Scachi
Brigadier General
Brigadier General
 
Posts: 3044
Joined: Wed May 11, 2016 6:25 am
Location: Germany

Re: Learning GPC * GPC2

Postby Yearoh » Sat Aug 29, 2020 3:39 pm

Good to know, thank you
User avatar
Yearoh
Master Sergeant
Master Sergeant
 
Posts: 38
Joined: Fri Jul 10, 2020 9:32 am


Return to Gtuner IV Support

Who is online

Users browsing this forum: No registered users and 68 guests