FactoryPlanner
FactoryPlanner copied to clipboard
Crash when changing product values via "set product amount"
Problem Description
Hello. I am playing on a server with a few friends and this crash occurred when i edited a product amount via "target amount"
Error ServerMultiplayerManager.cpp:92: MultiplayerManager failed: "The mod Factory Planner (1.1.75) caused a non-recoverable error.
Please report this error to the mod author.
Error while running event factoryplanner::Custom event (ID 304)
__factoryplanner__/ui/main/production_handler.lua:221: attempt to perform arithmetic on field 'percentage' (a nil value)
stack traceback:
__factoryplanner__/ui/main/production_handler.lua:221: in function '?'
__factoryplanner__/ui/dialogs/generic_dialogs.lua:211: in function 'dialog_close'
__factoryplanner__/ui/base/modal_dialog.lua:187: in function 'exit'
__factoryplanner__/ui/event_handler.lua:216: in function <__factoryplanner__/ui/event_handler.lua:189>
[C]: in function 'raise_event'
__factoryplanner__/util/raise.lua:27: in function 'close_dialog'
__factoryplanner__/ui/base/modal_dialog.lua:285: in function 'handler'
__factoryplanner__/ui/event_handler.lua:157: in function <__factoryplanner__/ui/event_handler.lua:114>
stack traceback:
[C]: in function 'raise_event'
__factoryplanner__/util/raise.lua:27: in function 'close_dialog'
__factoryplanner__/ui/base/modal_dialog.lua:285: in function 'handler'
__factoryplanner__/ui/event_handler.lua:157: in function <__factoryplanner__/ui/event_handler.lua:114>"
I tested it in singleplayer, producing the same error. Note that i am using krastorio 2, and it seems to happen with the specific factory im using. The factory string will be included in the reproduction section of the report.
Reproduction
- Start a world
- Open factory planner, and import the following string (requires krastorio 2) https://pastebin.com/g2QeYcHx
- in the production section, right click to specify amount on "Basic Tech Card", before changing the target amount to any value other than 120 (tested with 60, and 0)
note that i have not tested it with other products, only the basic tech card
Hm seems I can't reproduce it with your export string alone, probably because it's caused by something being weird in your save file. If you still have it, could you get it to me? That'd really help.
I got the same error on version 1.1.78. Here are steps to reproduce:
- In a new game, make a new factory for iron chests, and make it using its only recipe
- Now make a subfactory for this recipe, and make iron plates using its only recipe
- Adjust the number of iron plates made in the subfactory (by right-clicking the product icon)
- Adjust the number of iron chests made in the main factory
- Crash happens
(note: the order of these steps is important, and every step seems to be necessary - e.g. not creating a subfactory will not crash the game)
Thanks for the details, I'll give that a try.
I also ran into this bug when changing the amount of an item with a subfactory attached.