Electric Grid

by 0n0w1c

An overhaul of the electric network, engineer an Electric Grid! The overhaul is optional.

Overhaul
17 days ago
2.0
1.85K
Power

g (Resolved) connect to power poles

8 months ago
(updated 8 months ago)

can you let the power poles automatically connect to the power poles of the transformer?
you'd just need to set auto_connect_up_to_n_wires to >0, decrease max wire distance and on built disconnect the poles of the transformer from poles with the name of the input pole and vice versa

legacy code (doesn't work anymore, but you get the idea. new method is via get_wire_connector i guess)
local target_pole = create{name = "trafo-connection".."_tar_"..entity.direction%8, position = tarconpos, force = entity.force}
local source_pole = create{name = "trafo-connection".."_src_"..entity.direction%8, position = srcconpos, force = entity.force}
for key, neighbour in pairs(target_pole.neighbours.copper) do
.... if string.sub(neighbour.name,1,20) == "trafo-connection_src" then
........ target_pole.disconnect_neighbour(neighbour)
.... end
end
for key, neighbour in pairs(source_pole.neighbours.copper) do
.... if string.sub(neighbour.name,1,20) == "trafo-connection_tar" then
........ source_pole.disconnect_neighbour(neighbour)
.... end
end

8 months ago

I appreciate the tips, but I am holding off on making any more wiring changes, pending some bug reports.
I just increased the wire length so people with Quality active can use transformators.

7 months ago

fine, i updated my own transformer mod
https://mods.factorio.com/mod/Transformers

7 months ago

Glad you found a solution that works for you, I will mark this as Resolved.

New response