Ability to follow belts and transport lines

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

Ability to follow belts and transport lines

Post by sparr »

I wrote some lua yesterday to follow a belt/LuaTransportLine to its end. It would be nice if this and related functionality was present in the API to be queried. I'd like to be able to ask a belt entity which belt(s) feed into it from which side(s), and which belt/underground/splitter it fees into, and/or the same for one or both luatransportlines on the belt.

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

Re: Ability to follow belts and transport lines

Post by sparr »

If this is in 0.14, I missed it. If it's scheduled for 0.15, hooray. If not, bump.

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

Re: Ability to follow belts and transport lines

Post by sparr »

Another bump. 80% of the code in Belt Combinators and Belt Overflow is just to be able to follow a belt to the end. I am slowly resolving bugs in my code, but doubt it will ever be perfect given the complexity. Also it would be much faster to use the information that must already exist for normal belt flow.

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

Re: Ability to follow belts and transport lines

Post by sparr »

Being able to trace this faster would also make it feasible to make a mod that displays "what is produced with all the ingredients flowing down this belt?"

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

Re: Ability to follow belts and transport lines

Post by sparr »

Another impending release, another bump. Would love to have this in 0.17 so I can get rid of 90% of the lua code and 99% of the cpu thrashing in my Belt Overflow mod, and now also so I can fix a bug in my mod that is going to be very difficult to fix otherwise.

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

Re: Ability to follow belts and transport lines

Post by sparr »

Here's another mod that could make use of this feature: https://www.reddit.com/r/factorio/comme ... way_to_go/

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

Re: Ability to follow belts and transport lines

Post by Bilka »

See 63535
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

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

Re: Ability to follow belts and transport lines

Post by sparr »

.output_lines is not sufficient for figuring out if a belt is a curve or sideloaded. I find my belt-following mods still need all the same old logic for figuring out which belts are pointing at and pointed at by which other belts.

The game must know this, in at least two different places. First, the rendering of whole belts uses it, to show or not show a curved belt. Second, the belt to belt item transition code uses it, to decide whether to insert a new item at the back of the belt or at the side load position.

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

Re: Ability to follow belts and transport lines

Post by Bilka »

You asked for where it leads, you get where it leads with output lines - you get another lua transport line which tells you the entity and the side, so exactly what your first post asks for.

If you want something different, make a request for that instead of posting here again.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

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

Re: Ability to follow belts and transport lines

Post by Bilka »

sparr wrote:
Tue Mar 26, 2019 12:58 am
.output_lines is not sufficient for figuring out if a belt is a curve or sideloaded.
Yes it is. Example for a simple transport belt: Get output lines of both transport lines. Compare if output lines point to same line -> sideloading, if they point to different lines -> just "the next belt".
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

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

Re: Ability to follow belts and transport lines

Post by sparr »

sparr wrote:
Wed Jun 01, 2016 5:56 pm
I'd like to be able to ask a belt entity which belt(s) feed into it from which side(s)

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

Re: Ability to follow belts and transport lines

Post by Bilka »

sparr wrote:
Tue Mar 26, 2019 4:54 pm
sparr wrote:
Wed Jun 01, 2016 5:56 pm
I'd like to be able to ask a belt entity which belt(s) feed into it from which side(s)
FactorioBot wrote:
Tue Mar 26, 2019 2:55 pm
Scripting
  • Added LuaTransportLine::input_lines read.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

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

Re: Ability to follow belts and transport lines

Post by sparr »

Hooray!

Post Reply

Return to “Implemented mod requests”