X4: Foundations
Modding Wiki
Ships, UI, scripts and game data.
Practical guides for your mods.
Create your first XML mod
ONE CHANGE · A CLEAR RESULTChange ship properties
Patch the Elite Vanguard hull value.
From extension structure to verifying the result.
What would you like to change?
API referenceShips and equipment
New ships, hull variants, models and equipment.
Data and content
Properties, wares, prices, text and dependencies.
XML and Mission Director
Patches, cues, events, variables and persistence.
UI and Lua
Custom windows, buttons, settings and MD communication.
Native integration
LuaJIT FFI, C++ and game version compatibility.
API reference
Lua calls, MD elements and game properties.
Your first XML patch
Explore the examplePatch one hull attribute without replacing the complete original file.
<diff>
<replace sel="/macros/macro[@name='ship_arg_s_fighter_02_a_macro']/properties/hull/@max">3600</replace>
</diff>Learning example The original field was checked against X4 9.00 files; this example was not separately run in game.
Useful foundations
HOW MOD FILES FIT TOGETHERNew to modding? Read how X4 code works and the operators and functions cheat sheet.
Find the model, properties and ship ware.
02 / TEXTAdd your own name and descriptionLanguage files, text pages and {page,id} references.
03 / VERIFICATIONVerify the effect in a single player gameLoading, correct values, persistence and compatibility.
Practical guides
FROM SIMPLE TO ADVANCEDGetting started with X4Online code
A guided route through X4FO: the project map, ship rename flow, Python basics and your first task. Network architecture and walkthroughs have their own section.
Start exploring the code