A Container is the X4 engine abstract class for entities that hold cargo, build other entities, and trade . Almost every station in the game is a container — it inherits container’s massive property set for managing cargo, build infrastructure, products/resources, and prices.
Inheritance: object → controllable → defensible → container. Subclasses include all station types and some special ship variants.
The container class has ~110 properties . Below is the most-used subset grouped by purpose.
Property Type Description .hasmasstrafficboolean Container is in the zone’s mass-traffic network .istrafficlevel.<level>boolean Container at traffic level (normal/heavy/gridlock) .dockingenabledboolean Is docking at the container enabled? .dockingallowed.{$ship}boolean Can $ship dock at container (faction/relation check)?
Property Type Description .hasunitdrone.{$ship}boolean Container has $ship as drone unit
The build property group manages station construction + ship manufacturing.
Property Type Description .buildingmodulebuildmodule Build module constructing this container .buildingprocessorbuildprocessor Build processor doing the work .buildbuild Build task constructing this object .builds.queuedlist Queued build tasks .builds.inprogresslist Build tasks in progress .builds.todeletelist Build tasks queued for deletion .buildanchorcomponent Build anchor (reference point) .canabortbuild.{$build}boolean Can $build currently be aborted? .hasplannedconstructionboolean Are there plans to expand this container? .plannedconstruction.sequenceconstructionsequence Planned construction sequence .plannedconstruction.boundingbox.*vector / boolean Planned construction’s bounding box
Property Type Description .buildequipment.wareswarelist All equipment wares container can build (default + included - excluded) .buildequipment.absolutewarelist Absolute equipment list (overrides default) .buildequipment.excludedwarelist Equipment excluded from default .buildequipment.includedwarelist Equipment included beyond default .buildequipment.<type>warelist Equipment of specific type .buildships.wareswarelist All ship wares container can build .buildships.absolutewarelist Absolute ship list .buildships.excludedwarelist Ships excluded from default .buildships.includedwarelist Ships included beyond default .canbuildclass.{$class}boolean Has build module for class? .canequipclass.{$class}boolean Has build module for equipping class? .cansupplyclass.{$class}boolean Has build module for supplying class? .canbuildequipment.{$ware}boolean Can build specified equipment? .canbuildmacro.{$macro}boolean Can build specified macro? .canbuildshipsboolean Can build ships (= isshipyard or iswharf) .canequipshipsboolean Can equip ships (= isequipmentdock) .cansupplyshipsboolean Can supply ships (= issupplyship)
Property Type Description .buildresources.{$build}wareamountlist Total resources for $build (or remaining if in-progress) .buildresources.{$ship}wareamountlist Total resources for $ship .neededbuildresources.{$build}wareamountlist Missing resources for $build .neededbuildresources.{$ship}wareamountlist Missing resources for $ship .missingloadoutequipment.{$loadout}.{$faction}warelist Loadout equipment $faction prevents this container from constructing
Property Type Description .cargocontainercargolist Current cargo .cargo.{$ware}.targetinteger Target amount for traded commodity .productswarelist All produced wares .products.{$ware}.intermediateboolean $ware is intermediate .originalproductware Container’s original product .resourceswarelist All consumed/produced resource wares .resources.purewarelist Non-intermediate resources .resources.intermediatewarelist Intermediate resources .resources.primarywarelist Primary resources .resources.secondarywarelist Secondary resources .resources.{$ware}.primary / .secondary / .intermediateboolean Resource categorization .supplyresourceswarelist Resources for supplying units + ammo (NOT production) .tradewareswarelist Bought/sold wares (neither product nor resource) .researchwarelist Research wares currently being worked on
Property Type Description .buypricestable Current buy prices for all relevant wares .sellpricestable Current sell prices for all relevant wares .buildbuypricestable Buy prices accounting for build price factor
< set_value name = " $cargolist " exact = " $station.cargo.list " />
< do_for_each name = " $ware " in = " $cargolist " >
< write_to_logbook text = " $ware.{1}.name + ': ' + $ware.{2} " />
< do_if value = " $shipyard.canbuildmacro.{macro.ship_arg_l_destroyer_02_a_macro} " >
< create_ship macro = " macro.ship_arg_l_destroyer_02_a_macro " ... />
< do_for_each name = " $want " in = " $shipyard.neededbuildresources.{$build} " >
< write_to_logbook text = " $want.{1}.name + ' needs ' + $want.{2} " />
< set_value name = " $price " exact = " $station.buyprices.{ware.advancedcomposites} " />
⚠ .cargo and .cargo.list look the same but are different types — .cargo is containercargolist, .cargo.list returns the list-of-tuples. Use .cargo.list for iteration.
⚠ .buildequipment.wares is the COMPUTED set (default + included - excluded). Don’t try to back-compute it; use specific category property if you need transparency.
⚠ .products includes intermediates unless you filter via .products.{$ware}.intermediate. Check before trading.
⚠ Build prices differ from buy prices — use .buildbuyprices when calculating construction costs, not .buyprices.
⚠ .canbuildships is a shortcut for “isshipyard OR iswharf”. Don’t double-check both.
⚠ .cargo.{$ware}.target is the target, not the current — current amount is in .cargo.list.
└── container ← this class
├── station (most stations)
├── headquarters (player HQ — a special container)
├── tradestation (trade station variant)
└── various station subtypes
Action Purpose <add_inventory>Add a ware to container cargo <remove_inventory>Remove a ware from cargo <set_equipment_wares_absolute>Set absolute equipment-build list <set_equipment_wares_excluded>Add to excluded list <set_equipment_wares_included>Add to included list <set_ship_wares_absolute>Set absolute ship-build list <add_build_to_expand_station>Add a build to expand the station <set_cargo_target>Set target for cargo trade
Container is the largest property class in the X4 engine. Stations are containers, build infrastructure is on containers, prices live on containers. When in doubt about a station’s behavior, container’s property list is the first stop.