Modding
Discord Wishlist on Steam

Graphs

Saved values

A variable marked Saved keeps its value in the game's save, and on a server in its world store, instead of starting again each time the game loads. The Bells at Prime example counts its mornings this way.

json
"vars": [ { "name": "days", "kind": "Int", "value": 0, "saved": true } ]

On the bench it is the Saved switch under a variable in the side panel.

What is kept

  • Graph variables are kept per mod and graph (<mod id>/<graph file>), each by name. Mod variables are kept per mod. Variables on things are kept with each person or thing that has a lasting key: a save key, a person of the world file, a player's account.
  • Numbers, yes or no, text, positions ([x, y]), colours ("#rrggbbaa"), things and items by address, and lists and maps of those.
  • People have no lasting identity and are kept as nothing.
  • A local variable is never saved: it lives for one run.

Loading

  • A graph the save knows nothing of (a save from before its mod was on) starts its saved variables afresh.
  • A value that no longer fits its variable's kind starts that variable afresh.
  • What a save holds for graphs not loaded now (a mod switched off) is kept and written back, so switching a mod off and on again loses nothing.

The Count and save template counts the bandits killed in a saved variable, and puts up a note at every tenth.