Page 1 of 1
Ability to follow belts and transport lines
Posted: Wed Jun 01, 2016 5:56 pm
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.
Re: Ability to follow belts and transport lines
Posted: Sat Mar 04, 2017 7:45 pm
by sparr
If this is in 0.14, I missed it. If it's scheduled for 0.15, hooray. If not, bump.
Re: Ability to follow belts and transport lines
Posted: Tue May 09, 2017 6:27 pm
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.
Re: Ability to follow belts and transport lines
Posted: Mon May 15, 2017 9:34 pm
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?"
Re: Ability to follow belts and transport lines
Posted: Sun Mar 25, 2018 7:09 am
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.
Re: Ability to follow belts and transport lines
Posted: Tue Nov 27, 2018 7:40 pm
by sparr
Here's another mod that could make use of this feature:
https://www.reddit.com/r/factorio/comme ... way_to_go/
Re: Ability to follow belts and transport lines
Posted: Tue Nov 27, 2018 8:01 pm
by Bilka
Re: Ability to follow belts and transport lines
Posted: Tue Mar 26, 2019 12:58 am
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.
Re: Ability to follow belts and transport lines
Posted: Tue Mar 26, 2019 6:07 am
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.
Re: Ability to follow belts and transport lines
Posted: Tue Mar 26, 2019 12:12 pm
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".
Re: Ability to follow belts and transport lines
Posted: Tue Mar 26, 2019 4:54 pm
by sparr
sparr wrote: Wed Jun 01, 2016 5:56 pmI'd like to be able to ask a belt entity which belt(s) feed into it from which side(s)
Re: Ability to follow belts and transport lines
Posted: Tue Mar 26, 2019 4:58 pm
by Bilka
sparr wrote: Tue Mar 26, 2019 4:54 pm
sparr wrote: Wed Jun 01, 2016 5:56 pmI'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.
Re: Ability to follow belts and transport lines
Posted: Tue Mar 26, 2019 7:26 pm
by sparr
Hooray!