Reproducing spill_item_stack behavior in Lua

Place to get help with not working mods / modding interface.
sparr
Smart Inserter
Smart Inserter
Posts: 1521
Joined: Fri Feb 14, 2014 5:52 pm
Contact:

Reproducing spill_item_stack behavior in Lua

Post by sparr »

viewtopic.php?f=58&t=59047

I need to "spill" an item at the target position if it will fit. Since spill_item_stack always skips that position (and starts with the surrounding positions), I need to reproduce its behavior. I've tried just doing surface.find_entity, but that misses things on belts nearby, or find_entities_filtered but I can't get the search area right. And if I get the search wrong, then I risk doing create_entity on top of a full belt, which doesn't work right (viewtopic.php?f=23&t=59032)

Anyone have tips on how I can accomplish this?
Post Reply

Return to “Modding help”