Factorio.com|Forums|Wiki|Mod Portal|API Docs

# Factorio Prototype Docs Version 2.0.77

# PipeConnectionDefinition - Prototype Docs

## PipeConnectionDefinition :: struct

## Properties

- default
- sorted

flow_direction optional | :: FluidFlowDirection | Allowed direction of fluid flow at this connection. [...]
Allowed direction of fluid flow at this connection. [...]
connection_type optional | :: PipeConnectionType | Selects set of rules to follow when looking for other FluidBox this connection should connect to.
Selects set of rules to follow when looking for other FluidBox this connection should connect to.
enable_working_visualisations optional | :: array[string] | Array of the WorkingVisualisation::name of working visualisations to enable when this pipe connection is present. [...]
Array of the WorkingVisualisation::name of working visualisations to enable when this pipe connection is present. [...]
direction optional | :: defines.direction | Primary direction this connection points to when entity direction is north and the entity is not mirrored. [...]
Primary direction this connection points to when entity direction is north and the entity is not mirrored. [...]
position optional | :: MapPosition | Position relative to entity's center where pipes can connect to this fluidbox regardless the directions of entity. [...]
Position relative to entity's center where pipes can connect to this fluidbox regardless the directions of entity. [...]
positions optional | :: {MapPosition, MapPosition, MapPosition, MapPosition} | The 4 separate positions corresponding to the 4 main directions of entity. [...]
The 4 separate positions corresponding to the 4 main directions of entity. [...]
connection_category optional | :: string or array[string] | Fluidboxes' pipe connections are only allowed to connect with each other if they share a connection category. [...]
Fluidboxes' pipe connections are only allowed to connect with each other if they share a connection category. [...]
max_underground_distance optional | :: uint8 | Only loaded if `connection_type` is `"underground"`.
Only loaded if `connection_type` is `"underground"`.
max_distance_tint optional | :: Color | Only loaded if `connection_type` is `"underground"`.
Only loaded if `connection_type` is `"underground"`.
underground_collision_mask optional | :: CollisionMaskConnector | An underground connection may be defined as colliding with tiles in which case if any tile is placed between underground ends the connection will not be established. [...]
An underground connection may be defined as colliding with tiles in which case if any tile is placed between underground ends the connection will not be established. [...]
linked_connection_id optional | :: FluidBoxLinkedConnectionID | Expected to be unique inside of a single entity. [...]
Expected to be unique inside of a single entity. [...]

connection_category optional | :: string or array[string] | Fluidboxes' pipe connections are only allowed to connect with each other if they share a connection category. [...]
Fluidboxes' pipe connections are only allowed to connect with each other if they share a connection category. [...]
connection_type optional | :: PipeConnectionType | Selects set of rules to follow when looking for other FluidBox this connection should connect to.
Selects set of rules to follow when looking for other FluidBox this connection should connect to.
direction optional | :: defines.direction | Primary direction this connection points to when entity direction is north and the entity is not mirrored. [...]
Primary direction this connection points to when entity direction is north and the entity is not mirrored. [...]
enable_working_visualisations optional | :: array[string] | Array of the WorkingVisualisation::name of working visualisations to enable when this pipe connection is present. [...]
Array of the WorkingVisualisation::name of working visualisations to enable when this pipe connection is present. [...]
flow_direction optional | :: FluidFlowDirection | Allowed direction of fluid flow at this connection. [...]
Allowed direction of fluid flow at this connection. [...]
linked_connection_id optional | :: FluidBoxLinkedConnectionID | Expected to be unique inside of a single entity. [...]
Expected to be unique inside of a single entity. [...]
max_distance_tint optional | :: Color | Only loaded if `connection_type` is `"underground"`.
Only loaded if `connection_type` is `"underground"`.
max_underground_distance optional | :: uint8 | Only loaded if `connection_type` is `"underground"`.
Only loaded if `connection_type` is `"underground"`.
position optional | :: MapPosition | Position relative to entity's center where pipes can connect to this fluidbox regardless the directions of entity. [...]
Position relative to entity's center where pipes can connect to this fluidbox regardless the directions of entity. [...]
positions optional | :: {MapPosition, MapPosition, MapPosition, MapPosition} | The 4 separate positions corresponding to the 4 main directions of entity. [...]
The 4 separate positions corresponding to the 4 main directions of entity. [...]
underground_collision_mask optional | :: CollisionMaskConnector | An underground connection may be defined as colliding with tiles in which case if any tile is placed between underground ends the connection will not be established. [...]
An underground connection may be defined as colliding with tiles in which case if any tile is placed between underground ends the connection will not be established. [...]

