Names and continuity

Two more optional parts decide how saves are labelled and tracked:

Both pick a value the same way, with an extractor.

Extractors

A bare-string extractor takes the value straight from the file or folder:

When the useful part is buried in the name, use the regex form to capture it:

name:
  regex:
    from: basename
    pattern: "^Slot([0-9]+)_.*\\.dat$"
    group: 1

continuity:
  regex:
    from: basename
    pattern: "^Slot([0-9]+)_.*\\.dat$"
    group: 1

from is what to match against (basename, stem, or relpath), pattern is the regex, and group is which captured group to use.

You can do this in the form, too — no YAML required: pick the source from the dropdown (that’s the from), then enter your pattern in the Regex field beside it. A Group field appears for choosing which captured group to use. Clear the Regex field and you’re back to the plain source.

When the value you need lives inside the file rather than in its name, use the file content source. Pick a format and give it an expression:

name:
  file_content:
    format: xpath          # regex | xpath | gjson
    expr: "/Profile/Name"

continuity:
  file_content:
    format: gjson
    expr: "profile.uuid"

format is how to read the file — regex (search the whole file as text), xpath (an XML document), or gjson (a JSON document) — and expr is the selector for that format. For regex only, an optional group picks which captured group to use.

In the form: choose file content as the source, pick the Format, and type your Expression. A Group field appears for the regex format.

Use “file content” only when nothing else identifies the save. Reading a value from inside the file means the app has to open and parse it. And for continuity it’s risky: continuity is the save’s identity, so if that in-file value ever changes, the app sees a different save and your history splits in two. Whenever a filename- or path-based source (stem, basename, relpath, or a regex on the name) identifies the save reliably, use that instead.

Defaults you usually don’t set

Leave name and continuity out and they’re derived from your discover kind — which is right for almost every game:

DiscoveryDefault nameDefault continuity
singletonconstant:mainconstant:main
filestemrelpath
dirbasenamerelpath
filesstemrelpath
dirsbasenamerelpath

The pattern behind the table: a save that’s a file is named by its stem; a save that’s a folder is named by its basename; a singleton is always just main. Continuity is the save’s relpath for everything except singleton.

For completeness, payload defaults to subtree and trigger defaults to same_as_payload, both covered on the payload, trigger, and ignore page. Set name or continuity yourself only when the defaults give you something unhelpful — a generated name you can’t tell apart, or an identity that breaks when the game renames files.