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.
Properties
Section titled “Properties”Identity and shape
Section titled “Identity and shape”| Property | Type | Description |
|---|---|---|
.count | int | Number of entries in the sequence |
.isfixed | bool | Flagged as fixed, cannot be adjusted |
.hasstages | bool | Sequence has stages defined |
Per-entry access
Section titled “Per-entry access”| Property | Type | Description |
|---|---|---|
.{numeric} | constructionplanentrydata | The N-th entry (1-based) |
.{constructionplanentryid} | constructionplanentrydata | Entry by its plan id |
The entry data type is constructionplanentrydata — a pseudo-type with .id / .macro / .loadout / .stage / .exists.
Stage system (X4 9.0+)
Section titled “Stage system (X4 9.0+)”| Property | Type | Description |
|---|---|---|
.finalsequence | constructionsequence | Copy of the full staged sequence (null if not staged) |
.stage.count | int | Number of stages |
.stage.current | int | Current stage being constructed to |
.stage.{numeric}.first | int | Index of first module in the stage |
.stage.{numeric}.last | int | Index of last module |
.stage.{numeric}.sequence | constructionsequence | Copy with current stage set to N |
constructionplanentrydata
Section titled “constructionplanentrydata”Each entry exposes:
| Property | Type | Description |
|---|---|---|
.exists | bool | Entry exists |
.id | constructionplanentryid | Entry id |
.macro | macro | Module macro |
.loadout | loadout | Upgrade loadout |
.stage | int | Stage number this entry belongs to |
Common patterns
Section titled “Common patterns””Read all modules in a sequence"
Section titled “”Read all modules in a sequence"”<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>"Stage-aware build (X4 9.0+)”
Section titled “"Stage-aware build (X4 9.0+)””<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.
”Check sequence stage progress”
Section titled “”Check sequence stage progress””<do_if value="$Sequence.hasstages"> <write_to_logbook text="'Stage ' + $Sequence.stage.current + ' of ' + $Sequence.stage.count"/></do_if>Common gotchas
Section titled “Common gotchas”- ⚠
.{numeric}indexing is 1-based. First entry is$Sequence.{1}, not$Sequence.{0}. - ⚠
.isfixedblocks editing. A fixed sequence cannot be appended to or modified at runtime. Check before trying to extend. - ⚠
.hasstages=falsemeans single-stage build. All entries belong to “stage 1” (implicitly). Stage accessors still work but are less useful. - ⚠
.stage.currentonly 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=truein X4 9.0. Use<add_build_to_expand_station>instead. See Build module → Stage-aware build appending.
Related
Section titled “Related”- Build module — runs sequences during construction.
- Build —
.constructionsequenceaccessor. - Station —
.plannedconstruction.sequenceand.hasstagedconstruction. - Loadout — entry-level loadout reference.