GPC script structure and syntax
How a Cronus Zen .gpc file is organized, from compile-time declarations through init, main, combos, and functions.
Overview
A GPC source file is compiled before it runs on a Cronus device. Put compile-time declarations and global storage before runtime blocks, then organize behavior around main, optional init, combos, and user functions.
The main block is mandatory. Keep source order and declaration placement explicit so the compiler can distinguish setup from executable statements.
Key facts
- Every runnable script requires a main block.
- init is optional and executes once when the script starts.
- main executes repeatedly while the slot is active.
- Remap and unmap declarations belong before runtime blocks.
GPC syntax examples
Examples are intentionally small. Replace identifiers only with values documented for your target.
init {
// one-time setup
}
main {
// repeated runtime logic
}Functions, commands, and terms
Names below are catalog entries, not guessed signatures. Open the official sources for current parameter and return-value details.
mainkeywordDeclares the mandatory repeating execution block.
initkeywordDeclares the optional one-time initialization block.
combokeywordDeclares a named timed sequence.
functionkeywordDeclares a reusable user function.
Common mistakes
Omitting main.
Placing declarations inside executable statements.
Assuming source runs top-to-bottom only once.
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
Use define declarations and built-in identifier constants without confusing textual names with runtime variables.
Executioninit and main execution modelKnow what runs once, what loops, and why blocking or one-time work belongs in the correct execution block.
ExecutionGPC combos, wait, and callAuthor timed first-level combo steps with legal wait durations and compose sequences with combo-only call.