Jump to content

Recommended Posts

I was trying to do this, too. I found in scripts/constants.lua FOODTYPE and FOODGROUP are defined. I tried to create my own FOODGROUP types using the same format, but it did not work.

I think it did work when I passed individual foodtypes into it, but I can't remember if that actually worked or not, and i'm not home to try it right now...

What I do remember is FOODTYPE basically just defines string constants, so you can try this and see if it works:

inst:AddComponent("eater")
inst.components.eater:SetDiet( { "MEAT", "BERRIES" }, { "MEAT", "BERRIES" }) -- it can eat meat, and berries... berries are included in the VEGGIE type, but they also have their own type for birds
inst.components.eater.strongstomach = true -- can eat monster meat

It's probably better to use the FOODTYPE.MEAT and FOODTYPE.BERRIES constants, but I'm a LUA retard and I still don't understand LUA. When I try to require "constants" I still can't access the constants and the game crashes on me.

     

Quote

" inst:AddComponent("sanityaura")
    inst.components.sanityaura.aura = TUNING.SANITYAURA_SMALL
    
    inst.components.eater.strongstomach = true
    inst.components.eater:SetDiet( { FOODGROUP.OMNI }, { FOODTYPE.MEAT, FOODTYPE.MONSTERMEAT, FOODTYPE.GENERIC } )
        inst:AddComponent("eater")
    inst.components.eater:SetDiet( { "FOODTYPE.MEAT", "FOODTYPE.VEGGIE" }, { "FOODTYPE.MEAT", "FOODTYPE.VEGGIE" }) "

here what i have but in game i can only enspec the the food

i dont know how to put it in that text u guys have 

 

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