Wire Connections
Posted: Sat Mar 12, 2016 12:30 pm
As far as I can tell, there is no way to get the wire connections for certain entities. "Neighbours" is supposed to return an entity or entity table, but this only works for pipes/belts/poles. In other words, I have no way of getting which entity is connected to what from the API, for an inserter for example. If I force my way; check every cell that a wire can be attached to these entities, it raises the same problem, as you can wire an inserter to another.
The reason I need such a thing is, I have a mod that destroys an inserter and creates a new one in the same place when you rotate it. I can copy the existing filters, existing circuit / logistics conditions, but I cannot reconnect the wires. There are methods to connect / disconnect a wire between two entities, however this requires specific information, an "neighbours" as I've said, only works on poles/pipes/belts.
So my suggestion is simple. If an entity can accept a wire connection (red wire, green wire), allow "neighbours" to be callable on these entities as well.
The reason I need such a thing is, I have a mod that destroys an inserter and creates a new one in the same place when you rotate it. I can copy the existing filters, existing circuit / logistics conditions, but I cannot reconnect the wires. There are methods to connect / disconnect a wire between two entities, however this requires specific information, an "neighbours" as I've said, only works on poles/pipes/belts.
So my suggestion is simple. If an entity can accept a wire connection (red wire, green wire), allow "neighbours" to be callable on these entities as well.