For the complete documentation index, see llms.txt. This page is also available as Markdown.

10. Advanced: restartable timed combo

Difficulty: Advanced

restartable-timed-combo.gpc
main {
    if(event_press(PS5_CROSS)) combo_restart(DoubleTap);
    if(event_press(PS5_CIRCLE)) combo_stop(DoubleTap);

    set_val(TRACE_1, combo_running(DoubleTap));
}

combo DoubleTap {
    set_val(PS5_SQUARE, 100);
    wait(60);
    set_val(PS5_SQUARE, 0);
    wait(80);
    set_val(PS5_SQUARE, 100);
    wait(60);
    set_val(PS5_SQUARE, 0);
    wait(80);
}

What it teaches: timed output, restart semantics, explicit cancellation, and combo state tracing. combo_run would ignore another start request while the combo is already running; combo_restart deliberately begins again.

Last updated