Skip to content

Resources and fluid IDs ​

The types on this page are in StellarWorks.Resources. Use ResourceComponentIds with PartBuilder.AddComponent and pass a ComponentConfiguration. A component claiming a cable port needs a matching socket name and kind. A socket can belong to one resource participant.

Built-in components ​

ComponentConfiguration keys
PowerProducersocket, maximumOutputWatts. Starts with its output limit at the configured maximum.
PowerConsumersocket, requestedWatts, optional minimumOperatingWatts (defaults to the initial request).
PowerStoragesocket, capacityJoules, maximumChargeWatts, maximumDischargeWatts.
FluidStoragesocket, capacity. The part needs exactly one fluid socket.
FluidProducer, FluidConsumersocket, fluid as a full ID string, ratePerSecond.
FluidPumpinput and output socket names, ratePerSecond, optional requiresPower (defaults to true).
SignalInput, SignalOutputsocket. Output accepts optional value (defaults to zero).
SignalGatetarget component ID string and optional minimumValue (defaults to 0.5). Needs a signal input and its target on the same part.
ThrustOutputmaximumNewtons. Record thrust during fluid settlement through ResourceStep.SetThrust.

Switchable participants default to enabled = true. Control these components on authority. PartResources.GetPort resolves a valid port by socket name or kind and slot. Use IResourcePort.Network to inspect the current connection and the corresponding power, fluid, or signal reading. Component properties such as PowerConsumer.DeliveredWatts and FluidTransferComponent.ActualRatePerSecond report the last allocation.

Solver steps ​

mod.Events.Resources.BeforePower and BeforeFluidBalance supply a ResourceStep while the native step is in progress. Access is synchronous and authority-side. Number identifies the step and Seconds gives its duration.

  • IsSimulated(part) tests whether a part participates in the current step. Available(port, fluid) and Room(port, fluid) read current native fluid capacity.
  • Allocate(recipes) returns a fraction per recipe calculated against shared snapshot capacity. Recheck with TryTransfer when applying each scaled recipe.
  • TryTransfer(legs, debit) checks all FluidLeg inputs and outputs before staging a transfer. An optional InventoryDebit comes from an authoritative part's native chest. Its ports must belong to that part.
  • SetThrust(output, newtons) applies only to a simulated part during fluid settlement.

ConnectionChanged, PowerSupplyChanged, SignalValueChanged, and FluidTransferChanged report resource changes. Resource guide

Built-in gases ​

StellarWorks 1.0.0 registers these shared gases. Use the BuiltInFluidIds constants or the stable keys. The current world assigns each its numeric item ID.

BuiltInFluidIds memberStable key
Heliumstellarworks:helium
Nitrogenstellarworks:nitrogen
Neonstellarworks:neon
Chlorinestellarworks:chlorine
Argonstellarworks:argon
Kryptonstellarworks:krypton
Xenonstellarworks:xenon
Radonstellarworks:radon

NativeFluidIds.Oxygen and NativeFluidIds.Ethanol alias the stock item IDs 108 and 111. Other stock fluids can be addressed with Item.FromID or named Item.Native constants. Stock item IDs

StellarWorks documentation · Mods for StellarDrive