So, that's defined by the table in pipe_connections
in pipe.lua
. Each entry in that table is a pipe connection, with a normal entry that just has direction
and position
being an above-ground connection, and one that's underground needing connection_type
, max_underground_distance
, and connection_category
as well. For example, the first pipe in that group has the following connections defined:
{ direction = defines.direction.east, position = {0, 0} },
{ connection_type = "underground", direction = defines.direction.south, position = {0, 0}, max_underground_distance = dist, connection_category = get_categories()},
{ direction = defines.direction.west, position = {0, 0} },
The first and third connections, for the west and east directions, are above-ground. The second one, for the south direction, is underground. For your pipe, you'd need to define a second underground entry in that table, and make sure it has a different direction face than the other 3 entries. So you could use, for example, north and west as above-ground and south and east as underground, which would look something like:
{ direction = defines.direction.north, position = {0, 0} },
{ direction = defines.direction.west, position = {0, 0} },
{ connection_type = "underground", direction = defines.direction.south, position = {0, 0}, max_underground_distance = dist, connection_category = get_categories()},
{ connection_type = "underground", direction = defines.direction.east, position = {0, 0}, max_underground_distance = dist, connection_category = get_categories()},
Note that you need to make sure you line up those up to the way the pipe appears in the north PNG you create. So if your north png looks like the pipe in the above picture, then the above definitions would be accurate for it, since the above-ground connections are to the north and west for that facing.