Skip to content

Loadout

A Loadout is a ship-equipment template — the named bundle of weapons, shields, engines, and software a ship receives when built or refit. Most modder interaction is via the loadout’s string id, not the runtime datatype.

Inheritance: None — loadout is its own root datatype. The datatype is minimal — only one accessor.

PropertyTypeDescription
.wareswarelistAll equipment wares in the loadout

That’s it. The runtime loadout datatype exposes the ware list; everything else lives in libraries/loadouts.xml.

Loadouts are referenced by string id through various contexts:

  • [Build](/game/behavior/build/) task: .loadout returns the loadout id string
  • [Construction sequence](/game/behavior/construction-sequence/) entry: .loadout returns a loadout datatype value
  • Ship macro: backend ID for default loadout
  • <generate_loadout level=> action: produces a loadout for a ship

The fuller loadout system uses level / quality / variation accessors on the parent Defensible:

Defensible propertyDescription
.loadoutlevel0..1 — overall “tier” of the loadout used
.minloadoutlevelFloor (from job definition)
.loadoutvariationVariation range used
.loadoutquantity.level / .variationQuantity overrides
.loadoutquality.level / .variationQuality overrides
.moduleloadoutlevel / .moduleloadoutquantity.X / .moduleloadoutquality.XStation-module loadout settings
.loadoutThe current loadout (this datatype)
<do_if value="@$build.loadout">
<do_for_each name="$ware"
in="$build.loadout.wares">
<write_to_logbook
text="'Equip: ' + $ware.name"/>
</do_for_each>
</do_if>
<generate_loadout
object="$ship"
level="1"
faction="faction.argon"/>
<apply_loadout object="$ship"/>

Pattern from vanilla ship-generation flows. See Ship → Actions → Create for the full context.

”Compute loadout-level differences across player ships”

Section titled “”Compute loadout-level differences across player ships””
<set_value name="$Total" exact="0"/>
<set_value name="$Count" exact="0"/>
<do_for_each name="$ship" in="$PlayerShips">
<do_if value="@$ship.loadoutlevel">
<set_value name="$Total"
operation="add"
exact="$ship.loadoutlevel"/>
<set_value name="$Count"
operation="add" exact="1"/>
</do_if>
</do_for_each>
<do_if value="$Count gt 0">
<write_to_logbook
text="'Avg loadout level: '
+ ($Total / $Count)"/>
</do_if>
  • The loadout datatype is minimal — .wares is its only accessor. All the level / variation / quality state lives on Defensible, not on the loadout itself.
  • .loadout on Build returns a string id; on construction-plan-entry returns the datatype. Same name, different types depending on context. Use the property docstring to disambiguate.
  • .loadoutlevel is 0..1, not 0..100. Vanilla normalises to fraction. Multiply by 100 for display.
  • Loadouts are race-specific by macro. Argon loadouts don’t apply to Terran ships. Engine handles this during generate_loadout — modders rarely override.
  • .minloadoutlevel comes from job definitions. Job ships have a floor on how degraded their loadout can be. Player ships are unaffected.