Production Analyst


Analyze the consumption of an item or fluid on demand, throughout your entire factory. Designed to be very UPS-friendly.

Utilities
2 years ago
1.1
2.59K
Manufacturing

b [Fixed][1.1.4] Error

3 years ago

模组 Production Analyst (1.1.4) 引发了无法恢复的错误。
请向模组作者报告此错误。

Error while running event production-analyst::on_gui_click (ID 1)
production-analyst/scripts/gui.lua:424: attempt to index local 'task' (a nil value)
stack traceback:
production-analyst/scripts/gui.lua:424: in function <production-analyst/scripts/gui.lua:383>

I don't know why, I didn't even open this mod, but suddenly popped up in the middle of the game, hoping to fix this bug.
In addition, when I used mod:Factory Inspector, I also encountered almost identical problems. The appendix is as follows. I hope these are helpful.

Error while running event factory-inspector::on_tick (ID 0)
factory-inspector/script/input-output-calculator.lua:68: attempt to index local 'recipe' (a nil value)
stack traceback:
factory-inspector/script/input-output-calculator.lua:68: in function 'enrolConsumedFluidFuel'
factory-inspector/script/entity-tracker.lua:55: in function 'updateConsumersAndProducers'
factory-inspector/script/entity-tracker.lua:94: in function 'checkExistingEntityForChanges'
factory-inspector/script/entity-tracker.lua:131: in function 'checkEntityBatchForRecipeChanges'
factory-inspector/script/event-handlers.lua:40: in function <factory-inspector/script/event-handlers.lua:15>

Hey, thank you for the report :) The cause of the crash was that the "repeat task" button was clicked without any tasks in the history to repeat, and I wasn't verifying the validity of the task before trying to add it to the queue. I've uploaded v1.1.5 which fixes this issue.

I'm not sure how this could have happened with the GUI closed though. Were you perhaps in a multiplayer game? One of the other players might have clicked the button if that's the case. Either way, let me know if you encounter it again.

As for the Factory Inspector crash, I would suggest that you report it to Aurensar (that mod's developer) as it's unrelated to the crash you encountered with this mod.

3 years ago

Thank you. Now I have not encountered this problem again.

3 years ago

I'm sorry that I have encountered a bug again.

Error while running event production-analyst::on_gui_click (ID 1)
LuaRecipe API call when LuaRecipe was invalid.
stack traceback:
[C]: in function 'index'
__production-analyst
/scripts/gui.lua:353: in function 'render_results'
production-analyst/scripts/gui.lua:83: in function 'create_gui'
production-analyst/scripts/gui.lua:506: in function 'toggle'
production-analyst/scripts/gui.lua:388: in function <production-analyst/scripts/gui.lua:383>

This bug may be caused by the mod LTN Cleanup. I hope it will help you. Thank you.

Hmm, did you happen to change your mod configuration such that some recipes you previously had were deleted?

3 years ago

Yes, I deleted some mods yesterday. Is this the source of the problem?
I just turned off the mod and then turned it back on, so far there is no problem.

Yes, that was the problem in this case. Removing those mods removed some recipes from the game that were being referenced in the results view. Specifically, one of your previous runs had captured consumption by one of the now-removed recipes. One slightly more convenient option you have for now, if you intend on making similar mod changes in the future, would be to delete the the entries in your queue and history before saving and making the changes. That alone would ensure no references to invalid prototypes persist. What you did, by removing the mod, saving, and then re-adding it accomplishes the same thing.

I'll need to add some additional validation in a number of places so that the mod handles removal of recipe, item, and fluid prototypes more gracefully. The workaround I suggested would no longer be necessary.

3 years ago

OK, thank you for your reply. I like your mod and hope it will become better and better.

Thank you for your kind words and for the bug report :)

New response