Interaction between transport belts and item-on-ground with stack size

Bugs that are actually features.
Post Reply
PFQNiet
Filter Inserter
Filter Inserter
Posts: 289
Joined: Sat Sep 05, 2020 7:48 pm
Contact:

Interaction between transport belts and item-on-ground with stack size

Post by PFQNiet »

Steps to reproduce:

Code: Select all

/c game.player.surface.create_entity{
  name = "item-on-ground",
  stack = {name="iron-ore",count=50},
  position = {1.5,1.5}
}
Place a transport belt under the created item. (Alternatively, build the belt first then run the command to spawn the item stack on it)

The stack count is lost and the item becomes just a single item. You can see this by mining the belt (you only get 1 iron ore), or by checking `get_transport_line(n).get_contents()`.

I realise that item-on-ground with a count > 1 is non-standard, but mining it normally works just fine - and inserter can grab items from the stack too - so it should interact with transport belts in some way that makes sense and doesn't result in loss of stuff.

User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 2242
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: Interaction between transport belts and item-on-ground with stack size

Post by boskid »

I am not sure if this will get changed. Little curious i changed the item transfer logic onto transport lines to always move whole stack instead of taking its content one by one and it immediately made stack inserters (stack 12) to drop whole hand stack as a single stack on belt with count of 12. Belts logic should be able to handle that because of important changes made for 1.1.0 (items with count > 1 will not get unstacked on any belt transition), however item insertion would have to be adjusted to perform transfer that splits stack into multiple items or transfer that makes one large stack. I could easily see a cascade of modding interface requests like "request to allow inserter to drop whole hand content as single item on belt", "ability to specify loader how large should stack be when transfering items from inventory to belt" etc... Also this is not well tested area (having item stack with count>1 on belt) and so i am not considering this to be a bug - i suspect it was never working as you describe it so i am considering this to be more of a feature request.

PFQNiet
Filter Inserter
Filter Inserter
Posts: 289
Joined: Sat Sep 05, 2020 7:48 pm
Contact:

Re: Interaction between transport belts and item-on-ground with stack size

Post by PFQNiet »

Fair enough. Do you know if I can create a different item-entity type with a collision mask preventing collision with belts? This would allow me to have my desired feature without the problematic belt interactions.

EDIT: Just tried it and, while I can use its collision mask to have find_non_colliding_position find a suitable spot to drop it, I can't prevent entities from being built on top of it. It seems the logic of "pick up item-entities under a built entity" is hard-coded. Which makes sense because entities are "supposed" to collide with item-entity but that would mess things up. I'll see if I can figure out some way in script to say "if a transport belt is built over a custom item-entity stack, do something else with it".

Post Reply

Return to “Not a bug”