Overview
The Civilization VII TypeScript Modding Tools are a developer-friendly framework that provides a declarative approach to mod creation, eliminating the need to manually edit complex XML files. Created by GitHub user “izica” in March 2025, these tools use TypeScript’s type safety and object-oriented features to simplify the mod development process. As the creator explains: “I almost lost my mind after spending several evenings editing XML files, trying to create my own civilization. This led me to the thought that I’d like to have a more declarative way to develop content mods.”Key Features
- Declarative API: Define game elements using strongly-typed builder classes
- Auto-generation: Automatically generates all required XML files in the correct structure
- Type Safety: Leverages TypeScript’s type system to prevent errors and provide autocomplete
- Component Binding: Easily link related mod elements (civilizations, units, buildings, etc.)
- Age-aware: Built with Civilization VII’s Ages system in mind
Documentation Structure
To help you make the most of the TypeScript Modding Tools, we provide three complementary document sections:- This Overview Document - Covers general concepts, features, and limitations
- Technical Implementation Guide - Details the toolkit’s architecture and internal workings
- How-To Guides: A series of practical tutorials for common modding tasks:
Installation Options
Option 1: From NPM
Option 2: From GitHub Repository
- Install Node.js from https://nodejs.org/
- Clone or download the repository:
- Navigate to the repository directory and install dependencies:
- Modify the
build.tsfile to define your mod - Run the build command:
Supported Game Elements
The toolkit currently supports creating and managing:- Mod Information - Basic mod metadata
- Civilizations - Full civilization definitions with traits and abilities
- Leaders - Leader definitions and civilization associations
- Units - Custom and replacement units
- Buildings - Standard buildings and improvements
- Unique Quarters - Special district types
- Traditions - Custom player bonuses
- Progression Trees - Technology and civic advancement trees
- Game Effects - Custom game modifiers and effects
- Icons and Assets - Import and reference custom images
- SQL Files - Import custom SQL for advanced modifications
Basic Usage Pattern
The toolkit follows a builder pattern workflow:- Create a
Modinstance - Define game elements using builder classes
- Add elements to the mod
- Build the mod to generate files
Examples Directory
The toolkit includes several example files demonstrating various features:- Civilization Creation
- Unit Creation
- SQL File Import
- Custom Icon Import
- Progression Tree Creation
- Unique Quarter Creation
Current Limitations
As of March 2025, the toolkit covers approximately 60-80% of modding use cases. Areas not yet supported include:- Advanced Visual Assets - Creating new 3D models or animations
- UI Modding - Custom interface elements and screens
- Map Scripts - Custom map generation algorithms
- Great People - Custom great people definitions (in development)
- AI Behavior - Detailed AI personality adjustments
- Wonders - Wonder definitions (planned)
- Unit Abilities - Detailed unit ability configurations (planned)
- Scenarios - Custom scenario creation and management
Troubleshooting
Common Issues
- TypeScript Errors: Ensure you have the correct version of TypeScript installed (
pnpm add typescript@latest) - Missing Icons: Verify file paths to custom icons are correct relative to your build script
- Build Failures: Check the console output for specific error messages
- In-Game Issues: Look for mod loading errors in the game’s log files at
<GAME_DATA>/Logs/modding.log
Getting Help
For assistance with the toolkit:- Post in the CivFanatics Forum Thread
- Open an issue on the GitHub repository
Integration with Other Modding Techniques
The TypeScript toolkit can be used alongside other modding approaches:- Generate base files with the toolkit
- Manually refine specific XML files if needed
- Package the results for distribution
Future Development
According to the toolkit’s roadmap, planned features include:- Great People nodes and builder
- AI nodes and builder
- Additional localization support
- Unit abilities nodes and builder
- Wonder nodes and builder