X4: Foundations Modding Reference
A comprehensive reference for developing X4: Foundations mods (extensions). Compiled from Egosoft’s official documentation, game file analysis (v9.00), and community resources.
Sections
| Topic | Description |
|---|---|
| Extension Structure | content.xml manifest, load order, substitution catalogs |
| Catalog System | .cat/.dat format, naming conventions, override semantics |
| XML Diff Patching | add/replace/remove operations, XPath, conditional patching |
| Mission Director | MD scripting: cues, events, actions, variables |
| AI Scripts | Ship/NPC behavior: orders, interrupts, attention levels |
| Libraries | Game data XML: wares, jobs, factions, modules |
| Localization | Translation files, language codes, text references |
| UI / Lua Scripting | Lua UI modding, Protected UI Mode, kuertee API |
| Maps, Components, Macros | Index files, macro paths, asset structure |
| XSD Schemas | Schema hierarchy, extraction, validation |
| In-Game References | scriptproperties.html, jobeditor, VS Code integration |
| Build Workflow | Project structure, build commands, installation |
| Debugging | Debug log, launch parameters, common errors |
| Common Recipes | Add wares, modify values, MD scripts, NPC jobs, ships |
| File Types | All file extensions in game archives |
| Signature Files | RSA signatures, DRM, impact on mods |
| Common Pitfalls | Top 10 recurring modding mistakes |
| Quick Reference Links | All official, tool, and community URLs |
External resources
Official:
Community:
Example mods:
- Genesis Signal – MD game-start event detection
- DeadAir Scripts – AI script modifications
- kuertee UI Extensions – Lua UI callback system
Table of contents
- Extension Structure
- Catalog System (.cat/.dat)
- XML Diff Patching
- Mission Director (MD) Scripts
- AI Scripts
- Libraries (Game Data XML)
- Localization (Translation Files)
- UI / Lua Scripting
- Maps, Components, and Macros
- XSD Schemas
- In-Game Reference Files
- Build Workflow with x4cat
- Debugging
- Common Modding Recipes
- File Type Reference
- Signature Files
- Common Pitfalls
- Quick Reference Links