--- title: How an X4 extension is organized summary: The folders and layers of a regular extension: game data, ships, MD, Lua and localization. section: start kind: guide status: reference tags: ["X4","modding","architecture"] sources: ["https://wiki.egosoft.com/X4%20Foundations%20Wiki/Modding%20Support/"] --- ## 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](wiki:editing-parameters), [a new ship variant](wiki:adding-ship), [a custom window](wiki:create-ui), [an MD event](wiki:md-cues) or [localized text](wiki:localization). 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](wiki:x4-code-basics) and the [syntax cheat sheet](wiki:x4-language-cheatsheet). [Your first extension](wiki:first-extension) introduces the manifest. [Dependencies](wiki:compatibility) explains how to separate your files from DLC and third-party resources.