Factory solver based on linear programming

by B_head

The Factorio calculator. Calculate the quantities of machines and ingredients required in a factory to hit your target production rate. (Compatible with 2.1; see changelog)

Utilities
4 months ago
2.0
2.56K

b Runtime crash due to API change

9 days ago
(updated 8 days ago)

Hi again! Just letting you know that changes to the API in Factorio 2.1.22 (experimental) causes an immediate runtime crash upon loading a save or starting a new game, even if the prior problem with pumping speed in v0.8.2 is resolved. The initial error message looks like this:

Error while running event factory_solver::on_init()
LuaFluidBoxPrototype doesn't contain key minimum_temperature.
stack traceback:
    [C]: in function '__index'
    __factory_solver__/manage/virtual.lua:922: in function 'create_fusion_generator_virtual'
    __factory_solver__/manage/virtual.lua:71: in function 'create_virtuals'
    __factory_solver__/control.lua:60: in function <__factory_solver__/control.lua:57>

Similar messages may be given for /manage/accessor/energy.lua:467 and /manage/accessor/energy.lua:442.

Apparently, the allowed temperature range for the input fluid is no longer defined through the machine's fluid_box property with its subproperties minimum_temperature and maximum_temperature (they have been removed), but instead through new properties belonging directly to the machine prototype called minimum_input_temperature and maximum_input_temperature. These are now used by boilers, fusion generators, fusion reactors, generators and mining drills.

Fixing the above allows the mod to work once again without any runtime crash.

New response