Jump to content

Foodtypes


Recommended Posts

I somehow magically found out what you were trying to accomplish via my telepathic capabilities and so I bring you this:

AddPrefabPostInit("put_the_name_of_your_furry_character_mod's_prefab_name_here",function(inst)
	if inst.components.eater~=nil then
		local _TestFood_Old = inst.components.eater.TestFood or (function() return end)
		inst.components.eater.TestFood = function(self,food,testvalues)
			if food:HasTag("honeyed") then
				return true
			end
			return false
			--return _TestFood_Old(self,food,testvalues)
		end
	end
end)

 

Link to comment
Share on other sites

FOODTYPE is a global table defined in constants.lua

FOODTYPE =
{
    GENERIC = "GENERIC",
    MEAT = "MEAT",
    WOOD = "WOOD",
    VEGGIE = "VEGGIE",
    ELEMENTAL = "ELEMENTAL",
    GEARS = "GEARS",
    HORRIBLE = "HORRIBLE",
    INSECT = "INSECT",
    SEEDS = "SEEDS",
    BERRY = "BERRY", --hack for smallbird; berries are actually part of veggie
    RAW = "RAW", -- things which some animals can eat off the ground, but players need to cook
    BURNT = "BURNT", --For lavae.
    ROUGHAGE = "ROUGHAGE",
    GOODIES = "GOODIES",
}

 

to add a custom food type, simply

GLOBAL.FOODTYPE.MYFOODTYPE="MYFOODTYPE"

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