Page 1 of 1

[2.0.76] Crash creating loader with stack size override via console

Posted: Mon Apr 06, 2026 1:53 pm
by tetlanesh
when running via console create_entity to make a loader (from loaders-modernized mod) that have a stack size override enabled and passing a stack size override value the game crashes. Creating that loader without that parameter works fine and setting that parameter on live entity works fine.

Factorio version: experimental 2.0.76

List of mods:
04-06-2026, 15-46-32.png
04-06-2026, 15-46-32.png (12.79 KiB) Viewed 199 times
Repro:
1. Load save
2. Run this command in console:

Code: Select all

/c
local p = game.player
local s = p.surface
local pos = p.position
s.create_entity{name="mdrn-loader", position={pos.x+2, pos.y}, direction=defines.direction.north, force=p.force, type="output", belt_stack_size_override=1}
3. ...
4. Profit?

Save, dump and log attached

Attached save is small test world via editor extensions testing scenario with just the mods that i think are linked to the crash

Re: Crash when creating Loader-Modernised loader with stack size override via console

Posted: Mon Apr 06, 2026 2:08 pm
by Quezler
Hi, talked with OP on the Space Exploration / Earendel discord about this issue, was already working on narrowing it down so here are my two cents:

space-age
+

Code: Select all

data.raw["loader-1x1"]["loader-1x1"].max_belt_stack_size = 4
data.raw["loader-1x1"]["loader-1x1"].adjustable_belt_stack_size = true
+

Code: Select all

/c game.player.surface.create_entity{name="loader-1x1", position={0, 0}, force="player", belt_stack_size_override=1}

Re: [2.0.76] Crash creating loader with stack size override via console

Posted: Mon Apr 06, 2026 3:34 pm
by boskid
Thanks for the report. Issue is now fixed for the next release.

As a workaround, in game versions up to 2.0.76, do not pass `belt_stack_size_override` to create_entity, but instead set it in a separate instruction after loader was created using https://lua-api.factorio.com/2.0.76/cla ... e_override

Re: [2.0.76] Crash creating loader with stack size override via console

Posted: Mon Apr 06, 2026 5:37 pm
by tetlanesh
Awesome, thanks