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

1. Beginner: hair trigger with enable toggle

Difficulty: Beginner

hair-trigger-with-enable-toggle.gpc
int enabled = TRUE;

main {
    if(event_press(PS5_TRIANGLE)) {
        enabled = !enabled;
        set_val(PS5_TRIANGLE, 0);
    }

    if(enabled && get_ival(PS5_R2) > 10) {
        set_val(PS5_R2, 100);
    }

    set_val(TRACE_1, enabled);
}

What it teaches: raw input, event toggle, current-cycle suppression, final output, trace.

Last updated