Automatic Underground Pipe Connectors

by sparr

Automatically place a pipe when two undergrounds are placed at a corner or one space apart.

Utilities
5 months ago
1.0 - 1.1
8.23K

b Crash with Schall Pipe Scaling

3 years ago
(updated 3 years ago)

1: Using + sized underground pipes with https://mods.factorio.com/mod/SchallPipeScaling causes a crash-to-main menu with the following error

1775.324 Error MainLoop.cpp:1207: Exception at tick 19273288: The mod Automatic Underground Pipe Connectors (1.0.2) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event automatic-underground-pipe-connectors::on_built_entity (ID 6)
automatic-underground-pipe-connectors/control.lua:46: attempt to index local 'pipe_lookup' (a nil value)
stack traceback:
automatic-underground-pipe-connectors/control.lua:46: in function <automatic-underground-pipe-connectors/control.lua:35>

2: In addition, and unrelated to that, if there's already an underground pipe in the location Automatic Underground Pipe Connectors creates a pipe to close a 1-length gap, then both will be present in the space. The underground end point will be underneath the new pipe.

Thanks for the smart mod. This is one of those functions that should have been in the base game. Brilliant!

3 years ago

add this line before line 45:
if pipe_lookup == nil or pipe_lookup[2] == nil then return end

so it will be right before this line:
local pipe_entity_definition = {

this will make the script escape the function before it crashes. I've tested it with mod Fluid must flow that makes this crash as well.

3 years ago

Both problems should be fixed. I also added a TODO for myself to some day support both the weird recipes and the weird pipe sizes in that mod.

New response