I have not fully tested this fix but it does allow the game to load. I have not researched the Dark Matter in my game yet so I do not know if this somehow breaks anything in game.
Try replacing the function on line 136 of prototypes/repltable/table-creation.lua with the below function.
This makes it so Dark Matter stops trying to load missing recipes into the item table causing a nil issue later.
Original function from line 136
function repltech_item_table(item_table, category, prerequisites, overrides)
overrides = overrides or {}
local name = overrides.internal_name or
item_table[1].overrides.internal_name or item_table[1].name
repl_table[name] = {
name = name,
category = repltypes[category],
items = item_table,
prerequisites = replsub_prereq(prerequisites),
overrides = overrides,
from = "repltech_item_table",
}
end
Replacement function:
function repltech_item_table(item_table, category, prerequisites, overrides)
overrides = overrides or {}
if not item_table or not item_table[1] then
log("DMR: repltech_item_table skipped because item_table is empty or nil")
return nil
end
local first_item = item_table[1]
local first_overrides = first_item.overrides or {}
local name = overrides.internal_name or first_overrides.internal_name or first_item.name
if not name then
log("DMR: repltech_item_table skipped because no valid name could be determined")
return nil
end
repl_table[name] = {
name = name,
category = repltypes[category],
items = item_table,
prerequisites = replsub_prereq(prerequisites),
overrides = overrides,
from = "repltech_item_table",
}
return repl_table[name]
end