Only just found out about this mod and was wondering if it'd possible to add something like flib_technology.is_researchable(technology). I have a very small mod and had to "implement" (I copied it from another mod) this, however, it only kind of works, since some technologies don't list all of their prerequisites (for example, the weapon damage and speed improvements don't list them all so the graph doesn't get cluttered) it's possible that this returns true when really the technology cannot be researched.
local flib_technology.is_researchable(technology)
if (not technology.enabled) or technology.researched then
return false
end
for _, prerequisite in pairs(technology.prerequisites) do
if not prerequisite.researched then
return false
end
end
return true
end
I'm sure this could be improved, however, I don't have enough understanding of the Factorio data structures to know how to make those improvements.
Only just found out about this mod and was wondering if it'd possible to add something like
flib_technology.is_researchable(technology)
. I have a very small mod and had to "implement" (I copied it from another mod) this, however, it only kind of works, since some technologies don't list all of their prerequisites (for example, the weapon damage and speed improvements don't list them all so the graph doesn't get cluttered) it's possible that this returnstrue
when really the technology cannot be researched.I'm sure this could be improved, however, I don't have enough understanding of the Factorio data structures to know how to make those improvements.