Jump to content

making spoiled seeds disappear


Recommended Posts

hello i just want to know if there is a mod or an option to make the seeds disappear when they spoil and not turn into rot, because all the rotten seeds around the world make my world lag after a certain time (since i have a potato pc)

that's it, if there is a way to make spoiled seeds disappear i will be very grateful to know how to do it

have a good day

edit : i got how to do it thanks

Edited by -Dan0-
Link to comment
Share on other sites

On 4/21/2021 at 2:21 PM, --- -.- said:

this in prefabpostinit to them would make it disappear when it rot

inst.components.perishable:SetOnPerishFn(inst.Remove)

how do i do this exactly ?

I'm sorry I'm not too familiar with the game files, can you give me more details please 

Link to comment
Share on other sites

55 minutes ago, -Dan0- said:

how do i do this exactly ?

I'm sorry I'm not too familiar with the game files, can you give me more details please 

in your modmain.lua of your mod post this code

AddPrefabPostInit("seeds", function(inst)
	if inst.components.perishable ~= nil then inst.components.perishable:SetOnPerishFn(inst.Remove) end
end)

 

Link to comment
Share on other sites

6 minutes ago, --- -.- said:

in your modmain.lua of your mod post this code


AddPrefabPostInit("seeds", function(inst)
	if inst.components.perishable ~= nil then inst.components.perishable:SetOnPerishFn(inst.Remove) end
end)

 

okay got it ! thanks a lot i really appreciate it !

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...