Flarefox Posted January 13, 2015 Share Posted January 13, 2015 I been dealing with this for a good while, and I tried many times, and always get an crash. When it doesn't carsh it didn't really do what I wanted.Few things I did figure out it was pretty simple, and from other mod characters. But the things I want to do I can't seem to find an character do the same thing, or just plainly not possible, (or very complex to.)What I'm doing firstly, is trying to have my character eat berries. I have done the foodpref on foodgroup/type on seeds, berries, and meats. it works perfectly, but my character can't eat berries. I look on data to said to addtag "edible" to berries, since they are consider an veggie. But I am not sure where to add this tag, and/or so.2ndly I wanted to gain sanity from foods. I preferring want it berries, but I be fine if it works on any kind of food. I work around, it doesn't crash but it doesn't give the results.And last one was to see if I can keep my character from ever getting cold. supposedly winter is in mutiplayer now, (though for some reason the world refuses to go into winter..maybe not in yet or I'm having issues) Link to comment https://forums.kleientertainment.com/forums/topic/49075-help-on-food-and-temperature-for-mod-character-muti/ Share on other sites More sharing options...
Ryuushu Posted January 13, 2015 Share Posted January 13, 2015 (edited) @Flarefox-------------- mycharacter, master_postinit -------------------------------------------------- -- Only eat berries and meat. inst.components.eater.foodprefs = { FOODTYPE.BERRY, FOODTYPE.MEAT } inst:AddTag(FOODTYPE.BERRY.."_eater") -- Based on rezecib's code, gain sanity when eating berries. local OldEat = inst.components.eater.Eat inst.components.eater.Eat = function(self, food) if self:CanEat(food) and food.prefab:find("berries") then food.components.edible.sanityvalue = food.components.edible.sanityvalue + 50 end return OldEat(self,food) end -- No more freezing inst.components.temperature.mintemp = 20-------------------- modmain -------------------------------------------AddPrefabPostInit("berries", function(inst) inst:AddTag("edible_"..GLOBAL.FOODTYPE.BERRY)end)-- Smallbirds are now able to eat roasted berries >>;AddPrefabPostInit("berries_cooked", function(inst) inst:AddTag("edible_"..GLOBAL.FOODTYPE.BERRY)end) Edited January 13, 2015 by Ryuushu Link to comment https://forums.kleientertainment.com/forums/topic/49075-help-on-food-and-temperature-for-mod-character-muti/#findComment-601540 Share on other sites More sharing options...
Flarefox Posted January 13, 2015 Author Share Posted January 13, 2015 Thank you, but where in the main mod I need to put the other half? I am not sure where the proper placement. Link to comment https://forums.kleientertainment.com/forums/topic/49075-help-on-food-and-temperature-for-mod-character-muti/#findComment-601565 Share on other sites More sharing options...
Ryuushu Posted January 13, 2015 Share Posted January 13, 2015 @FlarefoxAnywhere, really. If you are still unsure put it at the end. Link to comment https://forums.kleientertainment.com/forums/topic/49075-help-on-food-and-temperature-for-mod-character-muti/#findComment-601585 Share on other sites More sharing options...
Flarefox Posted January 13, 2015 Author Share Posted January 13, 2015 After the fix infor on global, and find the location(decided to use other modds location for edibles) it work like an charm. ty! Link to comment https://forums.kleientertainment.com/forums/topic/49075-help-on-food-and-temperature-for-mod-character-muti/#findComment-601587 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