Skip to main content

Module extract

Module extract 

Source
Expand description

Extraction of a campaign’s start_pos_* tables from its startpos: the inverse of the build.

The extractor reads a startpos through the record layouts and rebuilds the rows it was built from, so a startpos without its tables can be edited again, and a generated startpos can be checked against the tables it came from (see compare).

The build doesn’t keep everything, so the extracted rows are the ones that build the same startpos:

  • Columns the build ignores (descriptions, multiplayer counts…) keep the table’s default value.
  • A province’s fertility, public order and development are sums over its regions: the sum goes to one region.
  • Horde buildings fill the first building columns, and garrison and bodyguard units aren’t rows.
  • Faction and region ids are kept (the startpos has them in localisation keys). Other row ids are numbered from 1.
  • Lists the game stores in hash order (units, traits, technologies…) come out in startpos order.

Besides the tables, the extraction gets back the victory objectives (victory_objectives.txt), which the build also reads. The settlements listed by loot and raze objectives aren’t kept.

§Submodules

  • compare: comparison of extracted tables with the tables a startpos was built from.

Modules§

compare
Comparison of the tables extracted from a startpos with the tables it was built from.

Structs§

ExtractedTables
The start_pos_* rows of a campaign, extracted from its startpos.
TableRows
Rows of a table, with their values as text.

Constants§

EXTRACTION_TABLES
Game tables the extraction reads, besides the startpos, without the _tables suffix.

Functions§

extract_tables
Extracts the start_pos_* tables of a campaign from its startpos.