Page 1 of 1

inventory of transport belts?

Posted: Sat Aug 15, 2015 8:18 pm
by GopherAtl
Currently transport belt entities allow calling get_item_count and has_item_inside, but there's no way to get what types of items these are, short of brute-forcing calls to those functions with different item types. It doesn't seem like a good idea for mod entities to start going around iterating over every type of item in the game to find out what's on a transport belt from moment to moment, though, so not gonna be doing that.

This came up in my attempts to implement a network inserter, which would insert items that have a positive value on the connected circuit network, and if added, I might also be able to implement the often-requested filter inserters - not the old kind, which have been reproduced already, but ones that work with negative instead of positive filtering, grabbing anything NOT in it's filter list.

get_inventory working on them would work, but if that is impractical for some reason (no idea if they really have an inventory like containers, exactly, under the hood) a version of get_contents that is called on the entity directly instead of through an inventory object would also work quite nicely.

Re: inventory of transport belts?

Posted: Fri Aug 21, 2015 11:22 pm
by Rseding91
Good point. Added for 0.12.5.