Is an Inserter's hand considered an Inventory, and thus can be messed with like a Player's or Chest's inventory? If so, would putting an item into an Inserter's hand manually make it still operate? And what would be the best way to ensure an Inserter has come to it's resting position before messing with its inventory?
The basic idea I want to try and do here is make it so Burner Inserters can daisy chain together.
Inserter Hand
- Templarfreak
- Burner Inserter
- Posts: 17
- Joined: Thu Oct 05, 2017 2:21 pm
- Contact:
Re: Inserter Hand
You have access, see code of:
Burner Leech https://mods.factorio.com/mods/Klonan/BurnerLeech
Burnt Extractor https://mods.factorio.com/mod/BurntExtractor
Burner Leech https://mods.factorio.com/mods/Klonan/BurnerLeech
Burnt Extractor https://mods.factorio.com/mod/BurntExtractor
Re: Inserter Hand
That's funny, as i am almost done forking BurnerLeech to add support for electric inserters and making it honor capacity bonuses, filters, hand position and power state so it will work with every inserter (even modded burners with filters). Will probably realease the mod on monday...Templarfreak wrote:Is an Inserter's hand considered an Inventory, and thus can be messed with like a Player's or Chest's inventory? If so, would putting an item into an Inserter's hand manually make it still operate? And what would be the best way to ensure an Inserter has come to it's resting position before messing with its inventory?
The basic idea I want to try and do here is make it so Burner Inserters can daisy chain together.
Inserters hold a single stack for their hand (inserterentity.held_stack), not a complete inventory. The inserter seems to be totally fine with a script adding, removing or changing items to/from/in the held stack. If it holds anything, it will try to deliver it, as if it has normally picked it up. If the hand is moving back to pickup position and you set some item to be in the held stack, it will instantly change direction and tryto deliver that. If you empty the held stack, it will instantly try to pickup something else.
It does, what you likely would expect it to do.

Inserters also know their pickup and hand position (inserterentity.pickup_position and inserterentity.held_stack_position). The two never seem to exactly match but they come reasonably close so i just check, whether x and y coordinates exhibit less than 0.01 difference. Didn't see item teleporting in game using that heuristic. And it is pretty cheap CPU-wise.
Developers seem to have dumped all the stuff they ever needed into the LuaEntity class instead of making specialized classes - making that beast look like a real mess. But if you search it carefully, you will probably find everything, that item and entity prototypes won't give you.