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] Error with Nullius Thermal Battery

1 year, 15 days ago

Hi,

when playing with the Nullius mod, which contains thermal batteries (which I assume are just reactors without any energy production but large thermal mass) this mod crashes apparently randomly (ie not on placing the batteries, but some time later - I guess it's when the stats for the "reactor" are collected for a full period).

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

Error while running event UtilizationMonitorBlargh::on_tick (ID 0)
UtilizationMonitorBlargh/control.lua:387: attempt to perform arithmetic on field 'energy_usage' (a nil value)
stack traceback:
UtilizationMonitorBlargh/control.lua:387: in function 'working_value_calc'
UtilizationMonitorBlargh/control.lua:545: in function <UtilizationMonitorBlargh/control.lua:504>

I didn't look at the source code of your mod but catching an unexpected nil should be pretty straightforward I guess? :)

1 year, 13 days ago

That code block gets executed when the entity is in a low power state (or if you have Always calculate energy effect enabled, but that's disabled by default), which may be why it seems to be happening randomly. I'll take a look at the mod and this battery though and see what needs to get tweaked.

1 year, 12 days ago

Always calculate energy effect

Yes, it's disabled, in that case I'm not 100% if it really was the thermal battery. Since removing it it didn't happen again, at any rate, and I definitely had base wide low power states since, so it's still the most likely suspect. I just don't get what low power means for a thermal battery (or deactivated reactor, if it really is one). Well, if you can't reproduce the error I can whip up a save file and send it to you.

1 year, 4 days ago

Took a look at this. Interestingly, this actually has a bug in unmodded games too, if Always calculate had been enabled, any reactor would cause the problem, as at some point the energy_usage field for their prototypes got changed to nil (It's possible I never checked that combination but I doubt it - my test world has a few different types of reactors, and that value is on in that game).

Nullius makes this a little odder - the problem exists with both the geothermal plants and the thermal tanks. The plants at least have something sane that happens, as their reactor state is always "working", so their utilization will always show 100% which is perhaps useless information, but at least not "wrong". The thermal tanks are a different story though - they always show state "No power", and there's no good way I've found yet to track them, so they're going to show 0%.

I've uploaded 0.8.15 to fix the crash, but still pondering what to do about the thermal tanks.

11 months ago

Thanks, I just saw the update and noticed the Changelog (and that I missed the notification here). If nothing else helps, blacklisting them would probably be the best thing to do. You are right, always 100% and 0% is not helpful, and I don't know what the utilization of a thermal battery would even be unless you want to do something completely different from every other entity and use the temperature - which would be neat in a way, but probably also out of scope for this mod.

New response