Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

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.

OutputContent
localized/<language>/<book>.jsonOne file per book, shape in Book export JSON format
localized/<language>/fonts/*.ttfThe language’s fonts, see Font export
localized/<language>/index.jsonThe language’s books and fonts
export.jsonThe 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:

StepCodeRuns
Open the string archives, list the languagesGame/Assets/LocalizationSourceOnce
Read every plugin’s books and location recordsThe BookRecords and LocationRecords datasets, loaded together: one walk per pluginOnce, plugins in parallel
Merge the raw books for the set of book FormIdsDatasets/Books/BookMergerOnce
Merge locations and find each book’s placementsDatasets/Locations/LocationMerger, Datasets/Locations/BookReachabilityOnce
Read the menu art objects and the records books point atThe BaseObjects and NamedRecords lookups, loaded togetherOnce, plugins in parallel
Resolve menu art objects and convert their texturesPipelines/Books/MenuArtResolutionOnce, objects in parallel
Resolve the spells, skills and keywords books point atPipelines/Books/BookReferencesOnce
Localize, merge and write each languagePipelines/Books/BookLanguageExporterPer language, in parallel
Copy markup texturesPipelines/Books/BookTextureCopierOnce

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 FULL name is localized per language, in the tables of the plugin that wrote it, see Localization.
  • The scan covers every top-level group except WRLD, CELL and BOOK, like the menu art scan, and skips records it doesn’t want without reading their data.

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 --verbose output 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 Resolved is 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 --stats count only.

--stats prints the book reachability counts, the merged record counts, the markup counts and the menu art outcomes on stdout.