Page 1 of 1
Transport line neighbours
Posted: Mon Nov 19, 2018 5:17 am
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.
Re: Transport line neighbours
Posted: Mon Nov 19, 2018 5:42 pm
by Staplergun
Use case:
Imma make this for belts.
Re: Transport line neighbours
Posted: Tue Nov 20, 2018 10:56 pm
by Bilka
I added a way to get the connections of the output side to LuaTransportLine for 0.17.
Re: Transport line neighbours
Posted: Wed Nov 21, 2018 2:06 am
by Staplergun
Nice
Re: Transport line neighbours
Posted: Tue Nov 27, 2018 8:37 pm
by sparr
I take it that the input side would be significantly more difficult?
Re: Transport line neighbours
Posted: Tue Nov 27, 2018 9:30 pm
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.
Re: Transport line neighbours
Posted: Tue Nov 27, 2018 9:59 pm
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
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.
Re: Transport line neighbours
Posted: Wed Nov 28, 2018 12:19 am
by Staplergun
So just have it track what it already has and continue to add as it finds inputs?
Re: Transport line neighbours
Posted: Tue Mar 26, 2019 12:09 pm
by Bilka
Turns out the inputs are there properly. So, LuaTransportLine::input_lines is now available in the next version.