Page 1 of 1
Health of item on belt
Posted: Tue Oct 18, 2016 9:54 am
by Neel
Items on belt have health. When picked up or inserted into a chest, it shows up. But the TransportLine API only shows contents with names and counts. What is the easiest way to get the health?
As a side note, is it possible to connect an underground belt input with another output manually by using code? Currently, the Entity.neighbours show the other member of the pair, but it is read only.
Re: Health of item on belt
Posted: Tue Oct 18, 2016 3:57 pm
by aubergine18
1. You can only access that info once you have removed item from belt (as then you have an ItemEntity object which has the properties you're looking for)
2. Underground belts and pipes automatically connect to orphans within range that are facing in the right direction. So just placing the other end in right place & direction will create the link.
If you were thinking of underground junctions... as far as I know there's no way to do that sort of thing currently - as you found, the .neighbours array is read only.
Re: Health of item on belt
Posted: Wed Oct 19, 2016 2:10 am
by Neel
Thanks aubergine18.
1. Yeah, I'm looking for that info immediately from a reference to the belt entity, which has .transport_line.get_contents() with no health info. Can't really get them off the belt. Calling remove() just voids the item giving me only a count to work with.
2. Wanted to wire up one down belt with an up belt that's not in range or in straight line. Probably not possible as well.
Re: Health of item on belt
Posted: Wed Oct 19, 2016 6:54 am
by aubergine18
Neel wrote:2. Wanted to wire up one down belt with an up belt that's not in range or in straight line. Probably not possible as well.
Take a look at Factorissimo mod and see how that handles the belts/pipes between those outside and inside the factory, that might give a possible solution to your requirement.
https://github.com/MagmaMcFry/Factorissimo