Hi,
is there currently (0.12.26/0.12.27) a way of getting a list of entities on a transport line? it seems, former solutions of finding them with game.surface.find_entities and game.surface.find_entities_filtered do not work anymore. once an item is "inserted" into a LuaTransportLine, it is not findable by these functions.
It looks like currently a line transports the items (assumingly) inserted into it, but their entities can not be accessed from outside. But a line or a belt also transports items, which are in the same location, but (assumingly) were not inserted into the line (just somehow happened to end up on the belt). The entities of the later can be accessed via the find_entities functionality.
I can get name and count of items. But to shuffle them around in a proper way, i need access to the entities. e.g. access their health value. access their exact position on the line.
Any ideas?
Thanks
entity objects of items on transport line (0.12.27)
entity objects of items on transport line (0.12.27)
Last edited by Impatient on Mon Mar 21, 2016 1:32 am, edited 3 times in total.
Re: entity objects of items on transport line (0.12.26/0.12.27)
I would suggest looking at the get_contents() function from the LuaTransportLine class
I trust you'll be able to find how to get the LuaTransportLine item ?
I trust you'll be able to find how to get the LuaTransportLine item ?
Re: entity objects of items on transport line (0.12.26/0.12.27)
you are my man!
Re: entity objects of items on transport line (0.12.26/0.12.27)
http://lua-api.factorio.com/0.12.27/Lua ... t_contentsStanFear wrote:I would suggest looking at the get_contents() function from the LuaTransportLine class
Code: Select all
get_contents() → dictionary string → uint
Get counts of all items on this line.
Return value
The counts, indexed by item names.
Re: entity objects of items on transport line (0.12.26/0.12.27)
Yeah, sorry, Actually, I think that items on the belts no longer are entitiesImpatient wrote:How is this going to give me the entity objects?
and getting the positions of items on the line is not possible (well I think, getting the index is, but not the world position)
Sorry, but I don't think what you want to do will be possible ... (at least not yet)
I would suggest to go to the Modding interface requests forum to ask for this (I think there is already a post about getting the position, don't know for the other stuff)