Quick answer
Every transmission script in Code: Terraform needs the same order: get the transmitter, connect to Earth, then transmit a key/value pair. The first sensor uplink uses a descriptive key like current_temperature. Contract submissions follow the same pattern, except the key should be the current contract ID string and the value should be the answer your contract logic already computed.
The transmission sequence
For a contract submission, get the transmitter and connect to Earth after your contract logic has produced two real values in your script:
contract_id— the current contract’s ID string.answer— the result you calculated for that contract.
Then the transmission portion is:
transmitter = get_component("transmitter")
transmitter.connect("earth")
transmitter.transmit(contract_id, answer)
This is a transmission pattern, not a universal contract solution. The site deliberately does not invent a contract ID or answer.
Transmission rules shown in the starter walkthrough
- Connect before transmitting in the current script run.
- The key is a string.
- For contract answers, the key is the contract ID and the value is the computed answer.
- Successful delivery is observed through the game’s success feedback and credit change, not a special return value from
transmit().
Separate computation from delivery
For harder contracts, compute the answer first and keep that result in a variable. Only after the answer is ready should you connect the transmitter and send it. This makes it much easier to distinguish a bad answer from an uplink mistake.
Common mistakes
- Reusing a transmitter assumption from an earlier run without reconnecting.
- Passing a contract object where the API wants the contract ID string.
- Debugging the transmitter when the actual contract answer is wrong.