I would like to be able to override the stack size of an item using scripting. Stacks over a normal stack size is already a "feature", in how updating mods/versions can decrease a stack size, but already existing stacks are unaffected. It would be useful and convenient to open this feature to scripting.
Currently, LuaItemStack.count() sets the item stack amount equal to the amount parameter or the item stack size, whichever is lower. Therefore, it is impossible to obtain "overstacked" stacks, even through scripting.
I would like LuaItemStack.count() to accept a "override_stack_size" parameter, or a new method along the lines of LuaItemStack.override_count() that does not check if the input count is greater than the item stack size.
example of normal item stack next to overstacked item stack
Override item stack size with stack.override_count()
- protocol_1903
- Filter Inserter

- Posts: 420
- Joined: Fri Sep 09, 2022 4:33 pm
- Contact:
Override item stack size with stack.override_count()
Py and PyBlock developer, wielder of LUA in arbitrary ways. I make mods. Check them out, maybe.
https://mods.factorio.com/user/protocol_1903
https://mods.factorio.com/user/protocol_1903
- protocol_1903
- Filter Inserter

- Posts: 420
- Joined: Fri Sep 09, 2022 4:33 pm
- Contact:
Re: Override item stack size with stack.override_count()
Bringing to the front for 2.0 consideration, I don't see why this would cause many issues in the current engine. Please and thank you
Py and PyBlock developer, wielder of LUA in arbitrary ways. I make mods. Check them out, maybe.
https://mods.factorio.com/user/protocol_1903
https://mods.factorio.com/user/protocol_1903
- protocol_1903
- Filter Inserter

- Posts: 420
- Joined: Fri Sep 09, 2022 4:33 pm
- Contact:
Re: Override item stack size with stack.override_count()
Additionally, I think it should be possible to obtain these overstacked item stacks somehow. Some even partially hacky way to obtain them with scripting.
Py and PyBlock developer, wielder of LUA in arbitrary ways. I make mods. Check them out, maybe.
https://mods.factorio.com/user/protocol_1903
https://mods.factorio.com/user/protocol_1903