Darkbite98 Posted June 13, 2016 Share Posted June 13, 2016 i need help makeing it where my character only eats meet and barries and can eat monstermeet with no down side of it Link to comment Share on other sites More sharing options...
HomShaBom Posted June 13, 2016 Share Posted June 13, 2016 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. Link to comment Share on other sites More sharing options...
Darkbite98 Posted June 13, 2016 Author Share Posted June 13, 2016 do i add this in the prefabs for the character Link to comment Share on other sites More sharing options...
HomShaBom Posted June 13, 2016 Share Posted June 13, 2016 Yes. And you can look at wigfrid's prefab (it might be called something weird like wathgrithr.lua) to see how her diet is restricted to meat (and copy that, but also include berries), and look at webber's prefab to see how monster meat doesn't hurt him. Link to comment Share on other sites More sharing options...
Darkbite98 Posted June 13, 2016 Author Share Posted June 13, 2016 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 Link to comment Share on other sites More sharing options...
HomShaBom Posted June 15, 2016 Share Posted June 15, 2016 inst:AddComponent("eater") inst.components.eater.strongstomach = true inst.components.eater:SetDiet( { FOODTYPE.MEAT, FOODTYPE.BERRY }, { FOODTYPE.MEAT, FOODTYPE.BERRY } ) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now