ScriptGPCGPC reference

Errors

Compile failures and unexpected error

Read the line the compiler names

  • A missing brace. init, main, and each combo need a matched pair.
  • A name the compiler does not know. A button constant from a different platform, or a function spelled from memory.
  • A wait sitting in main in a build whose rules want waits in combos.
  • A string or a comment that ate the rest of the file because a quote was never closed.

Fix the first line it reports. The next twenty messages are often the same missing brace. Compile again after that one fix before you rewrite the file.

Unexpected error

Studio sometimes says unexpected error when the device, the cable, or the browser session is the problem, including during a firmware update. It is not a GPC keyword. Try a data cable, Chrome or Edge, a fresh USB permission, and a replug. If you were updating firmware, hold the blue button while connecting so you are actually in bootloader, and leave the cable in until the updater finishes. A script that compiled yesterday did not grow a syntax error because the updater failed.

On the device, the practical trace is the OLED. Print a short label when a branch runs, if the file already has a display routine. If you have no display code, you do not have a debugger. Do not add a second feature while you are trying to see whether the first one runs.

Read the line the compiler names

A failed compile stops on a line. Look there first: a missing semicolon, a combo that is never closed, a wait outside a combo, a name you typed two different ways. The message "unexpected error" is often the same class of problem when the parser lost the plot. It is not a sign the Zen hardware failed. Hardware is not involved until a file compiles.

If the file compiles and the device does nothing, you are past this page. Check the slot name, the ports, and whether main actually calls the combo. A combo that is defined and never started with combo_run is a file that compiles and sits still.

PS5 and Xbox feel different when the constants are wrong, not when the compiler is cursed. A sketch written with PlayStation button names will not press the Xbox face button you had in your head. That shows up in game, after a clean compile. Keep two tiny files if you test both pads, rather than one file full of guesses.

Debug on the device by making the change obvious: a long wait, a single set_val you can feel. If you change five lines and the shot feels late, you learned nothing. One line, compile, program, test.