Jump to content

Where might the function that makes 3 jelly beans come from crock pot when cooked be stored?


Recommended Posts

I know that the variable that sets it to 3 is stored in preparedfoods.lua is "stacksize", which is set to 3, however the function that uses this to make it so that three jelly beans come out of crock pot when they finish cooking is something I can't find anywhere. To my knowledge, it wasn't in edible.lua or crockpot.lua. You do have a special function in preparedfoods.lua for the jellybeans stat table, which looks like this:

if eater.components.debuffable ~= nil and
  not (eater.components.health ~= nil and
  	eater.components.health:IsDead()) and
  not eater:HasTag("playerghost") then
  eater.components.debuffable:RemoveDebuff("healthregenbuff")
  eater.components.debuffable:AddDebuff("healthregenbuff", "healthregenbuff")
end

but it seems like it has more to do with the health healing of 2 per 2 seconds rather than providing 3 jelly beans in crock pot upon it finishing cooking.

Link to comment
Share on other sites

21 minutes ago, EuedeAdodooedoe said:

I know that the variable that sets it to 3 is stored in preparedfoods.lua is "stacksize", which is set to 3, however the function that uses this to make it so that three jelly beans come out of crock pot when they finish cooking is something I can't find anywhere. To my knowledge, it wasn't in edible.lua or crockpot.lua

data/scripts/components/stewer.lua:266-270::

local recipe = cooking.GetRecipe(self.inst.prefab, self.product)
local stacksize = recipe and recipe.stacksize or 1
if stacksize > 1 then
    loot.components.stackable:SetStackSize(stacksize)
end

From: function Stewer:Harvest(harvester)

Link to comment
Share on other sites

@CarlZalph any idea as to how I could make it so that this function works for other cooking recipes? For instance, I added this in a new file of my mod (and yes, I have declared in modmain.lua to import the file's code into it) for taffy:

table.insert(recipes.taffy, stacksize)
recipes.butterflymuffin.stacksize = 4

And I was hoping that when cooking up taffy, it would give me 4, but when I tested it, I only got 1 :(

I assumed that that's all it would take to make it work for other recipes as well, since the code seems to be written for crockpot recipes in general and not just specifically for jelly beans, so I'm confused as to why this isn't working for taffy...

Link to comment
Share on other sites

1 hour ago, Lumina said:

table.insert(recipes.taffy, stacksize)
recipes.butterflymuffin.stacksize = 4

Why this is for taffy first and butterflymuffin after ?

Oh... Dumb me XD, I had done the same thing for butter muffin, but since the priority was set to one for it at the time, the recipe I had given for butter muffins resulted in always being blocked by waffles 100%. I guess this answers my question, I'll fix it tomorrow and if it works, I'll let you know by lik ing yer post :)

Edited by EuedeAdodooedoe
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...