Jump to content

How would you change crockpot cooking speed for a character?


Recommended Posts

I want to make a character that has their crock pot cooking time decrease every time they cook the same item in a row ( until a cap I set in the config )

How would I do this? I assume I would have to do something with the stewer component ( Maybe make a new crockpot object that has a different stewer component with different time? ), but I am new to DST modding ( First mod in fact, my friend is making the art )

Any help would be appreciated.I already got the base character done, I just need to finish this and something else

Link to comment
Share on other sites

From what I can see, the best point of entry would be in the cooking.lua code. There is this line in stewer.lua

self.product, cooktime = cooking.CalculateRecipe(self.inst.prefab, ings)

It returns the product first and the cooktime second. If you extend the CalculateRecipe function, you can alter the cooktime before it is returned. One problem is that that function does not have the player in its scope, so you have to get the player instance (I can't remember how in DST, but in DS it's GLOBAL.ThePlayer, I think), and then you can have your state on the player somehow. You have to keep a variable saying which recipe they last cooked and how many times they have cooked that recipe in a row, but I expect you can figure that part out. Let me know if you need more specifics.

If you're new to modding, you may find my newcomer post very helpful.

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