Reconnect Cut Wires


Reconnects external wires when placing blueprints made from the cut tool. Integrated into vanilla 2.0!

Utilities
4 months ago
1.1
1.68K
Circuit network

b ✅ [0.0.2] Game froze when I tried to cut.

9 months ago

I just tried to cut an arithmetic combinator which was connected to chest with a wire on input and an inserter on output. When I did it the game froze immediately.

9 months ago

I can't seem to reproduce it.
Can you post your full mod list?

9 months ago

{
"mods":
[

{
  "name": "base",
  "enabled": true
},

{
  "name": "aai-loaders",
  "enabled": true
},

{
  "name": "aai-vehicles-ironclad",
  "enabled": true
},

{
  "name": "AllMinableUpdated",
  "enabled": false
},

{
  "name": "artillery-spidertron",
  "enabled": false
},

{
  "name": "ArtilleryCombinator",
  "enabled": false
},

{
  "name": "auto-research",
  "enabled": true
},

{
  "name": "autodrive",
  "enabled": false
},

{
  "name": "auto_manual_mode",
  "enabled": true
},

{
  "name": "BigLight",
  "enabled": true
},

{
  "name": "Blueprint-Editor",
  "enabled": true
},

{
  "name": "BlueprintTools",
  "enabled": false
},

{
  "name": "Broodmother",
  "enabled": false
},

{
  "name": "CapsuleAmmo",
  "enabled": false
},

{
  "name": "ChunkyChunks",
  "enabled": true
},

{
  "name": "CircuitControlledSilo",
  "enabled": true
},

{
  "name": "CircuitHUD-V2",
  "enabled": true
},

{
  "name": "circuitissimo",
  "enabled": false
},

{
  "name": "ClearSkiesOfPeace",
  "enabled": true
},

{
  "name": "ColorblindCircuitNetwork",
  "enabled": false
},

{
  "name": "ColorCodedPlanners",
  "enabled": true
},

{
  "name": "compact-ore-oil-refining",
  "enabled": false
},

{
  "name": "crafting_combinator",
  "enabled": true
},

{
  "name": "creative-mod",
  "enabled": false
},

{
  "name": "creative-world-plus",
  "enabled": false
},

{
  "name": "CustomCircuitColors",
  "enabled": true
},

{
  "name": "deep-storage-unit",
  "enabled": true
},

{
  "name": "DeleteEmptyChunks",
  "enabled": false
},

{
  "name": "DoRobotsBuildAutomaticTrains",
  "enabled": true
},

{
  "name": "DoubleSpeedSpidertron",
  "enabled": false
},

{
  "name": "EditorExtensions",
  "enabled": false
},

{
  "name": "Ekusplosion",
  "enabled": false
},

{
  "name": "equipment-gantry",
  "enabled": false
},

{
  "name": "eradicators-belt-planner",
  "enabled": true
},

{
  "name": "eradicators-library",
  "enabled": true
},

{
  "name": "factoryplanner",
  "enabled": true
},

{
  "name": "flib",
  "enabled": true
},

{
  "name": "fluid-memory-storage",
  "enabled": true
},

{
  "name": "followersplus",
  "enabled": false
},

{
  "name": "GhostOnWater",
  "enabled": true
},

{
  "name": "GUI_Unifyer",
  "enabled": true
},

{
  "name": "GunEquipment",
  "enabled": false
},

{
  "name": "HandyHands",
  "enabled": true
},

{
  "name": "IceOre",
  "enabled": false
},

{
  "name": "InfiniteInventory",
  "enabled": false
},

{
  "name": "ironclad-gunboat-and-mortar-turret",
  "enabled": true
},

{
  "name": "Krastorio2Assets",
  "enabled": true
},

{
  "name": "Kux-BlueprintExtensions",
  "enabled": true
},

{
  "name": "Kux-CoreLib",
  "enabled": true
},

{
  "name": "large-print-signals",
  "enabled": true
},

{
  "name": "LD_AutoCircuit",
  "enabled": true
},

{
  "name": "leighzercheetahore",
  "enabled": false
},

{
  "name": "leighzerlib",
  "enabled": false
},

{
  "name": "leighzermorphite",
  "enabled": false
},

{
  "name": "leighzerscienceores",
  "enabled": false
},

{
  "name": "leighzerslowncheapitems",
  "enabled": false
},

{
  "name": "leighzeruraniuminnovations",
  "enabled": false
},

{
  "name": "lo-remote-constant",
  "enabled": false
},

{
  "name": "magic-lamp",
  "enabled": true
},

{
  "name": "mining-patch-planner",
  "enabled": true
},

{
  "name": "ModuleInserter",
  "enabled": false
},

{
  "name": "more-minimap-autohide-017",
  "enabled": true
},

{
  "name": "nco-BlueprintTrash",
  "enabled": true
},

{
  "name": "No_Player_Collision",
  "enabled": false
},

{
  "name": "NPBees2",
  "enabled": false
},

{
  "name": "omnilib",
  "enabled": false
},

{
  "name": "omnimatter",
  "enabled": false
},

{
  "name": "pasts-defense-stuff",
  "enabled": false
},

{
  "name": "PauseCombinator",
  "enabled": true
},

{
  "name": "PE-StringyTrainStopRedux",
  "enabled": true
},

{
  "name": "PickerDollies",
  "enabled": true
},

{
  "name": "power-grid-comb",
  "enabled": false
},

{
  "name": "pushbutton",
  "enabled": true
},

{
  "name": "rec-blue-plus",
  "enabled": true
},

{
  "name": "RecipeBook",
  "enabled": true
},

{
  "name": "reconnect-cut-wires",
  "enabled": false
},

{
  "name": "recursive-blueprints",
  "enabled": false
},

{
  "name": "ReloadModsRedux",
  "enabled": true
},

{
  "name": "remote-switch",
  "enabled": true
},

{
  "name": "RemoteConfiguration",
  "enabled": true
},

{
  "name": "re_storage_energistics",
  "enabled": true
},

{
  "name": "Robot256Lib",
  "enabled": true
},

{
  "name": "rusty-locale",
  "enabled": true
},

{
  "name": "SantasNixieTubeDisplay",
  "enabled": true
},

{
  "name": "SchallCircuitGroup",
  "enabled": true
},

{
  "name": "SchallCircuitScaling",
  "enabled": true
},

{
  "name": "SchallLampContrast",
  "enabled": true
},

{
  "name": "SearchlightAssault",
  "enabled": false
},

{
  "name": "shortwave_fix",
  "enabled": true
},

{
  "name": "siege-ballista",
  "enabled": false
},

{
  "name": "SignalSigns",
  "enabled": true
},

{
  "name": "signalstrings",
  "enabled": true
},

{
  "name": "simhelper",
  "enabled": true
},

{
  "name": "SimplifiedElectricTile",
  "enabled": false
},

{
  "name": "Speedertron",
  "enabled": false
},

{
  "name": "spidersentinel",
  "enabled": false
},

{
  "name": "spidertron-logistics",
  "enabled": true
},

{
  "name": "stack-combinator",
  "enabled": true
},

{
  "name": "statistics-combinator",
  "enabled": true
},

{
  "name": "stdlib",
  "enabled": true
},

{
  "name": "stringy-train-stop",
  "enabled": false
},

{
  "name": "TeleportShortcutsAndHotkeys",
  "enabled": false
},

{
  "name": "Ultracube",
  "enabled": true
},

{
  "name": "utility-combinators",
  "enabled": true
},

{
  "name": "VehicleGrid",
  "enabled": true
},

{
  "name": "WireShortcuts",
  "enabled": true
}

]
}

