Fix a red line in Harsh code

In Savebot: The Last Garden, read the red line’s number and suggested closest command. Savebot’s editor identifies an unknown word by name. Use the Workshop’s insert control to get the game’s current command rather than guessing Python library syntax.

Full Steam release unless a source specifies the demo. Evidence checked . Guide updated .

Steps

  1. Go to the line the editor marks in red. Read the exact name it rejected and the closest name it suggests. For a recycling action, the example in the store uses recycle().
  2. Replace the rejected word with the in-game command if it does the intended action. Check punctuation and indentation without changing unrelated parts of the routine.
  3. Run the program again and watch whether the corrected line is reached. If a different line stops it, fix that new issue in isolation.

How to tell it worked

The error at that line disappears and the intended command can be reached during a run.

If you are still stuck

If the code validates but behavior is wrong, inspect the conditions with the debugger. A valid command can still sit in the wrong branch.

Identify the rejected word and what it was supposed to do

Read the line number and the name the editor identifies. At that position, decide whether you wanted an action such as recycling or a test such as checking whether cargo is full. The official Harsh example uses recycle() as an action and full() as a test. They concern related parts of the same job and occupy different positions in the example. Confirm the purpose of the rejected word before choosing an offered correction.

Check the game's insertion tools for the corresponding command. The closest name is a clue. Compare its meaning with your intended job and its placement in the working example. If the rejected word is the action inside the full case, put the game-provided action in the same branch and preserve the indentation. If it was the condition, compare how the example writes a condition including its parentheses and colon.

Limit the change so you can read the new result

Keep a copy of the original line and surrounding decision. Replace the identified word and try the editor again. If the red marker moves to another line, read that message on its own. If it stays at the same spot, compare the current spelling and punctuation to what the insertion tool produced. Check the neighboring branch indentation and whether you accidentally left the old word in place beside the new one.

For example, suppose the intended command belongs to the second branch and the editor now accepts it. Start the robot with enough power and let cargo become full. The first branch will correctly take priority if power drops. In that case, reproduce a full-cargo run with enough battery so you can actually reach the repaired line. Watching a regular collect action succeed tells you that the program runs and leaves the repaired command untested.

Distinguish editor acceptance from a repaired job

Look for three different outcomes: the original error clears, the command becomes the active line during the relevant case and the selected robot completes the intended action. If you reach only the first, check the condition that should select it. If the active line is correct and nothing useful happens in the world, inspect the target and whether the robot could act there. This sequence avoids changing a correctly spelled command again when its job is now failing later.

If you still need help, keep the exact error, the intended command, the few lines controlling it and a description of what the robot did. That gives another player a way to see whether the remaining issue is spelling, branch structure or the conditions where you ran the test.

Related tasks

Sources