export:books pipeline
export:books <data-directory> -o <dir> [--clean] [--load-order se|ae|custom [--load-order-plugins <names|file>] [--load-order-archives <names|file>]] [--stats]
Exports every book, merged across the load order, for every language with string tables in the load order’s archives. Without any string table there is nothing to export: there is no single-language fallback.
--clean empties <dir> first. It is refused when <dir> holds the Data directory or a load order list file.
| Output | Content |
|---|---|
localized/<language>/<book>.json | One file per book, shape in Book export JSON format |
localized/<language>/fonts/*.ttf | The language’s fonts, see Font export |
localized/<language>/index.json | The language’s books and fonts |
export.json | The load order the export read and the options it ran with, shared by all languages, see Export manifest |
textures/ | Every texture book markup references, shared by all languages |
textures/menuart/ | Menu art converted to PNG |
Flow
Pipelines/Books/BookExportPipeline.cs runs the steps; Commands/ExportBooksCommand.cs only parses the options:
| Step | Code | Runs |
|---|---|---|
| Open the string archives, list the languages | Game/Assets/LocalizationSource | Once |
| Read every plugin’s books and location records | The BookRecords and LocationRecords datasets, loaded together: one walk per plugin | Once, plugins in parallel |
| Merge the raw books for the set of book FormIds | Datasets/Books/BookMerger | Once |
| Merge locations and find each book’s placements | Datasets/Locations/LocationMerger, Datasets/Locations/BookReachability | Once |
| Read the menu art objects and the records books point at | The BaseObjects and NamedRecords lookups, loaded together | Once, plugins in parallel |
| Resolve menu art objects and convert their textures | Pipelines/Books/MenuArtResolution | Once, objects in parallel |
| Resolve the spells, skills and keywords books point at | Pipelines/Books/BookReferences | Once |
| Localize, merge and write each language | Pipelines/Books/BookLanguageExporter | Per language, in parallel |
| Copy markup textures | Pipelines/Books/BookTextureCopier | Once |
Location data, menu art and book references don’t depend on language, so they’re computed once
from the raw, unlocalized records. Text does: each language localizes every plugin’s books
against that plugin’s own tables before merging (Datasets/Books/BookLocalization), see
Localization.
Per language, BookLanguageExporter writes each book file (Pipelines/Books/BookFileExporter), collects
the fonts and textures its markup references (Pipelines/Books/BookMarkupScanner), converts the fonts
(Pipelines/Books/Fonts/FontLibraryExporter) and writes index.json (Pipelines/Books/BookIndexWriter). Languages write to
separate directories; their log lines interleave, each naming its language.
Book references
A book’s DATA can name what it teaches (a SPEL, or a skill through its AVIF), and its
KWDA lists KYWD records. BookMerger resolves these FormIds against the writing plugin’s
masters. BookReferences then reads each distinct record once for the whole run
(the Datasets/Lookups/NamedRecords lookup): its EditorID and its FULL name.
- A record the load order doesn’t have is a warning; the book keeps the bare FormId.
- The
FULLname is localized per language, in the tables of the plugin that wrote it, see Localization. - The scan covers every top-level group except
WRLD,CELLandBOOK, like the menu art scan, and skips records it doesn’t want without reading their data.
MenuArt resolution
A book’s INAM points at an object whose model shows the book’s artwork. Every vanilla spell tome
has one. MenuArtResolution resolves each distinct object once for the whole run: the base object
(the Datasets/Lookups/BaseObjects lookup), its NIF, then every diffuse texture, converted to PNG
(Pipelines/Books/MenuArtImageResolver, Pipelines/Books/MenuArtTextureConverter).
- Objects resolve concurrently. Log lines are written afterwards in a fixed order, so
--verboseoutput is stable. - A texture shared by several objects is converted once. The PNG is named after the archive entry; two different entries with the same file name make the second one fail for its object rather than overwrite the first. No vanilla texture hits this.
- Every outcome other than
Resolvedis a warning; a book whose object doesn’t resolve stays text-only. - Whether a book has text of its own is checked on one language, for the
--statscount only.
--stats prints the book reachability counts, the merged record counts, the markup counts and
the menu art outcomes on stdout.