LuaSurface.create_entity on a belt intermittent fail to belt

Bugs that are actually features.
sparr
Smart Inserter
Smart Inserter
Posts: 1521
Joined: Fri Feb 14, 2014 5:52 pm
Contact:

LuaSurface.create_entity on a belt intermittent fail to belt

Post by sparr »

I am using create_entity to create an item-on-ground approximately where a belt lane exists. Most of the time, the item ends up getting "caught" by the belt and moved along. Sometimes, seemingly usually when the belt is full or nearly full, the item doesn't get caught, and stays in place. The same thing happens when I move the items to exactly line up with the belt lane, rather than being 0.1 units off in the video below.

https://www.youtube.com/watch?v=KjmPRM579Z8
Rseding91
Factorio Staff
Factorio Staff
Posts: 16014
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: LuaSurface.create_entity on a belt intermittent fail to belt

Post by Rseding91 »

Thanks for the report however that's working correctly. If the belt can't accept the item at that location the item isn't put on the belt and instead just exists as an item in the world.
If you want to get ahold of me I'm almost always on Discord.
User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5412
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: LuaSurface.create_entity on a belt intermittent fail to belt

Post by Klonan »

If you want to insert things onto a belt it is better to inserter directly onto the transport line:

http://lua-api.factorio.com/latest/LuaT ... tLine.html
sparr
Smart Inserter
Smart Inserter
Posts: 1521
Joined: Fri Feb 14, 2014 5:52 pm
Contact:

Re: LuaSurface.create_entity on a belt intermittent fail to belt

Post by sparr »

See my other feature requests for a way to get transportline->transportline connections (viewtopic.php?f=28&t=25992). Calculating where on which transport line to drop an item is annoyingly complicated and computationally expensive currently, despite that information obviously already existing in the normal belt behavior code.

I'll make a separate "bug" report about the spill_item_stack behavior that prompted me to try to make this work.
Post Reply

Return to “Not a bug”