Factorissimo 3


Factorissimo adds factory buildings to Factorio. Place them down, walk in, build your factories inside! Now updated for space age!

Content
9 days ago
1.1 - 2.0
92.7K
Logistics

b [fixed] Can Disconnect Power, Can't Reconnect Without Replacing

2 years ago

"Bug"/Unexpected interaction: I shift-clicked the substation in the factory building which did the default action for power poles in Factorio, which is to disconnect it from every other power pole.
Since there are no visible wires inside the factory building or connecting to it on the outside, and I wasn't sure if there was a hotkey to reconnect the factory power, I worried I permanently killed the power in that building.
Picking up and putting the building back down fixed it, as well as replacing the power pole touching the building.

Seems like a slightly confusing result of intended game mechanics as there is no visible connection for the factory building substation.

Request: Make the substation in the factory building unable to be shift-clicked or disqualify it from disconnecting power connections, if possible.

2 years ago

Thanks for the report.

I don't think there is any solution to this issue.
It's impossible to block the SHIFT-click action on the substation entity.

2 years ago

Update:
I was able to find a solution for this.

The bug is now fixed in 1.1.23

2 years ago

What was the solution?

2 years ago
-- prevent SHIFT+CLICK on factory power poles
script.on_event({defines.events.on_selected_entity_changed, defines.events.on_player_cursor_stack_changed}, function(event)
    local player = game.get_player(event.player_index)
    local pole = player.selected
    if pole and pole.type == 'electric-pole' then
        local permission = player.permission_group
        if not permission then
            permission = game.permissions.create_group()
            player.permission_group = permission
        end

        local has_cross_surface_connections = false
        for _, neighbour in pairs(pole.neighbours.copper) do
            if neighbour.surface ~= pole.surface then
                has_cross_surface_connections = true
                break
            end
        end
        permission.set_allows_action(defines.input_action.remove_cables, not has_cross_surface_connections)
    end
end)
2 years ago

Credit to honktown

1 year, 9 months ago

Sorry for necroing old threads, is there any way to force factories to break / recheck the connections related to nested factories? While chasing down the weird bridging power networks including bridging across SE surfaces I got so far as managing to seperate certain factories from the larger network / bridging networks by demolishing all external power poles but they remain connected to a sub network of themselves according the to debug mode network size counters.