Cunning fox Posted November 25, 2016 Share Posted November 25, 2016 (edited) Hello everyone! I'm trying to add cannibal character. As far as I know, to set some kind of diet to character, you beed to add: inst.components.eater:SetDiet({ FOODGROUP.OMNI }, { FOODGROUP.CANNIBAL }) I'm adding a new food group with following code: FOODGROUP = GLOBAL.FOODGROUP FOODTYPE = GLOBAL.FOODTYPE FOODGROUP.CANNIBAL = { name = "CANNIBAL", types = { FOODTYPE.HUMAN } } But if I'm lauching server, character can't eat any food. What i'm doing wrong? Edited November 27, 2016 by makar5000 1 Link to comment Share on other sites More sharing options...
. . . Posted November 26, 2016 Share Posted November 26, 2016 (edited) Put this in your modmain.lua GLOBAL.FOODTYPE.CANNIBAL = "CANNIBAL" local cannibal = { "humanmeat", "humanmeat_cooked", "humanmeat_dried", } local function AddCannibal(inst) inst:AddTag("edible_"..GLOBAL.FOODTYPE.CANNIBAL) end for k,v in pairs(cannibal) do AddPrefabPostInit(v, AddCannibal) end and then put this in YOURCHARACTER.lua inside master_postinit inst.components.eater:SetDiet({ FOODTYPE.CANNIBAL }, { FOODTYPE.CANNIBAL }) I think this should work, I think ! Edited November 26, 2016 by SuperDavid Link to comment Share on other sites More sharing options...
Maris Posted November 27, 2016 Share Posted November 27, 2016 On 26 ноября 2016 г. at 0:22 AM, makar5000 said: FOODGROUP.CANNIBAL Nice idea. 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