Jump to content

How to add custom crock pot recipe?


Recommended Posts

I copied some code from "Waiter 101 Together" (http://steamcommunity.com/sharedfiles/filedetails/?id=381565292&searchtext=crock) but mine crashes when clicking [Predict] (I have Smarter Crock Pot mod).

 

Log:

...

[01:25:23]: [string "../mods/workshop-365119238/scripts/componen..."]:178: attempt to index local 'loot' (a nil value)
LUA ERROR stack traceback:
../mods/workshop-365119238/scripts/components/predicter.lua:178 in (method) Predict (Lua) <162-191>
...
 
My code inside modmain.lua:
AddIngredientValues({"cutgrass"}, {mycrockpotrecipe=.5})
AddIngredientValues({"petals"}, {mycrockpotrecipe=.5})
AddIngredientValues({"twigs"}, {mycrockpotrecipe=.5})
AddIngredientValues({"boards"}, {mycrockpotrecipe=1})
 
local wooddeluxe_recipe = {
name = "wooddeluxe",
test = function(cooker, names, tags) return tags.mycrockpotrecipe end,
priority = 1,
weight = 1,
foodtype = "MYCHARFOOD",
health = TUNING.HEALING_MEDSMALL,
hunger = TUNING.CALORIES_MED*2,
perishtime = TUNING.PERISH_MED, --how to make it not perishable?
sanity = TUNING.SANITY_MED,
cooktime = 1,
}
AddCookerRecipe("cookpot", wooddeluxe_recipe)
 
I did forget to provide the tex file.
Let me try that again...
Edit: Provided tex, still crashes. Need help.
 
Question: is it possible to make this "wooddeluxe" unperishable?
Edited by SenL
Link to comment
Share on other sites

 

I copied some code from "Waiter 101 Together" (http://steamcommunity.com/sharedfiles/filedetails/?id=381565292&searchtext=crock) but mine crashes when clicking [Predict] (I have Smarter Crock Pot mod).

 

 

Does the recipie cook ok anyway (if you dont click predict)?

 

 

The crockpot is maily used for foods,

you would be better off adding this to the craftable items I would think.

 

You could try setting perishtime to 0

or look at the Pow cake and see how it is done there... some arbitrarily high number.

EDIT: Or maybe take the line out completely

(Don't forget to change it in your prefab.lua as well)

 

Speaking of, can you spawn the item using the c_spawn command?

If not the problem may be in your prefab file instead of the modmain.

 

It looks ok,

you might try changing the ingredient values to 0.5 instead of just .5

I dont know if that will matter.

 

not sure what you are trying to do, but you might want to add the inedible tag to those as well.

 

Anyway, the foodtype 'MYCHARFOOD' may not be defined, you could comment out that line and see if it still crashes.

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