## Properties

### flow_direction :: FluidFlowDirection optional

Default: `"input-output"`

Allowed direction of fluid flow at this connection. Pipeline entities (`pipe`, `pipe-to-ground`, and `storage-tank`) do not support this property.

### connection_type :: PipeConnectionType optional

Default: `"normal"`

Selects set of rules to follow when looking for other FluidBox this connection should connect to.

#### PipeConnectionType :: union

#### Union members

`"normal"` | 2 connections are required to be adjacent tiles next to each other on their respective directions.
`"underground"` | Allows distant connection up to a certain limit. Those connections may be blocked by tiles.
`"linked"` | For mods, connections between entities have to be explicitly requested by script.

### enable_working_visualisations :: array[string] optional

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

If the owning fluidbox has draw_only_when_connected set to `true`, then the working visualisation is only enabled if this pipe connection is connected.

### direction :: defines.direction optional

Primary direction this connection points to when entity direction is north and the entity is not mirrored. When entity is rotated or mirrored, effective direction will be computed based on this value.

Only loaded, and mandatory if `connection_type` is `"normal"` or `"underground"`.

### position :: MapPosition optional

Position relative to entity's center where pipes can connect to this fluidbox regardless the directions of entity.

Only loaded if `connection_type` is `"normal"` or `"underground"`.

### positions :: {MapPosition, MapPosition, MapPosition, MapPosition} optional

The 4 separate positions corresponding to the 4 main directions of entity. Positions must correspond to directions going one after another.

This is used for example by "pumpjack" where connections are consistently near bottom-left corner (2 directions) or near top-right corner (2 directions).

Only loaded, and mandatory if `position` is not defined and if `connection_type` is `"normal"` or `"underground"`.

### connection_category :: string or array[string] optional

Default: `"default"`

Fluidboxes' pipe connections are only allowed to connect with each other if they share a connection category. For example a mod could have a "steam pipes" and "cryogenic pipes" category that should not connect with each other.

In case of a normal connection, a pipe connection can be in multiple connection categories. This allows to create a mod where pipes of different categories would not connect to each other while still making it possible for crafting machines and other entities to connect to any of the specified pipes.

By default, all pipe connections have the `"default"` category. So a pipe that should connect to a new category and standard pipes can have the `connection_category = {"my-new-pipe", "default"}`.

May have at most one category when `connection_type` is `"underground"`.

Only loaded if `connection_type` is `"normal"` or `"underground"`.

### max_underground_distance :: uint8 optional

Default: `0`

Only loaded if `connection_type` is `"underground"`.

### max_distance_tint :: Color optional

Only loaded if `connection_type` is `"underground"`.

### underground_collision_mask :: CollisionMaskConnector optional

An underground connection may be defined as colliding with tiles in which case if any tile is placed between underground ends the connection will not be established.

In order to connect, both ends must have the same collision mask specified.

Only loaded if `connection_type` is `"underground"`.

### linked_connection_id :: FluidBoxLinkedConnectionID optional

Expected to be unique inside of a single entity. Used to uniquely identify where a linked connection should connect to.

Only loaded, and mandatory if `connection_type` is `"linked"`.

Type used in

- FluidBox::pipe_connections