Factorissimo 2 - notnotmelon fork 🍴


A fork of Factorissimo 2 focused on improving performance by implementing several 1.1 features. Can improve performance by 10X or higher. Also fixes several bugs from the original version.

Content
1 year, 3 months ago
1.1
53.9K
Logistics

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

1 year, 7 months 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.

1 year, 5 months 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.

1 year, 5 months ago

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

The bug is now fixed in 1.1.23

1 year, 5 months ago

What was the solution?

1 year, 5 months 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)
1 year, 5 months ago

Credit to honktown

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.

New response