GPC2 language reference

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

GPC2 language reference

Postby pablosscripts » Wed Sep 07, 2016 1:02 am

Hi guys I'm trying to work on upgrading my GPC1 scripts to GPC2 and I'm looking for some sort of language reference. Has one been published yet?
Setup: XIM Apex, T2, K780 keyboard, G Pro Wireless mouse, SteelSeries 4HD pad, DXRacer armrest, LucidSound LS30 headset, Netduma router, Ubiquiti UniFi AP LR

My R6 script: https://youtu.be/x-9NtxyySVM
User avatar
pablosscripts
Brigadier General
Brigadier General
 
Posts: 1976
Joined: Tue Nov 24, 2015 6:27 am

Re: GPC2 language reference

Postby bonefisher » Wed Sep 07, 2016 1:09 am

J2Kbr hasn't made one yet.
bonefisher
Lieutenant General
Lieutenant General
 
Posts: 5413
Joined: Thu Jan 29, 2015 10:49 am

Re: GPC2 language reference

Postby bonefisher » Wed Sep 07, 2016 1:10 am

There is some things to get an idea if you download what is in library.
bonefisher
Lieutenant General
Lieutenant General
 
Posts: 5413
Joined: Thu Jan 29, 2015 10:49 am

Re: GPC2 language reference

Postby pablosscripts » Wed Sep 07, 2016 1:16 am

bonefisher wrote:There is some things to get an idea if you download what is in library.


oh of course, not thinking:) Alright I'll study those and I'll go from there. Thanks!
Setup: XIM Apex, T2, K780 keyboard, G Pro Wireless mouse, SteelSeries 4HD pad, DXRacer armrest, LucidSound LS30 headset, Netduma router, Ubiquiti UniFi AP LR

My R6 script: https://youtu.be/x-9NtxyySVM
User avatar
pablosscripts
Brigadier General
Brigadier General
 
Posts: 1976
Joined: Tue Nov 24, 2015 6:27 am

Re: GPC2 language reference

Postby pablosscripts » Wed Sep 07, 2016 1:23 am

looks like if you want to use button references like PS4_SQUARE you have to include this in your script first:

Code: Select all
#include <ps4.gph>
Setup: XIM Apex, T2, K780 keyboard, G Pro Wireless mouse, SteelSeries 4HD pad, DXRacer armrest, LucidSound LS30 headset, Netduma router, Ubiquiti UniFi AP LR

My R6 script: https://youtu.be/x-9NtxyySVM
User avatar
pablosscripts
Brigadier General
Brigadier General
 
Posts: 1976
Joined: Tue Nov 24, 2015 6:27 am

Re: GPC2 language reference

Postby bonefisher » Wed Sep 07, 2016 2:23 am

I glanced at it but not diving in deep til it gets here to really get down and dirty. lol!
bonefisher
Lieutenant General
Lieutenant General
 
Posts: 5413
Joined: Thu Jan 29, 2015 10:49 am

Re: GPC2 language reference

Postby pablosscripts » Wed Sep 07, 2016 2:37 am

Yeah I think I'm done for now. When I first compiled it, there were about 300 errors.

I got it all the way down to 7 errors, and it's now getting super ambiguous, showing only messages like "Illegal operation"!

Tools down for now. Break time. I think I've had enough for today.

Image
Setup: XIM Apex, T2, K780 keyboard, G Pro Wireless mouse, SteelSeries 4HD pad, DXRacer armrest, LucidSound LS30 headset, Netduma router, Ubiquiti UniFi AP LR

My R6 script: https://youtu.be/x-9NtxyySVM
User avatar
pablosscripts
Brigadier General
Brigadier General
 
Posts: 1976
Joined: Tue Nov 24, 2015 6:27 am

Re: GPC2 language reference

Postby PaulaTheKoala » Wed Sep 07, 2016 5:29 am

pablogroup wrote:Yeah I think I'm done for now. When I first compiled it, there were about 300 errors.

I got it all the way down to 7 errors, and it's now getting super ambiguous, showing only messages like "Illegal operation"!

Tools down for now. Break time. I think I've had enough for today.

Image


In the same boat as you. Managed to convert a script but couldn't find any info on a rumble function, ended up just commenting out my old rumble code, going to wait till documentation is released for now.
User avatar
PaulaTheKoala
Command Sergeant Major
Command Sergeant Major
 
Posts: 131
Joined: Wed Aug 26, 2015 3:45 am

Re: GPC2 language reference

Postby pablosscripts » Wed Sep 07, 2016 6:47 am

Hell yes!

I've made some progress.

This very simple comparison kept throwing an error:

Code: Select all
if(get_val(MOV_Y_AXIS) <= -97)


I noticed it worked fine when I removed the comparison:

Code: Select all
if(get_val(MOV_Y_AXIS))


It then dawned on me that it was because it wasn't comparing two int values, so I converted the button press value to an int:

Code: Select all
if((int) get_val(MOV_Y_AXIS) <= -97)


And it worked! I wish J2Kbr was here to say whether I'm on the right track or not, it feels like I'm hacking my script into oblivion here lol
Setup: XIM Apex, T2, K780 keyboard, G Pro Wireless mouse, SteelSeries 4HD pad, DXRacer armrest, LucidSound LS30 headset, Netduma router, Ubiquiti UniFi AP LR

My R6 script: https://youtu.be/x-9NtxyySVM
User avatar
pablosscripts
Brigadier General
Brigadier General
 
Posts: 1976
Joined: Tue Nov 24, 2015 6:27 am

Re: GPC2 language reference

Postby bonefisher » Wed Sep 07, 2016 8:35 am

I still didn't look at it no no no not me lol! Might be best if you take baby steps by writing small code first then progress into the full script. I'm waiting so I can see results working with short scripts and trying all the new goodies it can do.
bonefisher
Lieutenant General
Lieutenant General
 
Posts: 5413
Joined: Thu Jan 29, 2015 10:49 am

Next

Return to GPC2 Script Programming

Who is online

Users browsing this forum: No registered users and 236 guests