It would be super-convenient connect_neighbours and disconnect_neighbours methods supported a 2nd argument - wire type - and supported all circuit network-able entities instead of just power poles. Currently disconnect_wire works with red/green cables, but only in a "disconnect from all" way, and it would be nice if you could connect or disconnect a single connection between two objects of any of the types, and in the case of red/green, if they worked with things like smart chests and inserters rather than just electric poles...
entity.connect_neighbour(entity2[, connectortype])
entity.disconnect_neighbor(entity2[,connectortype])
It seems particularly odd that disconnect, and only disconnect, supports circuit net wires at present, but hopefully that means they're on the same basic underlying system and the feature might be easy to slip in to an update soon-ish...? :hopeful look:
circuit connections via neighbours interfaces?
circuit connections via neighbours interfaces?
My Mods:
Nixie Tubes - numeric displays for your circuit networks!
Logistic Combinators - use logistics values in circuit logic! -
Autowire - automate red/green wire connections
Nixie Tubes - numeric displays for your circuit networks!
Logistic Combinators - use logistics values in circuit logic! -
Autowire - automate red/green wire connections
Re: circuit connections via neighbours interfaces?
It already works that way:
Optionally you can also define the source and or target circuit IDs to remove (for combinators that have more than one circuit ID) using: source_circuit_id=id, target_circuit_id=id
Code: Select all
entity1.disconnect_neighbour({wire=defines.wire.green, target_entity=entity2})
If you want to get ahold of me I'm almost always on Discord.
Re: circuit connections via neighbours interfaces?
ah, this is excellent news! I will update the wiki after testing the limits of this for myself.
My Mods:
Nixie Tubes - numeric displays for your circuit networks!
Logistic Combinators - use logistics values in circuit logic! -
Autowire - automate red/green wire connections
Nixie Tubes - numeric displays for your circuit networks!
Logistic Combinators - use logistics values in circuit logic! -
Autowire - automate red/green wire connections
Re: circuit connections via neighbours interfaces?
Rseding91 wrote:It already works that way:
Optionally you can also define the source and or target circuit IDs to remove (for combinators that have more than one circuit ID) using: source_circuit_id=id, target_circuit_id=idCode: Select all
entity1.disconnect_neighbour({wire=defines.wire.green, target_entity=entity2})
Ok, been poking at this and got it worked out, works as you said, so the wiki will be updated properly shortly.
A follow-up request, though; the neighbours field still seems accessible only on power poles, for inspecting the current circuit connections from mods; could we get that added to all circuit devices that can be wired?
:edit: oh, but there doesn't seem to be a defines.wire, the old wiki docs were showing circuitconnector.red/green, but there is no circuitconnector.copper, and circuticonnector.logistic doesn't apply here; is there a wire/cable defines that should be used instead, and would work with both copper cables and circuit connectors?
My Mods:
Nixie Tubes - numeric displays for your circuit networks!
Logistic Combinators - use logistics values in circuit logic! -
Autowire - automate red/green wire connections
Nixie Tubes - numeric displays for your circuit networks!
Logistic Combinators - use logistics values in circuit logic! -
Autowire - automate red/green wire connections