Utilization Monitor Blargh


Displays the utilization percentage of factories, miners, labs, furnaces, boilers, generators, and reactors.

8 months ago
0.18 - 1.1
7.49K

b [Fixed] Crash on hotkey

3 years ago

I think this has already happened before. Started again after update.
On of/on labels via hotkey:

The mod Utilization Monitor (Blargh) (0.8.5) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event UtilizationMonitorBlargh::toggle-utilization-monitor-labels (ID 312)
The mod Schall Endgame Evolution (1.1.0) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event SchallEndgameEvolution::on_runtime_mod_setting_changed (ID 59)
SchallEndgameEvolution/control.lua:98: bad argument #3 of 3 to 'index' (string expected, got nil)
stack traceback:
[C]: in function '__index'
__SchallEndgameEvolution
/control.lua:98: in function <SchallEndgameEvolution/control.lua:97>
stack traceback:
[C]: in function 'newindex'
__UtilizationMonitorBlargh
/control.lua:624: in function <UtilizationMonitorBlargh/control.lua:623>

3 years ago

This is caused by the other mod, SchallEndgameEvolution. It assumes assume player_index is defined in the on_runtime_mod_setting_changed event (and they're watching EVERY setting change, instead of filtering to their own...). However, https://lua-api.factorio.com/latest/events.html#on_runtime_mod_setting_changed explicitly says this isn't true in the case of a script changing a setting (which UMB is doing - it's trying to update the mod setting tick box to match what you're toggling).

The problem is in SchallEndgameEvolution, line 98:

local function runtime_mod_setting_changed(e)
  local player = game.players[e.player_index]
3 years ago

I saw that it had something to do with another mod, I reported it here because this surfaced after UMB update. Thanks for reporting it for the other mod.

3 years ago

Yeah, 0.8.5 triggered it because the code is fixing a bug in 0.8.4 (the operating state gets out of sync with the checkbox in the Mod Settings page), heh.

3 years ago

Sorry for the waiting. Finally have some time for Factorio modding.

Thanks for reporting.
I was not aware that can be optional, and was not expecting mod settings being changed by script.
Just released 0.17.16 / 0.18.8 / 1.0.2 / 1.1.1, which (hopefully) fixed the problem.
I will update my other mods (if they do anything with runtime_mod_setting_changed and have same problem) in a few days.

New response