Jump to content

Help with my first character mod....


Recommended Posts

This is my first character mod, and I'm kinda new to DST code, but.......

 

My character is a vegetarian and I want eating meat to lower his sanity. Is there a specific command/code I can use for each item I want to lower his sanity by, say, 50?

 

Thanks

Link to comment
Share on other sites

@johnfs723,

inst:ListenForEvent( "oneatsomething",  function(inst, data)   if data.food.prefab=="meat" then inst.components.sanity:DoDelta(-50)  end  end )
if u dont want to define specific penalties for specific types of meat, but just one penalty for all meat, use data.food:HasTag("meat") instead. see meats.lua in the gamecode for the types of meat and the tags u might want to use. Edited by Seiai
Link to comment
Share on other sites

@johnfs723,

inst:ListenForEvent( "oneatsomething",  function(inst, data)   if data.food.prefab=="meat" then inst.components.sanity:DoDelta(-50)  end  end )
if u dont want to define specific penalties for specific types of meat, but just one penalty for all meat, use data.food:HasTag("meat") instead. see meats.lua in the gamecode for the types of meat and the tags u might want to use.

 

 

thanks so much!!

 

Link to comment
Share on other sites

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
 Share

×
  • Create New...