Jump to content

Recommended Posts

So,

I am confused on how to make a character not only a carnivore, but also have sanity gain from raw meats.

 

I know to make it consume just meat(and some other things), I have to do something like

//in scripts/prefabs/webber.luainst.components.eater.foodprefs = { "MEAT", "SEEDS", "GENERIC" }

But how do I make my character say a string when the player tries eating  something not in their diet without consuming it?

  • Developer

So,

I am confused on how to make a character not only a carnivore, but also have sanity gain from raw meats.

 

I know to make it consume just meat(and some other things), I have to do something like

//in scripts/prefabs/webber.luainst.components.eater.foodprefs = { "MEAT", "SEEDS", "GENERIC" }

But how do I make my character say a string when the player tries eating  something not in their diet without consuming it?

Try using the 'Eater:SetCanEatTestFn' to write your own test to see if you can eat the item and if not, have the player say something.

I've made a carnivore character before.

I put this component in the stats section of his prefab.

The lines are to represent the health, sanity, tags, etc.

 

    --Stats
-------

----------------------

---------------------

--------------------------

--------------------------

--Carnivore, can only eat meat. Can Eat Monster Meat.
    inst.components.eater:SetCarnivore()
    inst.components.eater.strongstomach = true

 

 

Sorry for the lousy, errh... layout? Damn, I'm stupid today.

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...