--- title: Macros, components and indexes summary: Why a filename, macro, component and ware are different parts of a ship definition. section: ships kind: guide status: reference tags: ["X4","modding","ship","macros"] sources: ["https://gist.github.com/MattMcFarland/1282329f83f88f1b98520c5e2ec491a2"] --- ## Four layers A macro file contains the definition. A macro defines game configuration, class, properties and connections. A component supplies the model and geometric connections. A ware defines trade, price, production, availability and its macro reference. Indexes connect registered names to resource paths; putting an XML file in an arbitrary folder does not prove the game can resolve it. ## An existing chain The inspected X4 9.00 example below links a ware to its macro and model component. Similar names serve different purposes. A variant can reuse the component while introducing its own macro and ware. ```text ware: ship_arg_s_fighter_02_a → macro: ship_arg_s_fighter_02_a_macro → component: ship_arg_s_fighter_02 ``` ## Where to find a property Elite hull properties are under `properties/hull`, and mass under `properties/physics`. Cargo capacity is connected through a separate storage macro. `storage/@missile` in the ship macro is not cargo hold volume. Follow references before choosing a patch field. ## New resources Prefix new macro and component IDs with your extension namespace. Register custom models, but do not reregister an existing model as new. See [the complete ship route](wiki:adding-ship).