Dark Matter Replicators


This mod adds replicators, machines which can produce items using nothing but electricity. Lower tiers of replicators are the most energy efficient and can essentially transform depleted, empty land into a resource. Higher tier replicators can simplify production lines or otherwise act as a convenience. Tier 1 replicators can replace depleted mining drills, allowing your expansion to be for growth rather than necessity.

Content
5 years ago
0.13 - 0.17
115
Manufacturing

b Incompatibility with "Utilization Monitor" mod.

7 years ago

I receive the following error when placing a Dark Matter replicator with the Utilization Monitor mod enabled:

35.884 Error MainLoop.cpp:864: Exception at tick 6559201: Error while running event UtilizationMonitor::on_tick (ID 0)
Index out of inventory bounds.
stack traceback:
UtilizationMonitor/control.lua:59: in function 'is_working'
UtilizationMonitor/control.lua:72: in function 'update_entity'
UtilizationMonitor/control.lua:135: in function <UtilizationMonitor/control.lua:124>

I'm submitting this here because the monitor worked fine until I placed my first replicator - I assume it's something that most other mods do that it's expecting, combined with bad error handling. :)

I'll also submit this on the Utilization Monitor thread - seems like some defensive programming could have helped here, and maybe y'all could collaborate to figure out what's going on.

Thanks!

7 years ago
(updated 7 years ago)

Your error message shows that the Utilization Monitor crashes on line 59 of control.lua. I downloaded the Utilization Monitor mod and glanced over its code and it seems to be that the problem is that Utilization Monitor assumes that every lab has exactly seven input slots. Because the replication lab has four slots, there is a crash when you place such a lab down and Utilization Monitor tries to access the nonexistent slot #5.

I can't fix this bug my changing my mod. However, if you open up Utilization Monitor's control.lua file then you can replace lines 58 and 59

for i = 1, 7 do
  local item = inventory[i]

with the line

for i,item in ipairs(inventory) do

which should in theory allow Utilization Monitor to work with labs of any inventory size.

7 years ago

I mean, I guess I could change it on my end by adding three more item slots to the replication lab. But the items in those slots wouldn't ever be used for research and their presence might confuse some players, so I won't.

7 years ago

Ah-hah. Okay, makes sense then. Mind if I quote you over on the bug report I made on the Utilization Monitor mod?

7 years ago
(updated 7 years ago)

Go right ahead.

7 years ago
(updated 7 years ago)

It looks like your patch breaks lab utilization, but at least it isn't crashing my game now. I think anything else is on UM's end though.

Thanks for the help!

New response