Jump to content

Need help disabling world regrowth


Recommended Posts

I made a mod to disable world regrowth, which is a feature that spawns trees and other things in the world. There's a world generation option to change the intensity, but the lowest setting is "Very slow". All I did was this:

local TUNING = GLOBAL.TUNING

TUNING.REGROWTH_TIME_MULTIPLIER = 0

And it seemed it was working fine, until someone told me they still had a few trees spawning. So I went to test it and the component "desolationspawner" could still spawn trees. This was my solution:

local TUNING = GLOBAL.TUNING

TUNING.REGROWTH_TIME_MULTIPLIER = 0

TUNING.EVERGREEN_REGROWTH.DESOLATION_RESPAWN_TIME = 0
TUNING.EVERGREEN_SPARSE_REGROWTH.DESOLATION_RESPAWN_TIME = 0
TUNING.TWIGGY_TREE_REGROWTH.DESOLATION_RESPAWN_TIME = 0
TUNING.DECIDUOUS_REGROWTH.DESOLATION_RESPAWN_TIME = 0
TUNING.MUSHTREE_REGROWTH.DESOLATION_RESPAWN_TIME = 0

After more testing, this solution seemed to stop trees from spawning everywhere in the world, but I noticed some trees were still spawning and always in the same area too. I suspected "plantregrowth" was the cause and I tried to disable it in a similar way:

local TUNING = GLOBAL.TUNING

TUNING.REGROWTH_TIME_MULTIPLIER = 0

-- Evergreens
TUNING.EVERGREEN_REGROWTH.DESOLATION_RESPAWN_TIME = 0
TUNING.EVERGREEN_REGROWTH.OFFSPRING_TIME = 0

-- Lumpy evergreens
TUNING.EVERGREEN_SPARSE_REGROWTH.DESOLATION_RESPAWN_TIME = 0
TUNING.EVERGREEN_SPARSE_REGROWTH.OFFSPRING_TIME = 0

-- Twiggy trees
TUNING.TWIGGY_TREE_REGROWTH.DESOLATION_RESPAWN_TIME = 0
TUNING.TWIGGY_TREE_REGROWTH.OFFSPRING_TIME = 0

-- Deciduous trees
TUNING.DECIDUOUS_REGROWTH.DESOLATION_RESPAWN_TIME = 0
TUNING.DECIDUOUS_REGROWTH.OFFSPRING_TIME = 0

-- Mushtrees
TUNING.MUSHTREE_REGROWTH.DESOLATION_RESPAWN_TIME = 0
TUNING.MUSHTREE_REGROWTH.OFFSPRING_TIME = 0

Unfortunately it doesn't look like this worked, trees are still spawning the same way. I'm not good at modding, I'm surprised I even managed to get this far and right now I have no idea how to fix this problem. Is anyone able to help me? My goal is to disable any plant (or even rabbit holes) from respawning in the world.

Link to comment
Share on other sites

You can nuke those components via replacing them with your mod with files with empty classes.

e.g mymod/scripts/components/desolationspawner.lua:

return Class(function(self, inst)
	self.inst = inst
end)

Or you can nuke the constructors from modmain:

GLOBAL.require("components/desolationspawner")._ctor = function() end
GLOBAL.require("components/regrowthmanager")._ctor = function() end

Since the components aren't referenced anywhere beyond AddComponent functions, you are good to go.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
  • Create New...