Jump to content

Recommended Posts

I would like to make it Warly get a small amount of sanity, and maybe says some random quote every time he starts cooking in his portable crockpot. I have no idea how to do this, so I haven't tried anything. How would I go about doing this?

Edited by decduck3

You can probably alter the COOK action (like this: GLOBAL.ACTIONS.COOK.fn = function(act)) and add an additional check. Store the original function to a variable, run your own check to see if the stewer's prefab is Warly, if it passes, do a delta to the act.target.components.stewer sanity, and then at the end (outside that Warly check, or else only Warly will be allowed to cook), call the original cook function so that it runs the rest of the code normally. I'll attach an example of something like this from my torch cooking mod. There also happens a be a speech adjustment in this file, that might also help you figure out how to make only Warly say something when the action succeeds.

Also this file is fairly small, so don't worry about having to look through some inexplicably long file to find a simple solution :wilson_smile:

modmain.lua

Could I override just the portable crockpot's cook function, so he doesn't get the sanity when using a normal crockpot, or should I check it in the cook function, if he is using his portable crockpot?

Edited by decduck3

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