Factorio Prototype DocsVersion 1.1.107

FluidBox :: struct Example code

Visual representation of base_area, base_level and height. When all the fluidboxes are connected, the water leaves fluidbox A and flows into the other 3 boxes through fluidbox B until the water level is equal in all boxes.Visual representation of base_area, base_level and height. When all the fluidboxes are connected, the water leaves fluidbox A and flows into the other 3 boxes through fluidbox B until the water level is equal in all boxes.

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

pipe_connections :: array[PipeConnectionDefinition]

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

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

base_area optional :: double

Must be greater than 0. [...]

Must be greater than 0. [...]

base_level optional :: float

Base level is the elevation of the invisible fluid box. [...]

Base level is the elevation of the invisible fluid box. [...]

height optional :: double

Must be greater than 0. [...]

Must be greater than 0. [...]

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
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_picture optional :: Sprite4Way
minimum_temperature optional :: double

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

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

maximum_temperature optional :: double

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

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

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. [...]

Properties

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.

base_area :: double optional

Default: 1

Must be greater than 0. The total fluid capacity of the fluid box is base_area × height × 100.

base_level :: float optional

Default: 0

Base level is the elevation of the invisible fluid box. 0 is ground level.

For example, if the base level is -1 and the height is 1, it puts the top of the fluid box at the bottom of a pipe connection with base_level 0 and height 1. This means fluid "falls" in to the fluid box, and can't get out.

For example, if the base level is 1, it puts the bottom of the fluid box at the top of a pipe connection with base_level 0 and height 1. This means fluid "falls" out of the fluid box, but fluids already outside can't get into it.

height :: double optional

Default: 1

Must be greater than 0. The total fluid capacity of the fluid box is base_area × height × 100.

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"

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_picture :: Sprite4Way optional

minimum_temperature :: double optional

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

Example

minimum_temperature = 100.0

maximum_temperature :: double optional

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

Example

maximum_temperature = 1000.0

production_type :: ProductionType optional

Default: "none"

ProductionType :: union

Union members

"None"
"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.

FluidBoxSecondaryDrawOrders :: struct

Properties

north :: int8 optional

Default: 1

east :: int8 optional

Default: 1

south :: int8 optional

Default: 1

west :: int8 optional

Default: 1

Example

fluid_box =
{
  base_area = 1,
  height = 2,
  base_level = -1,
  pipe_covers = pipecoverspictures(),
  pipe_connections =
  {
    {type = "input-output", position = {-2, 0.5}},
    {type = "input-output", position = {2, 0.5}}
  },
  production_type = "input-output"
}

Prototypes

Types