Override item stack size with stack.override_count()

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
protocol_1903
Filter Inserter
Filter Inserter
Posts: 278
Joined: Fri Sep 09, 2022 4:33 pm
Contact:

Override item stack size with stack.override_count()

Post by protocol_1903 »

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
Screenshot 2024-10-12 162927.png
Screenshot 2024-10-12 162927.png (24.14 KiB) Viewed 397 times
If you need to reach me, message me on discord.

I make qol mods. Check them out, maybe.
https://mods.factorio.com/user/protocol_1903
If you have a mod idea, I can look into it.
protocol_1903
Filter Inserter
Filter Inserter
Posts: 278
Joined: Fri Sep 09, 2022 4:33 pm
Contact:

Re: Override item stack size with stack.override_count()

Post by protocol_1903 »

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
If you need to reach me, message me on discord.

I make qol mods. Check them out, maybe.
https://mods.factorio.com/user/protocol_1903
If you have a mod idea, I can look into it.
protocol_1903
Filter Inserter
Filter Inserter
Posts: 278
Joined: Fri Sep 09, 2022 4:33 pm
Contact:

Re: Override item stack size with stack.override_count()

Post by protocol_1903 »

Additionally, I think it should be possible to obtain these overstacked item stacks somehow. Some even partially hacky way to obtain them with scripting.
If you need to reach me, message me on discord.

I make qol mods. Check them out, maybe.
https://mods.factorio.com/user/protocol_1903
If you have a mod idea, I can look into it.
Post Reply

Return to “Modding interface requests”