Find the actual field#

The locally inspected X4 9.00 macro ship_arg_s_fighter_02_a_macro has properties/hull/@max = 1800. This example sets an absolute value of 3600. The source structure and selector were checked against the installed game. The new extension itself was not separately run in game.

Mod structure#

Complete example files are in wiki/examples/elite_hull. Place a unique content.xml directly at the extension root and the diff at the original macro's relative path. The manifest below targets game version 9.00.

TEXT
wiki_elite_hull/
├── content.xml
└── assets/units/size_s/macros/
    └── ship_arg_s_fighter_02_a_macro.xml
XML
<content id="wiki_elite_hull" name="Wiki: Elite Hull" version="100"
         author="Your name" enabled="1" save="1"
         description="Sets Elite Vanguard hull to 3600.">
  <dependency version="900" />
</content>

Apply a targeted patch#

The diff changes one attribute of one macro. It does not copy the whole original ship definition into the extension. Keeping the change narrow reduces unnecessary conflicts.

XML
<diff>
  <replace sel="/macros/macro[@name='ship_arg_s_fighter_02_a_macro']/properties/hull/@max">3600</replace>
</diff>

Verify the change#

  1. Confirm that X4 detects and enables the extension.
  2. Check for diff application errors.
  3. Compare the selected variant's maximum hull with the original.
  4. Test a new instance and an already saved ship separately.
  5. Save and reload the test game.

Changing maximum hull is not a repair command for a damaged ship. A later-loading mod may change the same attribute.

Other properties#

Mass, cargo, engines and crew may live in different linked definitions. Do not assume a universal speed or capacity field. Read macros and components, XML diffs and downloadable examples.