9 months ago

I haven't been able to reproduce a freeze, but I did find something incorrect with ghost arithmetic/decider combinator outputs connected to other non-output entities, which could have been the source.
Hopefully fixed in 0.0.3, let me know if it's still happening after updating.

9 months ago
(updated 9 months ago)

Still freezes in 0.0.3 :(

Edit: tried just cutting a regular pole with no red or green wires, froze as well. So far it has frozen every time I've tried to use "cut".

Edit 2: I tried cutting some belts, this time after waiting for like a minute it unfroze. So "something" is happening...

9 months ago

Hmm, sounds like it's a mod interaction issue then. I'll see if I can figure it out.

9 months ago

I have found the issue:
It's not an infinite loop, as I initially suspected, but it's just a really, really slow calculation.
Because of a limitation in the API, real entities cannot read connections to ghost entities.
So, I have to find ghost entities around the blueprint myself, in order to read the connection in reverse.
What do I use to determine how far to search though? Well, the circuit wire connection distance seems like it's a good metric to use.
I determine what the largest connection distance is in the game, and store that so I don't have to calculate it every time somebody cuts entities.
The downside is that it searches a little bit larger of an area if there's mods that have stuff like longer power poles, even when it doesn't need to.

Shortwave has a connection distance of 1,000,000 tiles.

That means my mod is searching the entire map every time you cut something.
Shortwave could be using cross surface connections, but I made my mod ignore entities that can't be blueprinted since that's what Shortwave uses.
It made sense to do it anyway, but I'm sorry it had to be found out like this :P
Fixed in 0.0.4

9 months ago

Thanks for fixing, and yes 1M tile search seems a bit excessive to do on every cut action :)

New response