Factorio.com|Forums|Wiki|Mod Portal|API Docs Prototype|Runtime|Auxiliary

# Factorio Prototype Docs Version 2.0.7

## 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

- default
- sorted

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

pipe_connections | :: array[PipeConnectionDefinition] | Connection points to connect to other fluidboxes. [...]
Connection points to connect to other fluidboxes. [...]
volume | :: FluidAmount | Must be greater than 0.
Must be greater than 0.
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.
draw_only_when_connected optional | :: bool |
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. [...]
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. [...]
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.
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. [...]
maximum_temperature optional | :: float | The maximum temperature allowed into the fluidbox. [...]
The maximum temperature allowed into the fluidbox. [...]
minimum_temperature optional | :: float | The minimum temperature allowed into the fluidbox. [...]
The minimum temperature allowed into the fluidbox. [...]
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 |
production_type optional | :: ProductionType |
render_layer optional | :: RenderLayer |
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

### 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

### 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"
    }

Type used in

- BoilerPrototype::fluid_box
- BoilerPrototype::output_fluid_box
- CraftingMachinePrototype::fluid_boxes
- FluidEnergySource::fluid_box
- FluidTurretPrototype::fluid_box
- FusionGeneratorPrototype::input_fluid_box
- FusionGeneratorPrototype::output_fluid_box
- FusionReactorPrototype::input_fluid_box
- FusionReactorPrototype::output_fluid_box
- GeneratorPrototype::fluid_box
- MiningDrillPrototype::output_fluid_box
- MiningDrillPrototype::input_fluid_box
- OffshorePumpPrototype::fluid_box
- PipePrototype::fluid_box
- PipeToGroundPrototype::fluid_box
- PumpPrototype::fluid_box
- StorageTankPrototype::fluid_box
- ThrusterPrototype::fuel_fluid_box
- ThrusterPrototype::oxidizer_fluid_box