GPC2 language reference
40 posts
• Page 3 of 4 • 1, 2, 3, 4
Re: GPC2 language reference
FCB77 wrote:i tried to convert my old fifa16 script and after some trial and error it finally compiled without errors.
my old fifa script for T1 had a lot of commented code because it used all 100% T1 memory, now i uncommented the code for T2 and it says it is using only 14%lol there is a lot of space in T2.GPC: Memory usage: Static: 152 bytes (14.84%), Dynamic: 16 bytes (1.56%)
Mine went from 99.9% usage to 11.33%.
This means T2 can support scripts 7 to 9 times larger in size. Holy crap.
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
My R6 script: https://youtu.be/x-9NtxyySVM
-
pablosscripts - Brigadier General
- Posts: 1976
- Joined: Tue Nov 24, 2015 6:27 am
Re: GPC2 language reference
Oh my god my friend who is a programmer just told me I could use this:
Instead of this:
or this:
I just tested this and it works!
I'm no programmer so I honestly don't know what the best approach is, I'm hoping someone more knowledgeable can chime in. I don't want to use more memory than I need to, I want to make it super efficient.
I'm going to update my guide now.
viewtopic.php?f=23&t=4609
- Code: Select all
if(get_val(MOV_Y_AXIS) <= -97.00)
Instead of this:
- Code: Select all
if((int) get_val(MOV_Y_AXIS) <= -97)
or this:
- Code: Select all
if(get_val(MOV_Y_AXIS) <= -97f)
I just tested this and it works!
I'm no programmer so I honestly don't know what the best approach is, I'm hoping someone more knowledgeable can chime in. I don't want to use more memory than I need to, I want to make it super efficient.
I'm going to update my guide now.
viewtopic.php?f=23&t=4609
Last edited by pablosscripts on Thu Sep 08, 2016 1:44 am, edited 1 time in total.
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
My R6 script: https://youtu.be/x-9NtxyySVM
-
pablosscripts - Brigadier General
- Posts: 1976
- Joined: Tue Nov 24, 2015 6:27 am
Re: GPC2 language reference
You can also dial in your rapid fires under the 1ms mark.
- bonefisher
- Lieutenant General
- Posts: 5413
- Joined: Thu Jan 29, 2015 10:49 am
Re: GPC2 language reference
pablogroup wrote:Oh my god my friend who is a programmer just told me I could use this:
- Code: Select all
if(get_val(MOV_Y_AXIS) <= -97.00)
Instead of this:
- Code: Select all
if((int) get_val(MOV_Y_AXIS) <= -97)
or this:
- Code: Select all
if(get_val(MOV_Y_AXIS) <= -97f)
I just tested this and it works!
I'm no programmer so I honestly don't know what the best approach is, I'm hoping someone more knowledgeable can chime in. I don't want to use more memory than I need to, I want to make it super efficient.
I'm going to update my guide now.
viewtopic.php?f=23&t=4609
Doing -97.00 or -97f are the same, by using a decimal you convert the number to fix32 and as Bonefisher said you can be more precise.
You have plenty of space so you shouldn't worry too much about being efficient, the compiler does lots of optimizations so you should be fine.
-
PaulaTheKoala - Command Sergeant Major
- Posts: 131
- Joined: Wed Aug 26, 2015 3:45 am
Re: GPC2 language reference
Great thanks for that feedback.
Without J2Kbr here it feels like we're paving the way here!
Without J2Kbr here it feels like we're paving the way here!
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
My R6 script: https://youtu.be/x-9NtxyySVM
-
pablosscripts - Brigadier General
- Posts: 1976
- Joined: Tue Nov 24, 2015 6:27 am
Re: GPC2 language reference
I'm so close now to getting it to compile 100%. Here's what I have left:
sensitivity() - I can't find an equivalent
deadzone() - I can't find an equivalent
irand() - I can't find an equivalent, I thought it was rand() but it doesn't work
sensitivity() - I can't find an equivalent
deadzone() - I can't find an equivalent
irand() - I can't find an equivalent, I thought it was rand() but it doesn't work
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
My R6 script: https://youtu.be/x-9NtxyySVM
-
pablosscripts - Brigadier General
- Posts: 1976
- Joined: Tue Nov 24, 2015 6:27 am
Re: GPC2 language reference
pablogroup wrote:I'm so close now to getting it to compile 100%. Here's what I have left:
sensitivity() - I can't find an equivalent
deadzone() - I can't find an equivalent
irand() - I can't find an equivalent, I thought it was rand() but it doesn't work
How do you know that rand() isn't working ?
This compiles for me, but I can't test it.
- Code: Select all
fix32 rtest;
rtest = rand();
-
Scachi - Brigadier General
- Posts: 3044
- Joined: Wed May 11, 2016 6:25 am
- Location: Germany
Re: GPC2 language reference
Scachi wrote:pablogroup wrote:I'm so close now to getting it to compile 100%. Here's what I have left:
sensitivity() - I can't find an equivalent
deadzone() - I can't find an equivalent
irand() - I can't find an equivalent, I thought it was rand() but it doesn't work
How do you know that rand() isn't working ?
This compiles for me, but I can't test it.
- Code: Select all
fix32 rtest;
rtest = rand();
I was testing rand(30, 70);
It occurs to me that I've probably made the same mistake again and forgotten to convert the parameters into an int first. I'll test this when I get back to my PC.
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
My R6 script: https://youtu.be/x-9NtxyySVM
-
pablosscripts - Brigadier General
- Posts: 1976
- Joined: Tue Nov 24, 2015 6:27 am
Re: GPC2 language reference
I didn't see that rand takes arguments. Maybe you have to use clamp with rand to get the desired result.
-
Scachi - Brigadier General
- Posts: 3044
- Joined: Wed May 11, 2016 6:25 am
- Location: Germany
Re: GPC2 language reference
Scachi wrote:I didn't see that rand takes arguments. Maybe you have to use clamp with rand to get the desired result.
Yeah it takes two arguments to generate a random number between. So if you set it to 1 and 10 it will generate a random number between the two.
I use it to prevent anti-cheat systems from detecting me. It reduces the consistency between certain automatic actions.
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
My R6 script: https://youtu.be/x-9NtxyySVM
-
pablosscripts - Brigadier General
- Posts: 1976
- Joined: Tue Nov 24, 2015 6:27 am
40 posts
• Page 3 of 4 • 1, 2, 3, 4
Return to GPC2 Script Programming
Who is online
Users browsing this forum: No registered users and 108 guests