Skip to main content

Crate rpfm_extensions

Crate rpfm_extensions 

Source
Expand description

High-level extensions for Total War modding built on top of rpfm_lib.

This crate provides advanced features that build upon the core file handling capabilities of rpfm_lib. While rpfm_lib focuses on low-level file format parsing and encoding, this crate implements higher-level modding workflows and analysis tools.

§Modules

§Dependencies Management

The dependencies module provides a comprehensive system for managing dependencies between packs and vanilla game files:

  • Loading and caching vanilla game data for reference lookups
  • Managing parent mod dependencies with automatic recursive loading
  • Building reference data for DB table foreign key relationships
  • Assembly Kit integration for tables not present in game files

§Diagnostics

The diagnostics module implements validation and error checking:

  • DB/Loc table validation (invalid references, empty keys, duplicates)
  • Pack-level checks (conflicting files, missing dependencies)
  • Portrait settings validation
  • Animation fragment validation
  • Configurable diagnostic levels (Info, Warning, Error)

§Lua Scripting API

The lua module describes the Lua scripting API of the games:

  • Functions, parameters and return types, built at runtime from the Assembly Kit’s scripting docs
  • Game interfaces and the context accessors of each event

The search module provides search and replace functionality across entire packs:

  • Pattern and regex-based searching
  • Case-sensitive and case-insensitive modes
  • Search across multiple file types (DB, Loc, Text, etc.)
  • Search in vanilla/parent dependencies
  • Batch replace operations

§Pack Optimizer

The optimizer module helps reduce pack size and improve compatibility:

  • Remove files identical to vanilla (ITM - Identical To Master)
  • Remove duplicate and ITM table rows
  • Clean up unused Portrait Settings entries
  • Remove unnecessary XML and auxiliary files
  • Datacore management for twad_key_deletes tables

§Startpos Generation

The startpos module rebuilds campaign startpos files without the game:

  • Campaign map coordinate systems (world, raw map units, hex cells)
  • Trade network from trade_routes.ptd
  • Settlement slot and sprawl layouts from map_data.esf
  • Region of each map cell, from map_data.esf
  • The world stage: garrisons, bodyguards, pools, government, legacies, rebels, provinces and seas

§Translation Support

The translator module assists with mod localization:

  • Extract translatable strings from packs
  • Track translation status and changes
  • Auto-translate from vanilla localisation data
  • Export/import translation files

§glTF Export

The gltf module provides 3D model export capabilities:

  • Convert RigidModel files to glTF format
  • Preserve mesh data, materials, and textures
  • Support for multiple LOD levels as separate scenes

Modules§

dependencies
Dependencies management system for Total War modding.
diagnostics
Pack validation and diagnostic checking system.
gltf
glTF export support for RigidModel 3D models.
lua
Knowledge about the Lua scripting API of the games.
merge
Delta merge: combine same-named DB/Loc tables by row identity instead of blindly concatenating every row.
optimizer
Pack optimization system for reducing size and improving compatibility.
search
Global search and replace functionality for Pack files.
startpos
Generation of campaign startpos files (startpos.esf) without the game.
translator
Mod translation and localization support.