Diversitree

by S6X

Randomizes planted trees to look more like natural forests.

Tweaks
22 days ago
2.0
1.05K
Factorio: Space Age Icon Space Age Mod
Environment

g Compatibility with Alien Biomes

2 months ago

Hiya! I got a bug report that trees cannot be planted on terrain from Alien Biomes. Technically modifying the set of tiles trees can be planted on should be handled by Alien Biomes itself, but AB's dev is on a minor hiatus. If you could update your code to not overwrite the changes done by my mod, I'd appreciate that so there's better compat between our two mods + AB :)

2 months ago

It's a little more complicated than that! This mod doesn't overwrite anything, really, but what it does do is create its own "s6xdvt-fake-tree" prototype, which is not going to get the changes you're making to tree-plant so it will seem like your changes are getting overwritten. I actually did it this way to avoid making lots of weird breaking changes to tree-plant because I thought that would be less likely to create problems for other mods, although it seems to have backfired a little in this case! For better compatibility between Diversitree and Early Agriculture (and other mods that change around tree-plant), I moved my own tree creation code from data to data-updates, which will grab the changes you're making to the growth times and mining yields of the trees.

This won't solve the issue with Alien Biomes out of the box, but the short answer is that if you add a line like this to data-final-fixes everything should work fine because you'll make your tile restriction changes to the prototype that's actually getting planted when Diversitree is active.

if mods["Diversitree"] then tree_plant = data.raw["plant"]["s6xdvt-fake-tree"] end
2 months ago

That makes a lot of sense and sounds great to me! I'll get that fix in tomorrow, and thanks for explaining the inner workings, this does indeed sound like a very good and clever precaution to avoid compatibility issue, we just ran into the one condition it backfires, and the fix is really easy even then. Good job!

2 months ago

any news for a quickfix ?

2 months ago
(updated 2 months ago)

I released a fix for this with Early Agriculture 0.9.4, should be good there :)

EDIT: This does not solve AB plantability without EA, if you're only asking about that

2 months ago

I would have liked a pâtch that corrects the initial problem, i.e. compatibility with alien biome.

New response