How are pipe connections connected?
Posted: Wed Mar 22, 2017 2:19 am
The pipe_connections property of an entity prototype's fluid_boxes specifies the positions where entities can connect together to transfer fluids.
So far, I understand the position to mean "relative to the center of the entity, where would you place the center of a pipe to connect to this fluid-box". However, I'm not sure how the game determines how 2 non-pipe entities are connected.
For instance, the chemical-plant is a 3x3 element (1.5 from center to edge). Its [abridged] fluid boxes are:
So if 1 chemical-plan is placed at {0, 0}* and another is placed directly below it at {0, 3}, then the outputs of the top one are connected to the inputs of the bottom one. However, the top ones output pipe_connections are at {-1, 2} and {1, 2}, but the bottom ones input pipe_connections are at {-1, 1} and {1, 1}. The game recognizes that these are connected, but their pipe_connections do not occupy the same space.
So how do we tell if 2 pipe_connections will be connected?
* I know the center would be on a .5, but it makes the example easier if not everything has .5.
So far, I understand the position to mean "relative to the center of the entity, where would you place the center of a pipe to connect to this fluid-box". However, I'm not sure how the game determines how 2 non-pipe entities are connected.
For instance, the chemical-plant is a 3x3 element (1.5 from center to edge). Its [abridged] fluid boxes are:
Code: Select all
fluid_boxes =
{
{
production_type = "input",
pipe_connections = {{ type="input", position = {-1, -2} }}
},
{
production_type = "input",
pipe_connections = {{ type="input", position = {1, -2} }}
},
{
production_type = "output",
pipe_connections = {{ position = {-1, 2} }}
},
{
production_type = "output",
pipe_connections = {{ position = {1, 2} }}
}
}
So how do we tell if 2 pipe_connections will be connected?
* I know the center would be on a .5, but it makes the example easier if not everything has .5.