Skip to content

Build

A Build is a build task entity — an active construction, upgrade, recycling, or restocking order on a Build module’s buildprocessor. Each build has a target macro, a customer faction, and a state (waiting / processing / complete / cancelled).

Inheritance: None — build is its own root datatype.

PropertyTypeDescription
.existsboolBuild exists
.iscancelledboolHas been cancelled
.isprocessingboolCurrently being processed
.mayrequireconstructionvesselboolMay need a construction vessel
PropertyTypeDescription
.isshipbuildboolBuilding a ship from scratch
.isrecycleshipbuildboolRecycling a ship
.isexpansionboolExpanding an existing station
.isupgradeboolUpgrading an existing ship
.issoftwareonlyupgradeboolOnly updating software
.isrestockboolRestocking (refilling consumables)
.isshipmodificationboolRestock OR upgrade

These flags are mutually informative — vanilla code typically branches on the most-specific applicable flag.

PropertyTypeDescription
.objectcontainerThe station/dock processing the build
.buildmodulebuildmoduleThe module
.buildprocessorbuildprocessorThe specific processor
.buildobjectcontainerWhat’s being built (whichever of base / construction is valid)
.basecontainerPre-existing target (for upgrades / restocks)
.constructioncontainerNewly-created target (for from-scratch builds)
.factionfactionFaction the build is for
.macromacroWhat’s being built

.base and .construction are mutually exclusive — one is null. Use .buildobject to get whichever is valid.

PropertyTypeDescription
.timetimeWhen created (game time)
.agetimeHow long ago created
PropertyTypeDescription
.loadoutstringLoadout id (null if custom or omitted)
.loadoutfactionfactionFaction for loadout retrieval
PropertyTypeDescription
.consumablestableMap of consumable macro → amount
.pricemoneyPrice when build was added
.transferredamountmoneyMoney already moved (+ from buyer, - refunded)
PropertyTypeDescription
.constructionsequenceconstructionsequenceThe sequence backing this build
PropertyTypeDescription
.zonezoneWhere the build lives
.positionpositionPosition in zone
.rotationrotationOrientation in zone
<do_if value="$build.isshipbuild">
<!-- new ship from a shipyard / wharf -->
</do_if>
<do_elseif value="$build.isexpansion">
<!-- adding modules to a station -->
</do_elseif>
<do_elseif value="$build.isupgrade">
<!-- refitting an existing ship -->
</do_elseif>
<do_elseif value="$build.isrecycleshipbuild">
<!-- breaking down a ship for resources -->
</do_elseif>

"Find what’s being built — base or construction”

Section titled “"Find what’s being built — base or construction””
<set_value name="$Target"
exact="if @$build.construction
then $build.construction
else $build.base"/>

Or simply:

<set_value name="$Target" exact="$build.buildobject"/>

The accessor .buildobject already abstracts this.

<find_station_by_true_owner name="$Stations"
space="player.galaxy"
faction="faction.player"
multiple="true"/>
<set_value name="$ActiveBuilds" exact="0"/>
<do_for_each name="$s" in="$Stations">
<do_for_each name="$build" in="$s.builds.inprogress">
<set_value name="$ActiveBuilds"
operation="add" exact="1"/>
</do_for_each>
</do_for_each>
<write_to_logbook
text="$ActiveBuilds + ' active player builds'"/>

The .builds.inprogress accessor is on Container.

  • .base and .construction are mutually exclusive. One is null. Use .buildobject to get whichever is valid.
  • .isshipmodification is OR over .isupgrade + .isrestock. Don’t double-count.
  • .consumables is a table, not a wareamountlist. Iterate via table accessors, not .list.
  • .transferredamount is signed. Positive = paid by player, negative = refunded. Mod code that tracks “what’s spent” should use absolute values.
  • .macro is what’s being built, not the build’s own macro. Build is not a physical object — it has no macro of its own.
  • .zone is where the build will physically appear. For shipyard builds, that’s the shipyard’s zone. For expansions, the host station’s zone.