Site Tools
Sidebar
This is an old revision of the document!
Table of Contents
GPC Macros
This section is about the basic macro usage only 1) to record your inputs as macros and use them in scripts. The maximum length of a single macro file is 24hours. 2)
While using a macro file directly in a script requires a sd-card you can still use this without one to record your input and convert it to a combo for playback.
You can playback one macro at a time only.
Converting a macro to a combo has some limitations.3) 4).
There are other reason to use a combo instead of a macro.5)
For simple short actions you may want to stick to using combos created manually or by converting a macro to a combo.
Related Functions
macro_run(“<filename>.gmk”);
Run the macro file named <filename> stored on the SD-Card.macro_rec(“<filename>.gmk”);
Record the controller outputs to the macro file named <filename> on the SD-Card.macro_time();
Get the time in milli-seconds the macro file is running or recording since initiated bymacro_run
ormacro_rec
.macro_stop();
Stop the execution or recording of the macro file initiated bymacro_run
ormacro_rec
.
Recording
To record a macro via GTuner IV you need to have:
- GTuner IV running
- Your Titan Two connected via PROG port to your computer 6)
- A controller connected to Input-A or Input-B 7)
In GTuner IV switch to the “Device Monitor”. It will look like this, the areas of interest are marked green:
The steps to do are:
- Start recording Click the “REC” button
The button label changes to a countdown. Get ready to do your inputs when the 3,2,1 countdown ends - Do your inputs
- Stop recording Click the “STOP” button
- Save Click the “Save” button
In the “Save As Macro” dialog choose a location and filename8)
The macro filename must have 8 characters or less. - Optionally Edit the recording by opening your .gmk file via double click in the “File Explorer”, it will open the “Macro Editor”. Do your editings 9) and save it again
- If you have no sd-card continue here
Copy onto sd-card when you want to playback the macro file via a script.
Drag your .gmk file from the “File Explorer” onto the “Macro Explorer (Micro-SD)” dialog
Playback
You need a sd-card to playback a macro. If you have no sd-card continue here
- Using GTuner IV - You can playback a macro by using the GTuner IV “Macro Editor”.
Double click the macro file name10) in the “File Explorer” will open the macro in the “Macro Editor”. Hit the green play button at the top to will start the macro instantly. To stop the playback before it has completed use the “Unload Memory Slot” button11) - Using a script - To playback a macro without GTuner IV you need to create a script.
Here is a basic script example to playback a macro one time when BUTTON_4 is pressed:main { if(event_active(BUTTON_4)) { macro_run("Example.gmk"); // replace Example.gmk with the name of yourfile.gmk } }
Convert to Combo
To get gpc combo code it needs some additional steps. But it is not that complicated or different.
The steps to do are:
- Open the file in the “Macro Editor” by double click on the file in the GTuner IV “File Explorer”
- Select the section to export as a combo
If you had multiple attemps to get the combo right or a long pause before or after your combo as you had to walk from your console to your pc you can now scroll to and select the part only you want to keep on via the graph in the macro recorder (left click at start and shift+left click at where you want to stop)
- Export
Click the button “Convert macro or selection to GPC combo code”.
It will be copied to your clipboard as a combo named “Macro2Combo”. Paste it into your .gpc script file. - Optionally reduce the combo 12)
Save some script space by removing lines that readset_val(GPC_Designator,0);
- Run the combo 13)
Here is a basic script example to playback a combo one time when BUTTON_9 is pressed:
main { if (event_active(BUTTON_9)) combo_run(Macro2Combo); }
Macro File (*.gmk) BUTTON
when you only need the button actions