Jump to content

Recommended Posts

Hey guys. I'm struggling a bit to limit my character's diet to a herbivore. I've pretty much succeeded on it by now, using the code line " inst.components.eater:SetDiet({FOODGROUP.OMNI}, {FOODTYPE.VEGGIE, FOODTYPE.SEEDS, FOODTYPE.GENERIC}) "

 

It works perfectly... or almost. My character still eats butterfly wings.

How could i make my character to NOT eat those things? It makes no logical sense to leave it like it is by now xD

 

Ty.

Link to comment
https://forums.kleientertainment.com/forums/topic/73829-butterfly-wings/
Share on other sites

@diovbc

According to the butterflywings prefab file they're considered a veggie.

But this should be a workaround by hooking the eater component's PrefersToEat function in your character's master postinit or after the eater component is added.

local PrefersToEat_old = inst.components.eater.PrefersToEat
inst.components.eater.PrefersToEat = function(self, beingeaten, ...)
    if beingeaten.prefab=="butterflywings"
    then
        return false
    end
    return PrefersToEat_old(self, beingeaten, ...)
end

 

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...