Skip to content

Construction sequence

A Construction sequence is the ordered list of station modules to build. Every multi-module station construction is driven by a sequence — created via <create_construction_sequence>, applied via <apply_construction_sequence>, and tracked by the Build module during execution.

X4 9.0+ supports staged sequences — the player can break a long construction into stages, building the first set of modules then continuing later. This is the source of the .hasstagedconstruction flag on Station.

Inheritance: None — constructionsequence is its own root datatype.

PropertyTypeDescription
.countintNumber of entries in the sequence
.isfixedboolFlagged as fixed, cannot be adjusted
.hasstagesboolSequence has stages defined
PropertyTypeDescription
.{numeric}constructionplanentrydataThe N-th entry (1-based)
.{constructionplanentryid}constructionplanentrydataEntry by its plan id

The entry data type is constructionplanentrydata — a pseudo-type with .id / .macro / .loadout / .stage / .exists.

PropertyTypeDescription
.finalsequenceconstructionsequenceCopy of the full staged sequence (null if not staged)
.stage.countintNumber of stages
.stage.currentintCurrent stage being constructed to
.stage.{numeric}.firstintIndex of first module in the stage
.stage.{numeric}.lastintIndex of last module
.stage.{numeric}.sequenceconstructionsequenceCopy with current stage set to N

Each entry exposes:

PropertyTypeDescription
.existsboolEntry exists
.idconstructionplanentryidEntry id
.macromacroModule macro
.loadoutloadoutUpgrade loadout
.stageintStage number this entry belongs to
<set_value name="$i" exact="1"/>
<do_while value="$i le $Sequence.count">
<set_value name="$entry" exact="$Sequence.{$i}"/>
<write_to_logbook
text="$i + ': ' + $entry.macro.knownname"/>
<set_value name="$i" operation="add" exact="1"/>
</do_while>
<do_if value="not $Station.hasstagedconstruction">
<apply_construction_sequence
station="$Station"
sequence="$Sequence"/>
</do_if>
<do_else>
<add_build_to_expand_station
object="$Station.buildstorage"
buildobject="$Station"
constructionplan="$Sequence"
result="$BuildID"/>
</do_else>

See Build module → Actions for the canonical X4 9.0+ build-append pattern.

<do_if value="$Sequence.hasstages">
<write_to_logbook
text="'Stage ' + $Sequence.stage.current
+ ' of ' + $Sequence.stage.count"/>
</do_if>
  • .{numeric} indexing is 1-based. First entry is $Sequence.{1}, not $Sequence.{0}.
  • .isfixed blocks editing. A fixed sequence cannot be appended to or modified at runtime. Check before trying to extend.
  • .hasstages=false means single-stage build. All entries belong to “stage 1” (implicitly). Stage accessors still work but are less useful.
  • .stage.current only meaningful when sequence is being used in a build task. For abstract sequences (created but not yet applied), it’s undefined.
  • Two sequences with the same entries can have different stages. Stage assignment is separate from entry composition. Sequences are not value-equal.
  • <create_construction_sequence> errors on stations with .hasstagedconstruction=true in X4 9.0. Use <add_build_to_expand_station> instead. See Build module → Stage-aware build appending.
  • Build module — runs sequences during construction.
  • Build.constructionsequence accessor.
  • Station.plannedconstruction.sequence and .hasstagedconstruction.
  • Loadout — entry-level loadout reference.