Jump to content

Adding cookable food into the game


Gutawer

Recommended Posts

@Gutawer It's possible and quite easy. Download this mod, look in the modmain for the Cookpot recipes section.

 

Copied here for convenience.

------------------------------------- Cookpot recipes----  AddIngredientValues({"item"}, {"tag"=value})--		Lets the game know the "worth" of an item. You can supply a list of--		items in the first parameter if they will all have the same values.----		Each tag is a particular "kind" of thing that a recipe might require--		(i.e. meat, veggie) and the value is how much of that kind your item is--		worth.----		See cooking.lua for examples. ----	AddCookerRecipe("cooker", recipe)--		Adds the recipe for that kind of cooker. In the base game the only--		cooker is "cookpot".----		See preparedfoods.lua for recipe examples.--------------------------------------- Give flowers some cooking value. We made up a new "kind" of food, called flower.AddIngredientValues({"petals", "petals_evil"}, {flower=1})-- Add a new recipe which requires flowers as an ingredient.-- NOTE!!! No prefabs for this recipe exist, so you won't actually be able to-- cook it. This is just a code sample.local flowercake = {	name = "flowercake",	test = function(cooker, names, tags) return tags.flower >= 2 and names.butter end,	priority = 1,	weight = 1,	foodtype="VEGGIE",	health = TUNING.HEALING_TINY,	hunger = TUNING.CALORIES_LARGE,	sanity = TUNING.SANITY_TINY,	perishtime = TUNING.PERISH_MED,	cooktime = 0.75,}AddCookerRecipe("cookpot", flowercake)
Link to comment
Share on other sites

OK. I've followed every guide I could find about the autocompiler. I've got a mod in my mods folder called anim_exports, which has an anim folder and a spriter folder. I put the scml file along with the png files in the spriter folder and run the autocompiler, but nothing happens. Not even an error message. What am I doing wrong?

Link to comment
Share on other sites

OK. I've followed every guide I could find about the autocompiler. I've got a mod in my mods folder called anim_exports, which has an anim folder and a spriter folder. I put the scml file along with the png files in the spriter folder and run the autocompiler, but nothing happens. Not even an error message. What am I doing wrong?

Nevermind, got it to work. Your folder name has to be "exported", in case anyone was having the same problem.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...