New 32-bit Updates

gpc scripting is available in both 16 bit and 32 bit flavors developing using 32 bit allows for a much larger address space, which means more memory can be accessed and used by the gamepack 16 bit has a maximum of 2^16 possible values and 32bit has a maximum of 2^32 possible values 16 bit 0000 0000 0000 0000 32 bit 0000 0000 0000 0000 0000 0000 0000 0000 what is 32 bit? 32 bit scripting support allows for vastly greater calculations, enabling more precision, more accuracy, and more automation especially for m o d s such as aim assist docid\ ps0o4l2 gxdkx75rjb8w0 and anti recoil docid\ u97dbplagfd7mvowwffj7 previously, the variable calculation range with 16 bit ( 32768 to 32767) , but now with 32 bit that range has increased to a massive (−2,147,483,648 to 2,147,483,647) , allowing for much more complex calculations that can be scaled up then back down while retaining a high level of accuracy, enabling a degree of precision not previously available size minimum value maximum value 8 bits (2^8) = 128 2^8 1 = 127 16 bits (2^16) = 32,768 2^16 1 = 32,767 32 bits (2^32) = 2,147,483,648 2^32 1 = 2,147,483,647 new functions we've also added three new incredibly powerful gpc functions, get polar , get ipolar and get info ⚙ get ipolar get ipolar() is the latest brand new function that can be used to gain information to retrieve the unmodified input value of the analog stick it can be used with both left and right analog sticks, get ipolar() uses 2 parameters in the function, 1st is the stick you want to use and the 2nd parameter is either angle or radius only angle or radius can be retrieved at once the polar angle can be within the range of 0 359 and this depends on the current direction the stick has been pushed the polar radius has a range of 0 32767 and this represents how far from the center the stick is pushed gpc main { get ipolar(polar ls,polar radius); // retrieves current unmodified radius of an analog stick get ipolar(polar rs,polar angle); // retrieves current unmodified angle of an analog stick } 🔴 syntax get ipolar(polar ls,polar radius); get ipolar(polar rs,polar angle); ⚪ parameters \<polar angle> returns the unmodified angle on an analog stick polar ls or polar rs (0 359) \<polar radius> returns the unmodified radius of an analog stick polar ls or polar rs (0 32767) 🔵 returns either the unmodified angle or radius will be returned depending on the given parameter ⚙ get polar get polar is a brand new function that can be used to gain information on the current angle or radius of the analog stick it can be used with both left and right analog sticks, get polar() uses 2 parameters in the function, 1st is the stick you want to use, and the 2nd parameter is either angle or radius only angle or radius can be retrieved at once the polar angle can be within the range of 0 359 and this depends on the current direction the stick has been pushed the polar radius has a range of 0 32767 and this represents how far from the center the stick is pushed gpc main { get polar(polar ls,polar radius); // retrieves current radius of an analog stick get polar(polar rs,polar angle); // retrieves current angle of an analog stick } 🔴 syntax get polar(polar ls,polar radius); get polar(polar rs,polar angle); ⚪ parameters \<polar angle> returns the angle on an analog stick polar ls or polar rs (0 359) \<polar radius> returns the radius of an analog stick polar ls or polar rs (0 32767) 🔵 returns either the angle or radius will be returned depending on the given parameter ⚙ set polar2 set polar2 is a virtual stick that you can use to quickly calculate values without the hassle of time consuming trigonometry functions polar ghost is the virtual stick where an angle and radius can be assigned using set polar2 analog ghostx is the virtual x axis to be used with both math and trigonometry functions analog ghosty is the virtual y axis to be used with both math and trigonometry functions gpc main { &#x9;set val(trace 1, polartocartesian(60, 10000, x axis)); // 4999 &#x9;set val(trace 2, polartocartesian(60, 10000, y axis)); // 8660 } define x axis = 0; define y axis = 1; function polartocartesian(angle, radius, axis) { set polar2(polar ghost, angle, radius); if (axis == x axis) { return get val(analog ghostx); } return get val(analog ghosty); } ⚙ get info get info is a new function that checks the active state of the mk profile an mk profile has up to 6 different states as follows ( 0 = hip, 1 = ads, 2 = aux1, 3 = aux2, 4 = aux3, 5 = aux4 ) with this information, you are able to script for any specific state and take action accordingly for example, you can have mods automatically toggle on/off based on if you are hip firing, aiming down sights (ads), or using any of the 4 auxiliary mk profiles think of the possibilities gpc // show usage for pending config and active config // check traces with mouse and keyboard, click activator to see the trace values // 0 = hip, 1 = ads, 2 = aux1, 3 = aux2, 4 = aux3, 5 = aux4 // if a config has delay activation it will show up in the traces after the activation time main { set val(trace 1, get info(pending config)) set val(trace 2, get info(active config)) if(get info(active config) == 1 && get ival(xb1 lt)){ //if aiming down sights and left trigger is held set val(xb1 ls,100); //hold ls / l3 } } 🔴 syntax get info(pending config); get info(active config); ⚪ parameters \<pending config> shows usage for the pending config \<active config> shows the usage for the active config 🔵 returns active profile in use by mk settings return profile 0 hip 1 ads 2 aux1 3 aux2 4 aux3 5 aux4 ⚙ int32 int32 is a brand new 32 bit function that is used to create an array that holds values greater than 32767 and less than 32768 gpc const int32 array \[]\[] = { &#x9;{ 111111, 222222, 333333}, &#x9; &#x9;{ 444444, 555555, 666666}, &#x9;{ 777777, 888888, 999999} }; main { set val(trace 1,array\[0]\[1]); } ⚙ 32 bit traces traces are commonly used for debugging a script and viewing information from a script or game there are six trace debug fields found in device monitor that can be used by a gpc script for feedback information, flow control checking, and variables monitoring trace 1 to trace 3 is for 32 bit values, trace 4 to trace 6 is for 16 bit values trace number integer value trace 1 32 bit trace 2 32 bit trace 3 32 bit trace 4 16 bit trace 5 16 bit trace 6 16 bit for example, if you wanted to see the current value of a variable that was over the 16 bit limit you could set a trace using trace 1 , trace 2 , or trace 3 for the variable to see its value gpc int value; main { set val(trace 1,value); value = 1000 get ival(xb1 rt); } ⚙ 32bit spvars with the use of int32 and the 32 bit update, you can save much higher values to spvar than ever before each 32 bit spvar can hold 1x32 bit (4 bytes) value of −2,147,483,648 to 2,147,483,647 whereas the previous 16 bit spvars were only 16 bit (2 bytes) of 32,767 to 32,767 this can be extremely useful if you need to scale and save values for more advanced movements such as anti recoil docid\ u97dbplagfd7mvowwffj7 and aim assist docid\ ps0o4l2 gxdkx75rjb8w0 additionally, advanced developers who use bit packing in their gpc scripts are now able to store twice as much information in a spvar as they were before with 16 bit you were only able to store 2x8 bit values with a range of 32768 to 32767; with 32bit you can store double that amount with 4x8 bit values 💥 bit packing to optimize memory usage, you can use the bit packing spvars docid\ x5gohnsfddfrkrm ehrah guide this technique packs variables more densely, so is especially useful when you're trying to fit more code into the 64k space, which is particularly important for complex scripts that require a large amount of data storage bit packing allows you to store multiple values within a single variable by utilizing bitwise operations, ensuring you make the most out of the available space 32bit examples ⚙ get polar here is an example of a strafe mod not being possible using 16 bit the new get polar function is used to return the current radius of the left analog stick this value is then multiplied by a set number or 50 in this example, then once more by 100 to scale input then to scale the value back down it is divided by 20000 the resulting value is then used as a strength that is applied to the left stick to strafe left and right info while gpc does not support float, a far higher degree of accuracy is achieved by first scaling up and then back down gpc int strafe value = 50; int strafe val; main { strafe val = (get polar(polar ls,polar radius) strafe value 100) / 20000; if(get val(xb1 lt)){ combo run(strafe); } } combo strafe{ set val(polar lx, inv(strafe val)); wait(250); set val(polar lx, strafe val); wait(250); } scaling with 32 bit here's an example of scaling a recoil value though this time it is for 32 bit here the value is much higher which leads to much greater accuracy when calculating a value the value seen in trace 3 could be applied to either stick as a polar value leading to much greater results in the example, the recoil value is scaled up based on sensitivity, deadzone, and a modifier (accounts for attachments) gpc int original recoil value = 20; int mod sensitivity,mod deadzone,part 1,part 2,applied recoil,val; int rightstickdeadzone = 5; int rightsticksensitivity = 20; int recoil adjustment = 25; main { set val(trace 1,part 1); set val(trace 2,part 2); set val(trace 3,applied recoil); if(event press(xb1 up)){ rightstickdeadzone++; } if(event press(xb1 down)){ rightstickdeadzone ; } if(event press(xb1 left)){ rightsticksensitivity++; } if(event press(xb1 right)){ rightsticksensitivity ; } &#x9;part 1 = (((((original recoil value 327) + (mod sensitivity + mod deadzone)) 327) / 327)); &#x9;part 2 = part 1 (100 + recoil adjustment); &#x9;applied recoil = part 2 / 100; &#x9;mod deadzone = ((((original recoil value 327) 25) (rightstickdeadzone 5)) / 1000); &#x9;mod sensitivity = ((((original recoil value 327) (25 + val)) (20 rightsticksensitivity)) / 1000); &#x9;if(rightsticksensitivity >= 5){ &#x9; val = 0; &#x9;} if(rightsticksensitivity < 5){ &#x9; val = ((rightsticksensitivity 5) 4); &#x9;} } scaling with 16 bit here's an example of how you could scale an anti recoil value using 16 bit though due to value limitations and truncation you do lose a little accuracy gpc int original recoil value = 20; int mod sensitivity,mod deadzone,part 1,part 2,applied recoil,val; int rightstickdeadzone = 5; int rightsticksensitivity = 20; main { set val(trace 1,applied recoil); if(event press(xb1 up)){ rightstickdeadzone++; } if(event press(xb1 down)){ rightstickdeadzone ; } if(event press(xb1 left)){ rightsticksensitivity++; } if(event press(xb1 right)){ rightsticksensitivity ; } &#x9;part 1 = (((((original recoil value 327) + (mod sensitivity + mod deadzone)) 327) / 327)); &#x9;part 2 = (part 1 100) / 100; &#x9;applied recoil = part 2 / 327; &#x9;mod deadzone = ((((original recoil value 327) 25) (rightstickdeadzone 5)) / 1000); &#x9;mod sensitivity = ((((original recoil value 327) (25 + val)) (20 rightsticksensitivity)) / 1000); &#x9;if(rightsticksensitivity >= 5){ &#x9; val = 0; &#x9;} if(rightsticksensitivity < 5){ &#x9; val = ((rightsticksensitivity 5) 4); &#x9;} } 16 bit vs 32 bit here's an example of anti recoil using a 16 bit gamepack vs anti recoil using a 32 bit gamepack legacy 16 bit compiler the 16 bit compiler is still available for older scripts not designed for 32 bit if you get an error while compiling a script, it's likely because you're trying to compile a 16 bit script in the 32 bit compiler or the script has deprecated functions that no longer work and needs to be updated