Factorissimo2


Factorissimo adds factory buildings to Factorio. Place them down, walk in, build your factories inside!

Content
2 years ago
0.14 - 1.1
208K

b 'Factory bulk transfer pipe (output)' crashes the game

5 years ago
(updated 5 years ago)

My game crashes whenever the 'Factory bulk transfer pipe (output)' (the tube with the yellow circle) becomes full.
I'm using Bob's mods and other mostly non-game changing mods.

Log:

Error while running event Factorissimo2::on_tick (ID 0)
Fluid amount has to a be positive.
stack traceback:
‗ ‗Factorissimo2‗ ‗/connections/fluid.lua:147: in function 'transfer'
‗ ‗Factorissimo2‗ ‗/connections/fluid.lua:203: in function '?'
‗ ‗Factorissimo2‗ ‗/connections.lua:217: in function 'update'
‗ ‗Factorissimo2‗ ‗/control.lua:1096: in function
<‗ ‗Factorissimo2‗ ‗/control.lua:1069>
stack traceback:
[C]: in function '‗ ‗newindex'
‗ ‗Factorissimo2‗ ‗/connections/fluid.lua:147: in function 'transfer'
‗ ‗Factorissimo2‗ ‗/connections/fluid.lua:203: in function '?'
‗ ‗Factorissimo2‗ ‗/connections.lua:217: in function 'update'
‗ ‗Factorissimo2‗ ‗/control.lua:1096: in function
<‗ ‗Factorissimo2‗ ‗/control.lua:1069>

Tell me if you need more information about this bug.

5 years ago

Ah I see. Fixed now.

5 years ago
(updated 5 years ago)

Was this bug introduced with the .17 upgrade, or is this crash possible with .16?

I haven't upgraded to .17 (too many modifications to do so). I filled up a bulk-transfer output pipe and it doesn't seem to be a problem.

5 years ago
(updated 5 years ago)

The issue was caused by my code setting a fluidbox to 0 amount of some fluid.

In 0.16:

Mod: "Hey could you set this tank to contain x water? By the way, x is 0."
Factorio: "Hmm, I've received a request to set a tank to contain 0 water. Is 0 a positive amount? Lemme check, no. So I'll set the fluidbox to empty, makes sense, no big deal."

In 0.17:

Mod: "Hey could you set this tank to contain X water? By the way, X is 0."
Factorio: "Hmm, I've received a request to set a tank to contain 0 water. Is 0 a positive amount? Lemme check, no. Wait, no? You want me to set 0 water inside that tank? What could that possibly mean? I'll crash now. Have fun waiting for the bugfix, innocent user."

5 years ago
(updated 5 years ago)

lol Ok thank you :P

I'm sure the .17 way is more efficient on the back end somehow.

5 years ago
(updated 5 years ago)

Not really, since Factorio does the x > 0 check anyway. Maybe there's a teeny tiny performance improvement gained by forcing mods to pass one less Lua table to an API call occasionally, but I doubt it's anywhere near enough to offset the time and patience lost by the mod developers as well as the Factorio users when a mod inevitably does happen to be vulnerable to this sort of crash.

New response