SL2 Analyzer
Read a FromSoftware .sl2 save and report what is in it
Loading...
Searching...
No Matches
sl2.combine Namespace Reference

Functions

 find_saves (folder)
 Every .sl2 under folder, recursively.
 
 read_file (path, base_dir)
 Parse one file into a snapshot per populated character.
 
 run_summary (rows, carried=None)
 The one-line summary under a run's heading.
 
 run_timeline (rows, refs)
 A run's timeline tables — the "when did this first appear" half.
 
 run_section (key, rows, refs, base_dir)
 One run's whole section: chart, current state, timeline.
 
 build_combined (folder, base_dir, meta=None)
 Build the whole combined document.
 
 combined_footer (snaps, runs, meta)
 The closing block: which games this document covers, how far to trust each, and any setup the caller supplied.
 

Variables

dict SRC
 Evidence tags, spelled out.
 

Detailed Description

Read a FOLDER of saves and write one document covering every run in it.

The single-save export answers "what is in this file". This answers "what have I
played" — drop a directory holding Dark Souls, Dark Souls II, Dark Souls III and
Elden Ring backups together and it sorts them into runs, reconstructs each run's
history from its backups, and writes one Markdown file with a cross-game journey
chart on top, a branch chart per run, and every source file numbered in a reference
list at the end.

Nothing here is filename-driven. Which game a file is comes from its header, which
character a save belongs to comes from the save, and the order comes from the game's
own play-time clock (falling back to the file date where a game does not store one).
Backups can be named anything.

Function Documentation

◆ find_saves()

sl2.combine.find_saves (   folder)

Every .sl2 under folder, recursively.

Case-insensitive, because Windows writes DS30000.sl2 and some tools write .SL2, and sorted so a run of the tool twice over the same folder reads the same.

Definition at line 56 of file combine.py.

◆ read_file()

sl2.combine.read_file (   path,
  base_dir 
)

Parse one file into a snapshot per populated character.

A save that will not parse is SKIPPED, not fatal: a folder of backups collected over years will contain a truncated copy sooner or later, and losing the whole document to one bad file would be the wrong trade. Vanilla Dark Souls II raises SystemExit from the detector, which is caught for the same reason.

Definition at line 69 of file combine.py.

Referenced by sl2.combine.build_combined().

Here is the caller graph for this function:

◆ run_summary()

sl2.combine.run_summary (   rows,
  carried = None 
)

The one-line summary under a run's heading.

Parameters
carriedThe newest snapshot's carried boss set, from carry_bosses.

Definition at line 86 of file combine.py.

Referenced by sl2.combine.run_section().

Here is the caller graph for this function:

◆ run_timeline()

sl2.combine.run_timeline (   rows,
  refs 
)

A run's timeline tables — the "when did this first appear" half.

Every section is skipped when the game has nothing to put in it, so a Dark Souls run does not print an empty Covenants table and an Elden Ring one does not print bonfires it cannot read. The tables walk snapshots in order regardless of branch, which is stated in the document rather than hidden.

Definition at line 123 of file combine.py.

Referenced by sl2.combine.run_section().

Here is the caller graph for this function:

◆ run_section()

sl2.combine.run_section (   key,
  rows,
  refs,
  base_dir 
)

One run's whole section: chart, current state, timeline.

The newest snapshot is re-parsed so its FULL dump can be printed — the timeline knows what changed but not the character's inventory, and re-reading one file is cheaper than carrying every field of every backup through the walk.

Definition at line 249 of file combine.py.

References sl2.combine.run_summary(), and sl2.combine.run_timeline().

Referenced by sl2.combine.build_combined().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ build_combined()

sl2.combine.build_combined (   folder,
  base_dir,
  meta = None 
)

Build the whole combined document.

Parameters
folderA directory to walk, or a list of files already found.
base_dirRepo root, for the item databases.
metaThe environment block from parse_meta, or None.
Returns
The Markdown, as one string.

Definition at line 341 of file combine.py.

References sl2.combine.combined_footer(), sl2.combine.read_file(), and sl2.combine.run_section().

Here is the call graph for this function:

◆ combined_footer()

sl2.combine.combined_footer (   snaps,
  runs,
  meta 
)

The closing block: which games this document covers, how far to trust each, and any setup the caller supplied.

The single-save footer names one game because a save IS one game; a combined document spans several, each with its own support tier, so it lists them rather than picking one and quietly misreporting the rest.

Definition at line 403 of file combine.py.

Referenced by sl2.combine.build_combined().

Here is the caller graph for this function:

Variable Documentation

◆ SRC

dict sl2.combine.SRC
Initial value:
1= {
2 "flag": "confirmed",
3 "soul": "soul held",
4 "gate": "progression",
5 "clear": "cleared (NG+)",
6}

Evidence tags, spelled out.

Same words the single-save export uses.

Definition at line 44 of file combine.py.