Site Tools
Sidebar
Table of Contents
GPC Combos
Combo (short for combination) is a term that designates a set of actions programmed to be automatically performed in sequence.
In addition to combos there are also macros.
Combo or Macro
Most of the time you will use a combo. Some reasons to do so:
- You can create one very fast by code because of its easy to use syntax.
- You can run multiple combos at the same time.
- It allows you to mix the current user inputs into your combo like it is required for anti recoil.
- You and the users you share your script with don't need a sd-card.
You probably want to record and use a macro for:
- Precise stick movements
- Long control sequence like when walking around doing a farming route in a game.
- Doing complex moves/combos in fighting game that require precise timings.
- Lowering the scripts size to be able to put more features into a single script.
Here is an incomplete list showing their different functionalty.
Create / Record
You can created a combo manually or you can use the macro recording of GTuner IV to record inputs and convert it to a combo as explained on this page.
Syntax
A combo is defined using syntax such as the following:
combo SomeName { set_val(BUTTON_14, 100); // set BUTTON_14 to pressed wait(100); // press for 100ms set_val(BUTTON_14, 0); // set BUTTON_14 to released wait(100); // release for 100ms set_val(BUTTON_14, 100); // set BUTTON_14 to pressed set_val(BUTTON_15, 100); // set BUTTON_15 to pressed wait(250); // press both for 250ms wait(250); // wait 250ms, without any control states set by code }
To execute the combo above you need to use the combo_run(comboname) function.
Example to start it each time you press BUTTON_9:
main { if (event_active(BUTTON_9)) combo_run(SomeName); }
For complete examples click here and/or take a look at the Related Functions listed below.
Related Functions
wait(ms);
The wait command sets for how long the last set of actions (commands) must be execute. It's expressed in milliseconds and can range from 0 to 32767.wait
can be used within a combo only, not inmain { }
or anywhere else.wait
cannot exist inside conditionals likeif
.
call(comboname);
Starts the execution of the combo comboname and waits for the called combo to finish before it continues the execution of the current combocall
can be used within a combo only, not inmain { }
or anywhere else.call
cannot exist inside conditionals likeif
.
combo_stop(comboname);
Stop the execution of a combo.11)combo_restart(comboname);
Restart the execution of a combo.12)combo_pause(comboname);
Pause the execution of a combo.13)
Pitfalls
There are various pitfalls to watch out for when using combos.
- Too low/short wait times
- Times are in milli-seconds. A very short time like
wait(1);
might not be registered by the game as an input. - Try longer wait times like
wait(20);
.
- Using call, rumble or led control functions
- Only use those function within a
wait(0);
section - They are usually marked with something like this in the GPC Language Reference:
ATTENTION: The ffb_set() should NOT be called on every interaction of main
. - Recall what the wait command does: It repeats all of the wait times section commands for the time specified. Some functions like rumble or led commands will flood the usb connection of the T2 to the console causing disconnects when they are send to often.
Example of correct usage:combo Example { // section wait(0); begins here ffb_set(FFB_1,100.0,400); // rumble motor 1 full power for 400ms wait(0); // <-- section wait(0) ends here and wait(300) starts set_val(BUTTON_10,100); set_val(BUTTON_11,100); wait(300); // press BUTTON_10 and _11 for 300ms }
- Press and Release of a button
- While you can use something like PressReleaseA most of the time you need to understand when not to use it:
combo PressReleaseA { set_val(BUTTON_10,100); wait(300); // press BUTTON_10 for 300ms wait(300); // do nothing for 300ms } combo PressReleaseB { set_val(BUTTON_10,100); wait(300); // press BUTTON_10 for 300ms set_val(BUTTON_10,0); wait(300); // release BUTTON_10 for 300ms }
- PressReleaseA : If you keep BUTTON_10 pressed manually, the button will not send as released by the script.
- PressReleaseB : This will explicitly set the button to released for 300ms, even when you keep the button pressed manually.
e.g. If your macro doesn't use BUTTON_5 at all you can press it manually and it will be received by the console.
More precisely up to 24 days, 20 hours, 31 minutes, 23 seconds and 650 milliseconds