RePainter-Zenorbi

by Zenorbi

Re-paints the old terrain using current map generation. Based on fienxjox's work.

Tweaks
5 years ago
0.17
6

g Why control.lua and not migrations?

5 years ago

Is there a particular reason you didn't put this code into a migration script so it only runs once per save should players forget to disable it?

5 years ago

A sort of hidden trait to this mod is that if you fill in a lake using landfills and you don't like your green grassy tiles in the middle of your desert, you can re-run this to fix it. Also to be honest I didn't know about the migrations. I just modified fienxjox's work.

5 years ago
(updated 5 years ago)

If I'm not mistaken saves only remember migration scripts from active mods.
Saving with a disabled mod should result in all it's migration scripts running again after re-enabling it.

For filling lakes I'd use Nice-Fill (uses temporary surface technique as well) instead of resetting every chunk.

Bonus Questions:
did you account for player placed floor tiles?
does your mod update decoratives, trees and cliffs?
Seems like you do, just a bit differently than your code implies. Decoratives are spawned even if floor tiles are present.
Cliffs and Trees seem untouched. Would be neat to have those regenerated to get rid of lush forests in deserts.

PPS:
One small drawback, migration scripts run while the loading screen shows, so you can't print progress to console anymore.

5 years ago

I was thinking about regenerating forests as well, but what if your factory is in a forest according to the new generation. Might be cool looking to have trees at every single empty area, but it would get really annoying. Cliffs would be the same thing.

5 years ago
(updated 5 years ago)

Cliffs and trees collide with player built structures. All you'd have to do is check with can_place_entity if something exists in that spot. https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.can_place_entity

I think cliffs are connected entities like walls so you might have to force reconnect so they connect properly.

New response