Expand description
Assembly Kit integration for importing official table definitions.
This module provides functionality to parse and import table structure information from Creative Assembly’s official Assembly Kit tools. This allows RPFM’s schemas to stay synchronized with the official game data formats.
§Assembly Kit Versions
Different Total War games use different Assembly Kit formats:
-
Version 0: Empire Total War and Napoleon Total War
- Uses
.xsdXML schema files - Simpler structure without relationship metadata
- Uses
-
Version 1: Shogun 2 Total War
- Uses XML files with
TWaD_prefix - Includes localisable field information
- Uses XML files with
-
Version 2: Rome 2 and later (including Warhammer series, Three Kingdoms, Troy, etc.)
- Enhanced XML format with full relationship metadata
- Separate relationship and localisable fields files
- Field-level metadata (descriptions, highlight flags for unused fields)
§Main Functionality
§Schema Updates
The primary function update_schema_from_raw_files() processes Assembly Kit files to:
- Update field types, keys, and default values
- Import foreign key relationships
- Detect localisable (translatable) fields
- Mark unused fields (via highlight flags)
- Extract hardcoded lookup data from description fields
§File Parsing
The module can parse several Assembly Kit file types:
- Table definitions (
TWaD_*.xmlor*.xsd): Field structure and types - Localisable fields (
TExc_LocalisableFields.xml): Translation-ready fields - Relationships (
TWaD_relationships.xml): Foreign key relationships - Table data: Sample data for generating hardcoded lookups
§Submodules
table_definition: XML parsing for table structure definitionstable_data: XML parsing for table sample datalocalisable_fields: XML parsing for localisable field lists
§Example Usage
ⓘ
use rpfm_lib::integrations::assembly_kit::update_schema_from_raw_files;
use rpfm_lib::schema::Schema;
use rpfm_lib::games::supported_games::{SupportedGames, KEY_WARHAMMER_3};
use std::path::Path;
use std::collections::HashMap;
let mut schema = Schema::load(Path::new("schemas/warhammer_3.ron"), None)?;
let supported_games = SupportedGames::default();
let game_info = supported_games.game(&KEY_WARHAMMER_3).unwrap();
let ass_kit_path = Path::new("C:/Program Files/Steam/steamapps/common/Total War WARHAMMER III/assembly_kit");
let schema_path = Path::new("schemas/warhammer_3.ron");
let tables_to_check = HashMap::new(); // Load vanilla tables here
let unfound_fields = update_schema_from_raw_files(
&mut schema,
game_info,
ass_kit_path,
schema_path,
&[],
&tables_to_check,
)?;Modules§
- localisable_
fields - Localisable fields parsing for Assembly Kit integration.
- table_
data - Assembly Kit table data parsing and conversion.
- table_
definition - Assembly Kit table definition parsing and schema generation.
Functions§
- get_
raw_ data_ paths - Returns paths to all table data files in an Assembly Kit directory.
- get_
raw_ definition_ paths - Returns paths to all table definition files in an Assembly Kit directory.
- get_
raw_ extra_ relationships_ path - Returns the path to the extra relationships metadata file.
- get_
raw_ localisable_ fields_ path - Returns the path to the localisable fields metadata file.
- update_
schema_ from_ raw_ files - Updates an existing schema with metadata from Assembly Kit files.