Infinite Resources


Makes all resources infinite.

Tweaks
2 months ago
0.17 - 2.0
56.9K
Cheats

g Disabling mod causes ores to deplete?

a month ago

I mistakenly enabled the mod in a specific game I wasn't planning to enable infinite resources and played several minutes (don't have a save file of game without mod enabled). When I realized the mistake and disabled the mod later, all the resource patches (even ones I hadn't touched yet) had depleted drastically. Is this expected and is there a way to bring them back to initial levels?

a month ago

Yes, even after deleting the mod, the save file is still corrupted. It's really frustrating.

a month ago

I found a console script that will regenerate all resources (on the planet you're currently on). It's adapted from this one on the Wiki (fixed an error since the API changed in 2.0).

/c local surface = game.player.surface
for _, e in pairs(surface.find_entities_filtered{type="resource"}) do
  if e.prototype.infinite_resource then
    e.amount = e.initial_amount
  else
    e.destroy()
  end
end
local non_infinites = {}
for resource, prototype in pairs(prototypes.get_entity_filtered{{filter="type", type="resource"}}) do
  if not prototype.infinite_resource then
    table.insert(non_infinites, resource)
  end
end
surface.regenerate_entity(non_infinites)
for _, e in pairs(surface.find_entities_filtered{type="mining-drill"}) do
    e.update_connections()
end

Running that will disable achievements for your save unfortunately. I'm not sure there's much I can do about it from my mod, it's not like I can have it run something when you remove it. The mod makes a permanent change to the worldgen so it's not really intended to be disabled.

New response