Reference

Common Errors & Debugging

The common early mistakes in Code: Terraform: indentation, undefined names, wrong transmit keys, None states, and power-related false negatives.

Starter debugging reference · checked 2026-09-08

Guide artwork of environmental monitoring consoles used for debugging reference
Guide artwork — not an in-game screenshot.

Quick answer

The earliest Code: Terraform errors are usually small and fixable: wrong component names, missing indentation after if/else or while, using a non-string transmit key, reading recipe data before analyze() has produced it, or blaming the code when the machine actually lost power. If you debug in that order, you usually find the problem fast.

Quick triage order

  1. Check that the machine is powered and you are editing the intended script slot.
  2. Check component names and target strings exactly.
  3. Check indentation under if, else, and while.
  4. Check current machine state before reading deeper properties such as self.input.recipe.
  5. Only then question the math or contract algorithm.

Common early errors

Error patternUsually meansFirst fix
expected indent at start of blockA child line under if, else, or while is not indentedFix block indentation
contract is not definedA variable name was used before assignmentCreate/assign it before use
expected string for keyThe first transmit() argument is not a stringPass a quoted key / contract ID string
cannot access recipe on noneThe lab has no analyzed specimen readyCheck self.input and analyze first
Valid-looking code but no progressPower or machine state is blocking the actionCheck power, cargo, and stage

Low-friction debugging habits

  • Keep intermediate values in named variables while learning the system.
  • Print a temporary value or branch result when you need to prove what the code is doing.
  • Split contract answer computation from transmitter delivery.
  • Read state before issuing a hardware action. This is especially important in the biology loop.