belt TransportLine functions ?
Posted: Tue Mar 22, 2016 1:25 am
Hi,
I try to write a mod/object that exchanges 2 lanes of a belt. So there is an input belt, an output belt and my object between them.
I use : http://lua-api.factorio.com/0.12.27/Lua ... tLine.html
I succeed in inserting items at the entrance of the output belt-lane, checking if the belt's entrance is free (using can_insert_at_back() and insert_at_back() ),
but I wonder how you can check if the exit of the input belt-lane is containing an item. Because with get_contents() and get_item_count(), you can read all items that are in a lane, but it does not tell you where they are (at the entrance, in the middle, or ready to be extracted at the exit).
For the moment, I created an objet that extracts items from the input belt, and inserts them in the output belt. The insertion works fine, but the extraction is too quick : it extracts all items as soon as they enter the belt. So the input belt is always almost empty, letting a strange empty belt at the entrance of my object. I want to extract just those items that arrive at the end of the belt, letting the other making their full transit thru the input belt....
An idea ?
I try to write a mod/object that exchanges 2 lanes of a belt. So there is an input belt, an output belt and my object between them.
I use : http://lua-api.factorio.com/0.12.27/Lua ... tLine.html
I succeed in inserting items at the entrance of the output belt-lane, checking if the belt's entrance is free (using can_insert_at_back() and insert_at_back() ),
but I wonder how you can check if the exit of the input belt-lane is containing an item. Because with get_contents() and get_item_count(), you can read all items that are in a lane, but it does not tell you where they are (at the entrance, in the middle, or ready to be extracted at the exit).
For the moment, I created an objet that extracts items from the input belt, and inserts them in the output belt. The insertion works fine, but the extraction is too quick : it extracts all items as soon as they enter the belt. So the input belt is always almost empty, letting a strange empty belt at the entrance of my object. I want to extract just those items that arrive at the end of the belt, letting the other making their full transit thru the input belt....
An idea ?