Jump to content

Recommended Posts

I'd like to know if is possible to make the following itens unperishable:

honey

batilisk wing

brainy matter

bramble bulb

butter

butterfly wings

koalefant trunks

glowberry

light bulb

lichen

limpets

coffee beans

coconut

crop seeds

seeds

mussel

petals

powdercake

preety parasol

fashion mellon

royal jelly

floral shirt

flytrap stalks

garland

glommer flower

tea

coffee

ham bat

tropical parasol

ice cube

iced tea

wet goop

 

I use all dlc for dont starve + a mod for having the bee queen, thus askinf for the royal jelly too

 

--Yes.  c:  Put this in your modmain.lua.  It makes honey non-perishable. 

--making things perishable
local function RemovePerishablePostInit(inst)
    inst:RemoveComponent("perishable")
end

AddPrefabPostInit("honey", RemovePerishablePostInit)

--[[
Now for every other prefab you want to make perishable, call this function again, but replace the word in quotes with the prefab name of the perishable item.  You can get the prefab name of the item in the Don't Starve Wiki.
]]

--this is for the garland
AddPrefabPostInit("flowerhat", RemovePerishablePostInit)

Here's a nice way of setting up changing many prefabs using the same code:

local prefabs_to_alter =
{ 
	"honey",
	"corn",
}

for i, v in ipairs(prefabs_to_alter) do
	AddPrefabPostInit(v, function(inst)
		if inst.components.perishable then
			inst:RemoveComponent("perishable")
		end
	end)
end

 

Edited by Ultroman

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
×
  • Create New...