Jump to content

Recommended Posts

I have a mod which adds some food recipes to the cookpot item (crock pot)

The mod works fine, however when an item is cooked in warly's portable cookpot, the finished product is invisible until harvested.

I found a solution for this problem by  adding the recipes separately to the portablecookpot (see code below)

Spoiler

    for k,v in pairs(waiterfoods) do
        v.name = k
        v.weight = v.weight or 1
        v.priority = v.priority or 0
    end
          
    for k,recipe in pairs(waiterfoods) do
        AddCookerRecipe("cookpot", recipe) -- Add All 'waiterfoods' to cookpot
        AddCookerRecipe("portablecookpot", recipe) -- Add All 'waiterfoods' to portablecookpot
    end

However this causes a new problem...

Within the game's stewer.lua is a bit of code that assigns priority to Warly's portablecookpot recipes

Spoiler

    -- stuff to make warly's special recipes possible
    self.specialcookername = nil    -- a special cookername to check first before falling back to cookername default
    self.productcooker = nil        -- hold on to the cookername that is cooking the current product

What this means is, no matter what the priority value of the food, recipes added to the portablecookpot have a higher priority

The result is, when I add recipes to be cooked in Warly's pot, it becomes impossible to cook some other base game recipes because they not prioritized correctly. (eg. I have a priority 1 recipe that uses eggs, but in warlys pot it takes priority over  the 'perogi' or 'bacon and eggs recipe', which should have higher priority)
They work fine in the normal cookpot,

Does anyone have an idea to fix this?

Ideally the best solution would be to fix the problem with a modded item (within the cookpot recipes) that is cooked in warly's portable cookpot being visible

But I have no idea how to make that happen.

 

 

 

Edited by MidrealmDM
clarify issue
Link to comment
https://forums.kleientertainment.com/forums/topic/81066-problem-with-cooking/
Share on other sites

Just to Verify my theory-
I went into the stewer.lua and disabled the following (around line 117)

Spoiler

            if self.specialcookername then
                -- check special first
                if cooking.ValidRecipe(self.specialcookername, ings) then
                    self.product, cooktime = cooking.CalculateRecipe(self.specialcookername, ings)
                    self.productcooker = self.specialcookername
                    foundthespecial = true
                end
            end

After doing that it solved the problem with the priority of the foods, but also made it impossible for Warly to cook his special recipes.

So to sum up:

Without using
        AddCookerRecipe("portablecookpot", recipe)
The finished foods are cookable, but invisible in the crock pot

But if I use do add the recipe to the portablecookpot, all the modded recipes take priority over non modded recipes regardless of priority value. However, If I disable the feature that makes the Warly's portable cook pot recipes have priority,  then some or all of Warly's recipes seem to become uncookable. (eg trying to make Monster Tartare results in Monster Lasagna)

So my choices are currently one of the following :
A> Invisible food,
B> Screwed up priority, or
C> Warly loses some special foods (assuming I could find a way to have the mod disable the prioritizing code above)

Any advice someone has would be appreciated

P.S. I do still have the old Cookpot fix.lua that was made to solve the same graphical glitch in the original crock pot before Klei corrected the issue themselves. But since I don't know lua that well, I haven't been able to have it affect Warly's cookpot.

 

 

Edited by MidrealmDM
On 8/6/2017 at 10:43 PM, MidrealmDM said:
  Reveal hidden contents

            if self.specialcookername then
                -- check special first
                if cooking.ValidRecipe(self.specialcookername, ings) then
                    self.product, cooktime = cooking.CalculateRecipe(self.specialcookername, ings)
                    self.productcooker = self.specialcookername
                    foundthespecial = true
                end
            end

But if I use do add the recipe to the portablecookpot, all the modded recipes take priority over non modded recipes regardless of priority value. However, If I disable the feature that makes the Warly's portable cook pot recipes have priority,  then some or all of Warly's recipes seem to become uncookable. (eg trying to make Monster Tartare results in Monster Lasagna)

 

One other option that might work, is to add all of the normal DS foods to the portablecookpot.
(currently the game checks the portable recipes first, and then check the regular crock pot recipes, this would put ALL the recipes into the portable crock pot, making the need to check the normal crock pot unneccessary, and all foods would resolve properly by priority)

by manually adding the following to the preparedfoods.lua script the probelm was solved.

Spoiler

 

for k,recipe in pairs(foods) do
    AddCookerRecipe("portablecookpot", recipe)
end


 

However I lack the knowledge needed to have the mod do this.

Anyone skilled in lua programming out there who knows how to make this happen?

 

Edited by MidrealmDM

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