DecDuck Posted August 5, 2020 Share Posted August 5, 2020 (edited) 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 August 9, 2020 by decduck3 Link to comment https://forums.kleientertainment.com/forums/topic/120722-action-on-start-crockpot-cooking/ Share on other sites More sharing options...
rawii22 Posted August 6, 2020 Share Posted August 6, 2020 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 modmain.lua Link to comment https://forums.kleientertainment.com/forums/topic/120722-action-on-start-crockpot-cooking/#findComment-1360440 Share on other sites More sharing options...
DecDuck Posted August 7, 2020 Author Share Posted August 7, 2020 (edited) 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 August 7, 2020 by decduck3 Link to comment https://forums.kleientertainment.com/forums/topic/120722-action-on-start-crockpot-cooking/#findComment-1360954 Share on other sites More sharing options...
rawii22 Posted August 16, 2020 Share Posted August 16, 2020 Yeah, you can check the prefab of what's doing the cooking Link to comment https://forums.kleientertainment.com/forums/topic/120722-action-on-start-crockpot-cooking/#findComment-1363170 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