Compiler errors and GPC debugging
Diagnose placement, identifier, type-range, combo-timing, and target-version problems systematically in Zen Studio.
Overview
Start with the first compiler error because later messages may be consequences. Reduce the failing area to a minimal script, then restore code in small verified pieces.
Many failures are structural: a declaration in the wrong section, wait or call outside a combo, a recursive function, an unsupported Zen-only API, or a misspelled identifier.
Key facts
- The first reported compiler error is often the most useful.
- Compiler and firmware versions can change available functions.
- A minimal script should still contain mandatory main.
- Warnings about numeric range deserve attention because variables are signed 16-bit integers.
GPC syntax examples
Examples are intentionally small. Replace identifiers only with values documented for your target.
main {
set_val(TRACE_1, get_val(XB1_A));
}Functions, commands, and terms
Names below are catalog entries, not guessed signatures. Open the official sources for current parameter and return-value details.
mainkeywordProvides the mandatory loop needed by a minimal compile test.
TRACE_1..TRACE_6constant familyOfficial trace output identifiers written through set_val.
set_valfunctionWrites a trace identifier or controller output value.
Common mistakes
Fixing the last error before the first.
Testing old code without checking target compatibility.
Calling a nonexistent trace function or using OLED printf as logging.
Changing several unrelated areas between compile attempts.
Official GPC sources
Use these first-party references to confirm exact syntax and runtime behavior for your installed firmware and Studio version.
Related GPC references
Identify the output console, write controller output, block a Zen output cycle, and observe values through TRACE channels.
LanguageGPC script structure and syntaxHow a Cronus Zen .gpc file is organized, from compile-time declarations through init, main, combos, and functions.
ExecutionGPC combos, wait, and callAuthor timed first-level combo steps with legal wait durations and compose sequences with combo-only call.