Transport line neighbours

Post Reply
Staplergun
Long Handed Inserter
Long Handed Inserter
Posts: 96
Joined: Sun Mar 25, 2018 5:34 am
Contact:

Transport line neighbours

Post by Staplergun »

Request that transport lines has a method to return connected transport line neighbour entities. Very similar to the way the .neighbours would work on a pipe, except it returns any entity that has a transport line that leads to this entity or from this entity. It should account for sideloading (To this entity and from this entity), underground belts (Or I can just run neighbours on a underground belt because it's already there), and splitters should be able to return all transport lines from both sides (So as many as four entities). It doesn't *have* to be sorted by "Left side/right side outgoing" for something like a splitter but that would be great.

If possible a secondary return that says whether that given entity is an incoming transport line, or an outgoing. If not that's pretty easy to obtain by just checking the direction the remote entity is facing.

Staplergun
Long Handed Inserter
Long Handed Inserter
Posts: 96
Joined: Sun Mar 25, 2018 5:34 am
Contact:

Re: Transport line neighbours

Post by Staplergun »

Use case:
Imma make this for belts.
Image

Bilka
Factorio Staff
Factorio Staff
Posts: 3128
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: Transport line neighbours

Post by Bilka »

I added a way to get the connections of the output side to LuaTransportLine for 0.17.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

Staplergun
Long Handed Inserter
Long Handed Inserter
Posts: 96
Joined: Sun Mar 25, 2018 5:34 am
Contact:

Re: Transport line neighbours

Post by Staplergun »

Nice

sparr
Smart Inserter
Smart Inserter
Posts: 1327
Joined: Fri Feb 14, 2014 5:52 pm
Contact:

Re: Transport line neighbours

Post by sparr »

I take it that the input side would be significantly more difficult?

Staplergun
Long Handed Inserter
Long Handed Inserter
Posts: 96
Joined: Sun Mar 25, 2018 5:34 am
Contact:

Re: Transport line neighbours

Post by Staplergun »

Retreiving an input would likely require some sort of data restructure of how lines talk to each other, or actively searching for sideloads or inputs.

Bilka is currently tied up writing a 2D drawing system that can be used, so I imagine it not really happening right now.

Bilka
Factorio Staff
Factorio Staff
Posts: 3128
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: Transport line neighbours

Post by Bilka »

Staplergun wrote:
Tue Nov 27, 2018 9:30 pm
Bilka is currently tied up writing a 2D drawing system that can be used, so I imagine it not really happening right now.
I'm doing small requests today because I don't have time for the big change I have to make :D

The TransportLine does know inputs in *some* way, but when I experimented with it when implementing the output lines, it only ever gave me the first connection which was very... unsatisfactory, so I left it at that.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

Staplergun
Long Handed Inserter
Long Handed Inserter
Posts: 96
Joined: Sun Mar 25, 2018 5:34 am
Contact:

Re: Transport line neighbours

Post by Staplergun »

So just have it track what it already has and continue to add as it finds inputs?

Bilka
Factorio Staff
Factorio Staff
Posts: 3128
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: Transport line neighbours

Post by Bilka »

Turns out the inputs are there properly. So, LuaTransportLine::input_lines is now available in the next version.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

Post Reply

Return to “Implemented mod requests”