NeoPurpleFire Posted March 20, 2023 Share Posted March 20, 2023 I've looked through Wigfrid's code and tried that, to no luck, I've looked all over the forums and everything I tried hasn't worked, I tried to look online for the tags for the food groups to re-try the Wigfrid technique, to find that I don't know what the tags are for the food groups or how to find them, I've come to the conclusion I'm out of my depths (no pun intended) and perhaps someone else might have the right f-eel-ing (pun entirely intended) on how I can accomplish what I am trying to accomplish It's rather simple really, all I want is a way to make it so my character will not eat any fish related item, so if you know how to, please, help me, much thanks! Link to comment https://forums.kleientertainment.com/forums/topic/146633-anyone-know-how-to-make-a-custom-character-not-consume-fish/ Share on other sites More sharing options...
Rickzzs Posted March 20, 2023 Share Posted March 20, 2023 (edited) local TestFood=inst.components.eater.TestFood function inst.components.eater:TestFood(food, testvalues) return food is not fish and TestFood(self,food,testvalues) end local PrefersToEat=inst.components.eater.PrefersToEat function inst.components.eater:PrefersToEat(food) return food is not fish and PrefersToEat(self,food) end insert it into your character's masterinitfn, replace "food is not fish" with your own function Edited March 20, 2023 by Rickzzs Link to comment https://forums.kleientertainment.com/forums/topic/146633-anyone-know-how-to-make-a-custom-character-not-consume-fish/#findComment-1626412 Share on other sites More sharing options...
NeoPurpleFire Posted March 20, 2023 Author Share Posted March 20, 2023 (edited) 4 hours ago, Rickzzs said: local TestFood=inst.components.eater.TestFood function inst.components.eater:TestFood(food, testvalues) return food is not fish and TestFood(self,food,testvalues) end local PrefersToEat=inst.components.eater.PrefersToEat function inst.components.eater:PrefersToEat(food) return food is not fish and PrefersToEat(self,food) end insert it into your character's masterinitfn, replace "food is not fish" with your own function Thank you for your help, however I'm inexperienced, it's probable my own function part that's not making it work, which I don't really know what I need to get the code to function the way I want it to Quote  local nofish = {     "fish",     "fish_cooked",     "fishmeat_small",     "fishmeat_small_cooked",   }    local TestFood = inst.components.eater.TestFood   function inst.components.eater:TestFood(food, testvalues)     return nofish and TestFood(self,food,testvalues)   end   local PrefersToEat = inst.components.eater.PrefersToEat   function inst.components.eater:PrefersToEat(food)     return nofish and PrefersToEat(self,food)   end  I'm unsure if just putting the prefabs names would stop it but I'm still pretty lost Edited March 20, 2023 by NeoPurpleFire Link to comment https://forums.kleientertainment.com/forums/topic/146633-anyone-know-how-to-make-a-custom-character-not-consume-fish/#findComment-1626447 Share on other sites More sharing options...
Rickzzs Posted March 20, 2023 Share Posted March 20, 2023 (edited) for example, you need a function like not food:HasTag('fish') or not table.contains(allfish,food.prefab) with allfish={fish,fish_cooked} Edited March 20, 2023 by Rickzzs Link to comment https://forums.kleientertainment.com/forums/topic/146633-anyone-know-how-to-make-a-custom-character-not-consume-fish/#findComment-1626526 Share on other sites More sharing options...
NeoPurpleFire Posted March 22, 2023 Author Share Posted March 22, 2023 On 3/20/2023 at 11:36 PM, Rickzzs said: for example, you need a function like not food:HasTag('fish') or not table.contains(allfish,food.prefab) with allfish={fish,fish_cooked} I'm sorry to be a pain but I'm really struggling to figure out where to put everything, could you be a bit more specific about what goes where and where goes what Link to comment https://forums.kleientertainment.com/forums/topic/146633-anyone-know-how-to-make-a-custom-character-not-consume-fish/#findComment-1626698 Share on other sites More sharing options...
Rickzzs Posted March 23, 2023 Share Posted March 23, 2023 (edited) local TestFood=inst.components.eater.TestFood function inst.components.eater:TestFood(food, testvalues) return not food:HasTag("fish") and TestFood(self,food,testvalues) end local PrefersToEat=inst.components.eater.PrefersToEat function inst.components.eater:PrefersToEat(food) return not table.contains({"fish","fish_cooked"},food.prefab) and PrefersToEat(self,food) end Something like this. If you are not familar with Lua grammar or DST API you can learn it. Edited March 23, 2023 by Rickzzs Link to comment https://forums.kleientertainment.com/forums/topic/146633-anyone-know-how-to-make-a-custom-character-not-consume-fish/#findComment-1626833 Share on other sites More sharing options...
NeoPurpleFire Posted March 23, 2023 Author Share Posted March 23, 2023 15 hours ago, Rickzzs said: local TestFood=inst.components.eater.TestFood function inst.components.eater:TestFood(food, testvalues) return not food:HasTag("fish") and TestFood(self,food,testvalues) end local PrefersToEat=inst.components.eater.PrefersToEat function inst.components.eater:PrefersToEat(food) return not table.contains({"fish","fish_cooked"},food.prefab) and PrefersToEat(self,food) end Something like this. If you are not familar with Lua grammar or DST API you can learn it. Firstly, thank you for the help, it's working now which is just great, hopefully it's working for all the fish items I put in but I couldn't spawn some in to test it but that's something I can probable solve later on if it ends up not working Secondly I am trying to learn both, it's been a bit of a struggle haha, thank you again Link to comment https://forums.kleientertainment.com/forums/topic/146633-anyone-know-how-to-make-a-custom-character-not-consume-fish/#findComment-1626907 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