Connection Box


Connection Box for red and green wires connection

Content
3 years ago
0.16 - 1.1
723
Circuit network

g Suggestion: Prevent auto connect of all copper wires.

3 years ago

Would it be difficult to add an option to iterate on all poles in the game to prevent the auto-placement of the copper wires?
I really like this feature. (I might not want this on robot placement though.)

And thanks again for your mods. I have learned a lot on how to mod my own games by looking at your mods.

3 years ago

Zou can fork this mod and delete the entity name checking. You don't need this lines:

control.lua:
https://imgur.com/kiqXzEm

3 years ago
(updated 3 years ago)

Thank you. I don't know why I didn't think of that.
This is what I ended up changing in control.lua:

-- (added implicit support for Bio_Industries)
local function do_stuff(event)
local entity = event.created_entity
if entity and
( entity.name == 'connection-box' or
entity.name == 'small-electric-pole' or
entity.name == 'medium-electric-pole' or
entity.name == 'big-electric-pole' or
entity.name == 'bi-large-substation' or
entity.name == 'bi-wooden-pole-big' or
entity.name == 'bi-wooden-pole-huge' or
entity.name == 'substation'
)
then
if entity.neighbours then
entity.disconnect_neighbour() -- copper only
end
end
end
script.on_event(defines.events.on_built_entity, function(event) do_stuff(event) end)
script.on_event(defines.events.on_robot_built_entity, function(event) do_stuff(event) end)

2 years ago

Yes. Thanks for the link to the other thread.
I doubt I would fork your mod. I currently have no plans to publish any of my mods.
This may be closed if you want. And thanks for your time.

New response