johnfs723 Posted June 26, 2015 Share Posted June 26, 2015 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 https://forums.kleientertainment.com/forums/topic/55681-help-with-my-first-character-mod/ Share on other sites More sharing options...
Seiai Posted June 26, 2015 Share Posted June 26, 2015 (edited) @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 June 26, 2015 by Seiai Link to comment https://forums.kleientertainment.com/forums/topic/55681-help-with-my-first-character-mod/#findComment-650096 Share on other sites More sharing options...
johnfs723 Posted June 27, 2015 Author Share Posted June 27, 2015 @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 https://forums.kleientertainment.com/forums/topic/55681-help-with-my-first-character-mod/#findComment-650388 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