Jump to content

Recommended Posts

1 hour ago, MemphisMyst said:

Would anyone know if there is a null option that i could use for inst.components.eater:SetDiet? Cause if there is would that be able to work if i add nightmare fuel as a edible afterwards?

Would it work if i put this in modmain.lua

local FOODTYPE = GLOBAL.FOODTYPE
FOODTYPE.SHADOW = "SHADOW"

AddComponentPostInit("eater", function(self)
	function self:SetCanEatShadows()
		table.insert(self.preferseating, FOODTYPE.SHADOW)
		table.insert(self.caneat, FOODTYPE.SHADOW)
		self.inst:AddTag(FOODTYPE.SHADOW.."_eater")
	end
end)

AddPrefabPostInit("nightmarefuel", function(inst)
	if not GLOBAL.TheWorld.ismastersim then
		return inst
	end
	inst:AddComponent("edible")
	inst.components.edible.foodtype = FOODTYPE.SHADOW
	inst.components.edible.healthvalue = 5--CHANGE THESE 3 VALUES TO ANYTHING YOU WANT
	inst.components.edible.hungervalue = 10
	inst.components.edible.sanityvalue = 15
end)

and then this in my master_postinit

inst.components.eater:SetDiet({FOODGROUP.SHADOW})

Link to comment
Share on other sites

So i tried to get it to work but it happens to error out every time that I try to launch as the character. Would anyone be able to give me assistance with getting the character functional and make him only eat nightmare fuel? Thanks for any pointers that you may be able to assist with.

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