Hial Posted November 19, 2014 Share Posted November 19, 2014 hi is my first time modding a character in Don't Starve,I saw a lot of tutorials and started programing, but...I'd like to know if it's possible to do something such specific as"loose sanity if, not having a shovel in the inventory" how can I do that? is that even possible?if you could help me I would appreciate a lot thanks for the help!! Link to comment https://forums.kleientertainment.com/forums/topic/44493-a-little-help-custom-character-programing/ Share on other sites More sharing options...
seronis Posted November 19, 2014 Share Posted November 19, 2014 1. run a timer2. check inventory for presence (or lack) of shovel3. adjust stats Link to comment https://forums.kleientertainment.com/forums/topic/44493-a-little-help-custom-character-programing/#findComment-570942 Share on other sites More sharing options...
Mobbstar Posted November 19, 2014 Share Posted November 19, 2014 In your player data, you should have a "local function fn()" which has an "end" at its ...end, unsuprisingly. Put something like this into that function, ideally near the end:inst.components.sanity.custom_rate_fn = function(inst) if not inst.components.inventory:Has("shovel") then return -.5 --this is the rate at which the guy goes mad (additional to normal rate) endendI haven't tested that myself, so it may have a syntax error or something. Serionis' method is more complicated than it needs to be, but it should work too Link to comment https://forums.kleientertainment.com/forums/topic/44493-a-little-help-custom-character-programing/#findComment-571035 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