Moondog, day 6 (20 Oct): the first recipe, and a fight with the UI

25 commits. Two of them were the actual feature. The other 23 were me learning how Godot 4 wants its UI built.

Refining and quality

  • The first refining recipe: linden wood into linden planks at the sawmill. It's a timed job that pauses if you walk away and picks up again when you come back.
  • Quality and durability. Refined materials stack only with the same quality. Crafted items carry a quality, and equipment carries durability.

The UI tax

The rest of the day went to the panels. Some of the things that tripped me up:

  • Dictionary.get() returns a Variant, so GDScript couldn't infer a type from it. That took three commits to settle.
  • GDScript 4 has no String * int, so the quality stars are built in a loop.
  • Dictionary.empty() is now is_empty().
  • In a .tscn, a script goes on its own line, and parent paths are relative to the scene root. Getting either wrong means the script silently doesn't attach.
  • NOTIFICATION_VISIBILITY_CHANGED doesn't exist under that name, and the parse error stopped the whole script from loading. That's why refresh() seemed to be missing.
  • The F12 keycode in the project file was wrong. Godot 4.7 uses a much larger number for the F-keys than I'd assumed.

Where it ended up:

  • The character and station panels are proper scenes now, so I can lay them out in the editor.
  • C opens the character panel, F12 the GM panel (top right). They refresh when opened, and each has a Close button.
  • While a panel is open, the cursor is free and the camera stays put. Before that, you couldn't click a button at all, and when you could, the view turned under you.
  • A GM who logs in after the server started now gets the list of node types right away. The dropdown used to be empty until a restart.
  • A small check script presses the real keys and makes sure each panel actually opens.