Utilization Monitor

by suan2

Displays utilization of factories, miners, labs and furnaces.

4 years ago
0.15 - 0.18
16

g Crush on game load

3 years ago

Got a crush with this log

1091.379 Error MainLoop.cpp:1205: Exception at tick 79008: The mod Utilization Monitor (0.6.0) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event UtilizationMonitor::on_tick (ID 0)
UtilizationMonitor/control.lua:251: attempt to call field 'is_working' (a nil value)
stack traceback:
UtilizationMonitor/control.lua:251: in function 'update_entity'
UtilizationMonitor/control.lua:458: in function <UtilizationMonitor/control.lua:424>
1947.492 Loading map C:\Users\TierreElhe\AppData\Roaming\Factorio\saves\AB1.zip: 8811728 bytes.

3 years ago

Getting same thing. I've found that if you turn off the mod you can load the save. It will give you a message "Migrated content" "Removed entities" "statictext" with a value equal to the number of entities in the save.

3 years ago

Yeah, but i really need this mod :) It is essential to see where your problems are.

3 years ago
(updated 3 years ago)

there seems to be a problem with (not) properly checking labels or machines, and it seems to happen only on game load. thus disabling the mod should on next load remove all "bad" labels and status flags that the mod placed and/or stored. saving that game then should save a cleaned up map, and when starting the map once again WITH the mod, there should be no problem (until it randomly happens again) ... ?

I'll try this soon (tm) and when i didn't edit this message i didn't try yet, or it worked :-)

just an idea since this problem never happened to me before, and apparently only started happening 3 days ago: this is the first time that i reloaded a map after updating to 0.18.29 ... and there were some changes to which data is allowed and/or stored in 'global' since 0.18.28 ... ?

my details: i played quite a while, also reloaded the map a few times, and never had such a problem until now. after a spitter killed me while i was looking at map mode, i tried loading the last autosave and also got the above error :

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

Error while running event UtilizationMonitor::on_tick (ID 0)
UtilizationMonitor/control.lua:251: attempt to call field 'is_working' (a nil value)
stack traceback:
UtilizationMonitor/control.lua:251: in function 'update_entity'
UtilizationMonitor/control.lua:458: in function <UtilizationMonitor/control.lua:424>

3 years ago

Same exact error for me. I disabled the mod, saved, and re-enabled the mod, which did make everything work again.

3 years ago

But then i reload with mod enabled i get same error again.

3 years ago
(updated 3 years ago)

So, I tinkered with this for a little bit, and came up with adding the following few lines that at least cures the symptom. is_working doesn't get saved, due to changes in the save serializer (you'll see a message "removed NNNN lua functions when saving"), which causes the problem. This is a quick workaround:

function update_entity(data, update)
  if data.is_working == nil then
    data.is_working = get_is_working_function(data.entity)
  end

I uploaded a UtilizationMonitorBlargh mod to the mod portal with just this patch applied, @suan2 I will remove immediately if you want, and will do so if this mod gets updated - I just needed something to share with the couple people that play on my private server.

This needs a more "proper" fix, since according to the Factorio devs (https://factorio.com/blog/post/fff-349) storing Lua functions in global isn't officially supported. This probably would be a tweak to determine then call the correct function every time (via something akin to the current get_is_working_function), as opposed to determining the function once and saving it to the globals data.

3 years ago
(updated 3 years ago)

And of course, once I typed that out, I thought, "This should actually be pretty easy...". I updated UtilizationMonitorBlargh to 0.6.1 with the changes to the code (a little extensive to have in a message here, but all the changes are in control.lua). Eliminates the is_working function storage entirely, so should both fix the mod and fix the "removed NNN lua functions" warning on save.

I posted the patch to the UM github at https://github.com/sullerandras/UtilizationMonitor/issues/21

3 years ago

And what do I have to do with the file so that I can use the mod? >.<
But in any case, thank you for doing the work so we can play with that mod ^^

3 years ago

Skully310 - it's probably easiest to just use the Utilization Monitor Blargh mod until this one gets updated.

Alternatively, grab that mod, take the control.lua out of it, and put it into this one.

3 years ago

Thanks Blargh!

3 years ago

I was having the same prob. Now using the patched version by Blargh, thnx :)

New response