Layers of a regular mod#

An extension can contain data, game scripts and UI code. A property change needs only a manifest and a targeted XML diff. Add other layers when the task requires them.

File or folder Purpose
content.xml Identity, description, version and dependencies
assets/ Ships, equipment, models and macros
index/ Resource registration
libraries/ Wares, recipes and other data
md/ Mission Director event logic
aiscripts/ AI behavior and patches
ui.xml, ui/ UI registration and Lua
t/ Text and translations

Choose a route for your task#

Start with ship properties, a new ship variant, a custom window, an MD event or localized text. A regular mod does not require a separate service, TCP transport or native DLL.

UI and the game effect#

Lua builds the window and receives input; MD can perform world logic. Send an event, validate the object, perform the action, return the actual result and then update the window. Do not put every world change in a drawing callback. The original diagram below illustrates that flow.

TEXT
Кнопка интерфейса
  → событие в MD
  → проверка объекта и выполнение действия
  → ответ в Lua
  → обновление окна

Next step#

New to programming? Read how X4 code works and the syntax cheat sheet. Your first extension introduces the manifest. Dependencies explains how to separate your files from DLC and third-party resources.