Factorio Prototype DocsVersion 2.0.26

FluidBox :: struct Example code

Used to set the fluid amount an entity can hold, as well as the connection points for pipes leading into and out of the entity.

Entities can have multiple fluidboxes. These can be part of a FluidEnergySource, or be specified directly in the entity prototype.

A fluidbox can store only one type of fluid at a time. However, a fluid system (ie. multiple connected fluid boxes) can contain multiple different fluids, see Fluid mixing.

Properties

volume :: FluidAmount

Must be greater than 0.

Must be greater than 0.

pipe_connections :: array[PipeConnectionDefinition]

Connection points to connect to other fluidboxes. [...]

Connection points to connect to other fluidboxes. [...]

filter optional :: FluidID

Can be used to specify which fluid is allowed to enter this fluid box. [...]

Can be used to specify which fluid is allowed to enter this fluid box. [...]

render_layer optional :: RenderLayer
draw_only_when_connected optional :: bool
hide_connection_info optional :: bool

Hides the blue input/output arrows and icons at each connection point.

Hides the blue input/output arrows and icons at each connection point.

pipe_covers optional :: Sprite4Way

The pictures to show when another fluid box connects to this one.

The pictures to show when another fluid box connects to this one.

pipe_covers_frozen optional :: Sprite4Way
pipe_picture optional :: Sprite4Way
pipe_picture_frozen optional :: Sprite4Way
mirrored_pipe_picture optional :: Sprite4Way

Pipe picture variation used when owner machine is flipped. [...]

Pipe picture variation used when owner machine is flipped. [...]

mirrored_pipe_picture_frozen optional :: Sprite4Way

Frozen pipe picture variation used when owner machine is flipped. [...]

Frozen pipe picture variation used when owner machine is flipped. [...]

minimum_temperature optional :: float

The minimum temperature allowed into the fluidbox. [...]

The minimum temperature allowed into the fluidbox. [...]

maximum_temperature optional :: float

The maximum temperature allowed into the fluidbox. [...]

The maximum temperature allowed into the fluidbox. [...]

max_pipeline_extent optional :: uint32

The max extent that a pipeline with this fluidbox can span. [...]

The max extent that a pipeline with this fluidbox can span. [...]

production_type optional :: ProductionType
secondary_draw_order optional :: int8

Set the secondary draw order for all orientations. [...]

Set the secondary draw order for all orientations. [...]

secondary_draw_orders optional :: FluidBoxSecondaryDrawOrders

Set the secondary draw order for each orientation. [...]

Set the secondary draw order for each orientation. [...]

always_draw_covers optional :: bool

Defaults to true if pipe_picture is not defined, otherwise defaults to false.

Defaults to true if pipe_picture is not defined, otherwise defaults to false.

enable_working_visualisations optional :: array[string]

Array of the WorkingVisualisation::name of working visualisations to enable when this fluidbox is present. [...]

Array of the WorkingVisualisation::name of working visualisations to enable when this fluidbox is present. [...]

Properties

volume :: FluidAmount

Must be greater than 0.

pipe_connections :: array[PipeConnectionDefinition]

Connection points to connect to other fluidboxes. This is also marked as blue arrows in alt mode. Fluid may flow in or out depending on the type field of each connection.

Connection points may depend on the direction the entity is facing. These connection points cannot share positions with one another or the connection points of another fluid box belonging to the same entity.

Can't have more than 255 connections.

filter :: FluidID optional

Can be used to specify which fluid is allowed to enter this fluid box. See here.

render_layer :: RenderLayer optional

Default: "object"

draw_only_when_connected :: bool optional

Default: false

hide_connection_info :: bool optional

Default: false

Hides the blue input/output arrows and icons at each connection point.

pipe_covers :: Sprite4Way optional

The pictures to show when another fluid box connects to this one.

pipe_covers_frozen :: Sprite4Way optional

pipe_picture :: Sprite4Way optional

pipe_picture_frozen :: Sprite4Way optional

mirrored_pipe_picture :: Sprite4Way optional

Pipe picture variation used when owner machine is flipped. If no picture is loaded, pipe_picture is used instead.

mirrored_pipe_picture_frozen :: Sprite4Way optional

Frozen pipe picture variation used when owner machine is flipped. If no picture is loaded, pipe_picture_frozen is used instead.

minimum_temperature :: float optional

The minimum temperature allowed into the fluidbox. Only applied if a filter is specified.

Example

minimum_temperature = 100.0

maximum_temperature :: float optional

The maximum temperature allowed into the fluidbox. Only applied if a filter is specified.

Example

maximum_temperature = 1000.0

max_pipeline_extent :: uint32 optional

Default: Value of UtilityConstants::default_pipeline_extent

The max extent that a pipeline with this fluidbox can span. A given pipeline's extent is calculated as the min extent of all the fluidboxes that comprise it.

production_type :: ProductionType optional

Default: "none"

ProductionType :: union

Specifies how the entity will utilize this fluidbox. input-output should only be used for boilers in fluid heating mode.

Union members

"none"
"input"
"input-output"
"output"

secondary_draw_order :: int8 optional

Default: 1

Set the secondary draw order for all orientations. Used to determine render order for sprites with the same render_layer in the same position. Sprites with a higher secondary_draw_order are drawn on top.

secondary_draw_orders :: FluidBoxSecondaryDrawOrders optional

Set the secondary draw order for each orientation. Used to determine render order for sprites with the same render_layer in the same position. Sprites with a higher secondary_draw_order are drawn on top.

The individual directions default to the value of secondary_draw_order.

FluidBoxSecondaryDrawOrders :: struct

Properties

north :: int8 optional

east :: int8 optional

south :: int8 optional

west :: int8 optional

always_draw_covers :: bool optional

Defaults to true if pipe_picture is not defined, otherwise defaults to false.

enable_working_visualisations :: array[string] optional

Array of the WorkingVisualisation::name of working visualisations to enable when this fluidbox is present.

If draw_only_when_connected is true, then the working visualisation are only enabled when this is connected.

Example

fluid_box =
{
  volume = 200,
  pipe_covers = pipecoverspictures(),
  pipe_connections =
  {
    {flow_direction = "input-output", direction = defines.direction.west, position = {-1, 0.5}},
    {flow_direction = "input-output", direction = defines.direction.east, position = {1, 0.5}}
  },
  production_type = "input-output",
  filter = "water"
}

Prototypes

Types

Defines