godzilly4 Posted July 6, 2021 Share Posted July 6, 2021 (edited) A friend and I have been working on making a custom character and one of the cons we want to add is eating food that isn't meat still restores hunger and can be consumed but takes away 4 hp and a pro we want to add is that eating restores 15 sanity Edited July 6, 2021 by godzilly4 Link to comment https://forums.kleientertainment.com/forums/topic/131605-need-help-with-modding/ Share on other sites More sharing options...
AkaiNight Posted July 7, 2021 Share Posted July 7, 2021 12 hours ago, godzilly4 said: A friend and I have been working on making a custom character and one of the cons we want to add is eating food that isn't meat still restores hunger and can be consumed but takes away 4 hp and a pro we want to add is that eating restores 15 sanity I am sure there is a better way to do this but if there is not you can change the vaules manually local function oneat(inst, food) if food and food.components.edible and food.prefab == "food_1" then inst.components.health:DoDelta(vaule) inst.components.sanity:DoDelta(vaule) inst.components.hunger:DoDelta(vaule) elseif food and food.components.edible and food.prefab == "food_2" then inst.components.health:DoDelta(vaule) inst.components.sanity:DoDelta(vaule) inst.components.hunger:DoDelta(vaule) end end put that in your character.lua. Change "food_1" with the food you want to edit and change vaules as you like. and put that in master_postinit inst.components.eater:SetOnEatFn(oneat) let me know if there is any error Link to comment https://forums.kleientertainment.com/forums/topic/131605-need-help-with-modding/#findComment-1476933 Share on other sites More sharing options...
Monti18 Posted July 7, 2021 Share Posted July 7, 2021 The problem is that you will need to add each food that you want to change there, which will be a lot of work. Have a look at this thread by Ultroman, he shows multiple ways to change the values of food to what you want: 2 Link to comment https://forums.kleientertainment.com/forums/topic/131605-need-help-with-modding/#findComment-1476944 Share on other sites More sharing options...
godzilly4 Posted July 14, 2021 Author Share Posted July 14, 2021 Spoiler Sorry for taking a while to respond! Managed to get it working! Thanks for the help! 1 Link to comment https://forums.kleientertainment.com/forums/topic/131605-need-help-with-modding/#findComment-1478404 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