Dezzy Posted August 31, 2017 Share Posted August 31, 2017 I'm close to finishing up my character mod for DTS and the last thing I want to give my character for her final perk is that she will straight up refuse to eat stale and spoiled food. I figure the way of getting it to work would be mess with Wigfred's code (since she only eats meat) but i have little experience in coding and can't get it to work properly. Thank you in advance! 1 Link to comment https://forums.kleientertainment.com/forums/topic/81601-character-mod-help-refusing-to-eat-stalespoiled-food/ Share on other sites More sharing options...
waw Posted September 1, 2017 Share Posted September 1, 2017 AddPrefabPostInit("customchar", function(inst) if inst.components.eater then local Old_CanEat = inst.components.eater.CanEat function inst.components.eater:CanEat(food, ...) return food.components.perishable and not (food.components.perishable:IsStale() or food.components.perishable:IsSpoiled()) and Old_CanEat(self, food, ...) end end end) Link to comment https://forums.kleientertainment.com/forums/topic/81601-character-mod-help-refusing-to-eat-stalespoiled-food/#findComment-949622 Share on other sites More sharing options...
Nicodesu Posted July 18, 2025 Share Posted July 18, 2025 On 9/2/2017 at 6:43 AM, waw said: AddPrefabPostInit("customchar", function(inst) if inst.components.eater then local Old_CanEat = inst.components.eater.CanEat function inst.components.eater:CanEat(food, ...) return food.components.perishable and not (food.components.perishable:IsStale() or food.components.perishable:IsSpoiled()) and Old_CanEat(self, food, ...) end end end) Do me have to change "customchar" into character name too? (´・ω・`) Link to comment https://forums.kleientertainment.com/forums/topic/81601-character-mod-help-refusing-to-eat-stalespoiled-food/#findComment-1827181 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