"not a valid item template"

Hi, I’m Jesse, but in gaming tend to go by MrAbrahms or variants, or Cian or variants. I’m new here, first post, but I’ve been using this forum for about a month while playing the game and working on my own mods. I’m currently working on 2 mods, a simple recipes one, and a martial arts one. The recipe one includes some recipes for dehydrated and reconstituted condiments (mustard, ketchup, and mayonnaise so far). Mustard and mayonnaise work fine, but I’m having problems with ketchup:

drink_other.json

[code]

[
	{
    "id": "mayonnaise_gummy",
    "type": "COMESTIBLE",
    "symbol": "~",
    "color": "white",
    "name": { "str": "mayonnaise gummy", "str_pl": "mayonnaise gummies" },
    "description": "Because of its oil content, mayonnaise can't be dried into a powder, instead becoming     a rubbery gummy that tastes more or less like mayonnaise, but has an unpleasant texture. It can't be reconstituted into spreadable mayonnaise, but it can be softened by heating with water.",
    "price": 18,
    "material": [ "junk", "egg" ],
    "weight": "5 g",
    "volume": "25 ml",
    "comestible_type": "DRINK",
    "calories": 10,
    "spoils_in": "360 days",
    "charges": 1,
    "fun": -1,
    "flags": [ "NUTRIENT_OVERRIDE" ]
  },

  {
    "id": "ketchup_powder",
    "type": "COMESTIBLE",
    "symbol": "~",
    "color": "red",
    "name": { "str": "ketchup powder", "str_pl": "ketchup powder" },
    "description": "Dehydrated ketchup, ground into a powder. Can be used as a flavouring for dry snacks, or reconstituted with water.",
    "price": 18,
    "material": [ "veggy", "junk" ],
    "weight": "2 g",
    "volume": "25 ml",
    "comestible_type": "DRINK",
    "calories": 21,
    "spoils_in": "360 days",
    "charges": 1,
    "fun": 1,
	"flags": [ "NUTRIENT_OVERRIDE" ]
  }

][/code]

mayonnaise_gummy works fine, but ketchup_powder is not a valid item template, and as a result is an invalid result in the recipe. I can’t figure out whats different between them; they’re both cut and pasted from the original items, with the content edited. I’m pretty sure I’ve checked every ",{}[] to make sure nothing’s missing, but maybe there’s one I just can’t see…something my brain is telling me is there even though it isn’t?

Also in the same mod:
loop in comestible recipes detected: meat -> wastebread -> protein_powder -> dry_meat -> meat. Such loops can be broken by either removing or altering recipes or marking one of the items involved with the NUTRIENT_OVERRIDE flag
meat_pickled -> meat -> meat_pickled
meat_pickled -> meat -> meat_pickled
meat_smoked -> meat -> meat_smoked
meat_salted -> meat -> meat_salted
meat -> dry_meat -> meat
rehydrated_meat -> dry_meat -> meat -> rehydrated_meat
jerky -> meat -> jerky
bologna -> meat -> bologna
meat_canned -> meat -> bologna -> meat_canned
meat_canned -> meat -> bologna -> meat_canned
meat_canned -> meat -> bologna -> meat_canned
meat_aspic -> meat -> meat_aspic
sausage -> meat -> sausage
sausage_raw -> meat -> sausage_cooked -> sausage_raw
bratwurst_sausage -> meat -> bratwurst_sausage

I do understand why this is happening. I created recipes to create minced meat from meat or meat scraps (by finely chopping it with a knife, or (not added yet) grinding it with a meat grinder, and another recipe to turn minced meat into a chunk (or rather, a patty) of meat for use in recipes, by either cutting a hunk of minced meat in half, or mushing a bunch of minced meat scraps together with some filler (which can be eggs, meat, fat, veggies, or grains) into a patty or meatball. So it’s seeing that those meat items can be used as filler to make meat, ignoring the required minced_scraps (and its NUTRIENT_OVERRIDE flag), and apparently thinking there’s a direct loop.

What I’m wondering is if there’s a way around this? I’ve used the NUTRIENT_OVERRIDE flag on all of the relevant items I’ve created, as well as the recipes, and it doesn’t seem to have helped. Is it possible to create an item that a recipe will see as meat, but is a separate item so I can put the flag on it? Or is there a way to suppress the error message since it’s invalid?

1 Like

The error message you’re getting comes from recipes or requirements, not from item definitions, you need to share your recipes/requirements (or preferably the whole mod somewhere like github).

The relevant recipes:
ketchup:

   
    {
        "type": "recipe",
        "result": "ketchup_powder",
        "category": "CC_FOOD",
        "subcategory": "CSC_FOOD_DRY",
        "skill_used": "cooking",
        "difficulty": 2,
        "charges": 1,
        "time": "18 m",
        "batch_time_factors": [ 99, 1 ],
        "autolearn": true,
        "tools": [ [ [ "dehydrator", 25 ], [ "char_smoker", 25 ] ] ],
        "components": [ [ [ "ketchup", 1 ] ] ]
      },
     {
        "type": "recipe",
        "result": "ketchup",
        "id_suffix": "from_powder",
        "category": "CC_FOOD",
        "subcategory": "CSC_FOOD_DRINKS",
        "skill_used": "cooking",
    	"charges": 5,
        "time": "2 m",
        "autolearn": true,
        "components": [ [ [ "ketchup_powder", 5 ] ], [ [ "water_clean", 1 ] ] ]
      },

meat:

    {
    	"type": "recipe",
    	"result": "meat_minced",
    	"category": "CC_FOOD",
    	"subcategory": "CSC_FOOD_MEAT",
    	"skill_used": "cooking",
    	"charges": 1,
    	"//": "1 charge = 2 chunks of meat, by weight",
    	"time": "15 m",
    	"autolearn": true,
    	"batch_time_factors": [ 25, 1 ],
        "qualities": [ { "id": "CUT", "level": 1 } ],
        "components": [ [ [ "meat_red_raw", 1, "LIST" ] ] ]
      },
      {
    	"type": "recipe",
    	"result": "meat_minced",
    	"id_suffix": "scrapfiller",
    	"category": "CC_FOOD",
    	"subcategory": "CSC_FOOD_MEAT",
    	"skill_used": "cooking",
    	"charges": 1,
    	"//": "1 charge = 2 chunks of meat, by weight",
    	"time": "5 m",
    	"autolearn": true,
    	"batch_time_factors": [ 25, 1 ],
        "qualities": [ { "id": "CUT", "level": 1 } ],
        "components": [ 
    		[ [ "minced_scrap", 5 ] ],
    		[ [ "meat_scrap", 5 ], [ "filler", 5, "LIST" ] ]
    	]
      },
      {
    	"type": "recipe",
    	"result": "meat_minced",
    	"id_suffix": "scrap",
    	"category": "CC_FOOD",
    	"subcategory": "CSC_FOOD_MEAT",
    	"skill_used": "cooking",
    	"charges": 1,
    	"//": "1 charge = 2 chunks of meat, by weight",
    	"time": "5 m",
    	"autolearn": true,
    	"batch_time_factors": [ 25, 1 ],
        "qualities": [ { "id": "CUT", "level": 1 } ],
        "components": [ 
    		[ [ "minced_scrap", 10 ] ]
    	]
      },
      {
    	"type": "recipe",
    	"result": "minced_scrap",
    	"category": "CC_FOOD",
    	"subcategory": "CSC_FOOD_MEAT",
    	"skill_used": "cooking",
    	"charges": 1,
    	"//": "1 charge = 0.1 chunk of meat, by weight. A multi-step process to convert meat scraps into usable meat chunks.",
    	"time": "1 m",
    	"autolearn": true,
    	"batch_time_factors": [ 25, 1 ],
        "qualities": [ { "id": "CUT", "level": 1 } ],
        "components": [ [ [ "meat_scrap", 1 ] ] ]
      },
      {
    	"type": "recipe",
    	"result": "meat",
    	"id_suffix": "minced_or_ground",
    	"category": "CC_FOOD",
    	"subcategory": "CSC_FOOD_MEAT",
    	"skill_used": "cooking",
    	"charges": 2,
    	"time": "10 s",
    	"//": "Literally just cutting a (homemade) package of hamburger in half.",
    	"flags": [ "NUTRIENT_OVERRIDE" ],
    	"autolearn": true,
    	"qualities": [ { "id": "CUT", "level": 1 } ],
    	"components": [ [ [ "meat_minced", 1 ] ] ]
      },
      {
    	"type": "recipe",
    	"result": "meat",
    	"id_suffix": "mincedscrap",
    	"category": "CC_FOOD",
    	"subcategory": "CSC_FOOD_MEAT",
    	"skill_used": "cooking",
    	"charges": 1,
    	"time": "5 m",
    	"//": "Chopping, mushing, and packing a bunch of ground meat and filler together into a patty or meatball, which can substitute for a hunk of meat in recipes.",
    	"flags": [ "NUTRIENT_OVERRIDE" ],
    	"autolearn": true,
    	"qualities": [ { "id": "CUT", "level": 1 } ],
    	"components": [ 
    		[ [ "minced_scrap", 3 ] ],
    		[ [ "minced_scrap", 2 ], [ "filler", 2, "LIST" ] ]
    	]
      }

cooking_components.json

    [
      {
    	"id": "filler",
    	"type": "requirement",
    	"//": "Anything to replace missing volume in ground meat, such as meat, fat, eggs, vegetables, flour, cellulose.",
    	"components": [
    	  [
    		[ "powder_eggs", 1 ], 
    		[ "eggs_bird", 1, "LIST" ], 
    		[ "egg_reptile", 1 ],
    		[ "meat_offal", 1, "LIST" ],
    		[ "batter", 4, "LIST" ],
    		[ "any_butter", 1, "LIST" ],
    		[ "meat_cooked", 1, "LIST" ],
    		[ "edible_fat", 1, "LIST" ],
    		[ "edible_tallow", 1, "LIST" ],
    		[ "edible_lard", 1, "LIST" ],
    		[ "fiddlehead_boiled", 1 ],
            [ "dandelion_cooked", 1 ],
            [ "salsify_baked", 1 ],
            [ "veggy_canned", 1 ],
            [ "veggy_salted", 1 ],
    		[ "cattail_stalk", 1 ],
    		[ "corn", 1 ],
            [ "irradiated_corn", 1 ],
    		[ "onion", 1 ],
            [ "irradiated_onion", 1 ],
    		[ "veggy_wild", 1 ],
    		[ "raw_dandelion", 1 ],
            [ "rhubarb", 1 ],
            [ "irradiated_rhubarb", 1 ],
    		[ "mushroom_cooked", 1 ],
            [ "morel_cooked", 1 ],
            [ "mushroom", 1 ],
            [ "dry_mushroom", 1 ],
    		[ "wild_herbs", 4 ]
    	  ]
    	]
      }
    ]

Hhm. I don’t see anything immediately wrong. Not sure what’s up.

Ahh…well, thanks for looking anyway. Been trying to figure this out for about a week. Thought I had it at one point; “name” was [ } instead of { }, but fixing that didn’t actually change anything, still got the same error message.

to make a food “pretend” like another food when you cook it, you can add "cooks_like": "meat" to have a finished recipe count “meat” as its ingredient instead of the original food.

Thanks, I’ll try that.

Haven’t been able to get that to work. Solved the problem with meat by adding the items to a requirements list instead (overriding meat_red_raw), but can’t do that with mayo (without changing every recipe that uses it, the thing I’m trying to avoid doing in the first place). Looked around, but couldn’t find any examples of it in use to see how it works.

I’ve mostly been working on my martial arts mod for the past while, but I added some more food recipes today (added some weapon recipes as well recently, but no issues with those) and I’m getting more of the same “not a valid item template” errors, and I’m wondering if maybe it’s somehow a loading order error, that it’s loading the recipe before the item definition or something. It shouldn’t be, because my mod uses the same directory structure and filenames as the main game (except all my food recipes are currently in recipe_food.json, but it’s about all I can think of. The errors (from debug.log):

src/recipe_dictionary.cpp:359 [recipe_dictionary::finalize_internal(std::map<string_id, recipe>&)::<lambda(const recipe&)>] Recipe ketchup_powder defines invalid result.
23:35:29.014 ERROR : src/recipe_dictionary.cpp:359 [recipe_dictionary::finalize_internal(std::map<string_id, recipe>&)::<lambda(const recipe&)>] Recipe ketjap defines invalid result.
23:35:29.014 ERROR : src/recipe_dictionary.cpp:359 [recipe_dictionary::finalize_internal(std::map<string_id, recipe>&)::<lambda(const recipe&)>] Recipe pasta_primavera defines invalid result.
23:35:29.015 ERROR : src/recipe_dictionary.cpp:359 [recipe_dictionary::finalize_internal(std::map<string_id, recipe>&)::<lambda(const recipe&)>] Recipe sambal defines invalid result.
23:35:29.015 ERROR : src/item_factory.cpp:1368 [const itype* Item_factory::find_template(const itype_id&) const] Missing item definition: cookbook_indian
23:35:39.541 ERROR : src/recipe_dictionary.cpp:359 [recipe_dictionary::finalize_internal(std::map<string_id, recipe>&)::<lambda(const recipe&)>] Recipe sooji_halwa defines invalid book.
23:35:39.634 ERROR : src/recipe_dictionary.cpp:60 [const T& string_id::obj() const [with T = recipe]] invalid recipe id “sooji_halwa”
23:35:57.635 INFO : Loaded tileset: ChestHole32
23:35:57.675 ERROR : src/requirements.cpp:420 [void component::check_consistency(const string&) const] ketjap in inline_recipe_hor_fun is not a valid item template

src/requirements.cpp:420 [void component::check_consistency(const string&) const] ketchup_powder in inline_recipe_ketchup_from_powder is not a valid item template
23:36:11.927 ERROR : src/requirements.cpp:420 [void component::check_consistency(const string&) const] sambal in inline_recipe_maggi_goreng is not a valid item template
23:36:11.927 ERROR : src/requirements.cpp:420 [void component::check_consistency(const string&) const] ketjap in inline_recipe_maggi_goreng is not a valid item template
23:36:11.927 ERROR : src/requirements.cpp:420 [void component::check_consistency(const string&) const] sambal in inline_recipe_mie_goreng is not a valid item template
23:36:11.927 ERROR : src/requirements.cpp:420 [void component::check_consistency(const string&) const] ketjap in inline_recipe_mie_goreng is not a valid item template

src/item_factory.cpp:1368 [const itype* Item_factory::find_template(const itype_id&) const] Missing item definition: sambal
23:39:47.770 ERROR : src/item_factory.cpp:1368 [const itype* Item_factory::find_template(const itype_id&) const] Missing item definition: ketjap
23:39:47.772 ERROR : src/item_factory.cpp:1368 [const itype* Item_factory::find_template(const itype_id&) const] Missing item definition: ketchup_powder

(Note: the cookbook_indian book learning for one recipe I simply copied from another recipe in the main game, so that issue is in the main game but somehow doesn’t produce an error.)

Two other recipes I added today don’t produce any errors, but don’t show up in the game, even though another recipe that’s dependent on one of them does, and shows it as an ingredient.

The item definitions for the problematic items:
wheat.json
> {

    "type": "COMESTIBLE",
    "id": "sooji_halwa",
    "name": { "str": "sooji halwa", "str_pl": "sooji halwas" },
    "weight": "148 g",
    "color": "yellow",
    "spoils_in": "72 hours",
    "container": "box_small",
    "comestible_type": "FOOD",
    "symbol": "%",
    "quench": 12,
    "calories": 222,
    "description": "An Indian sweet consisting of couscous fried in butter or ghee, then cooked with milk, sugar, and spices. Traditionally cut into diamond-shaped pieces.",
    "price": 20,
    "material": "wheat",
    "volume": "250 ml",
    "flags": [ "EATEN_HOT", "TRADER_AVOID" ],
    "vitamins": [ [ "calcium", 10 ], [ "iron", 10 ] ]
  }

spice.json

{
“id”: “ketjap”,
“type”: “COMESTIBLE”,
“symbol”: “~”,
“color”: “brown”,
“name”: { “str”: “ketjap manis”, “str_pl”: “ketjap manis” },
“description”: “Indonesian sweet soy sauce.”,
“price”: 190,
“weight”: “24 g”,
“volume”: “250 ml”,
“calories”: 30,
“comestible_type”: “DRINK”,
“container”: “bottle_glass”,
“primary_material”: “water”,
“quench”: -5,
“charges”: 10,
“healthy”: -1,
“fun”: 5,
“freezing_point”: -22,
“phase”: “liquid”
},
{
“id”: “sambal”,
“type”: “COMESTIBLE”,
“symbol”: “~”,
“color”: “red”,
“name”: { “str”: “sambal”, “str_pl”: “sambal” },
“description”: “Indo-Malay chilli paste.”,
“price”: 190,
“weight”: “24 g”,
“volume”: “250 ml”,
“calories”: 30,
“comestible_type”: “DRINK”,
“container”: “jar_glass”,
“primary_material”: “veggy”,
“quench”: -20,
“charges”: 10,
“healthy”: -1,
“fun”: -15,
“freezing_point”: -15,
“phase”: “liquid”
}

(there was an extraneous , at the end of the sambal definition that should have produced an error but didn’t)

meat_dishes.json

 {
    "type": "COMESTIBLE",
    "id": "beet_stew",
    "name": { "str": "Babylonian beet stew", "str_pl": "Babylonian beet stew" },
    "conditional_names": [
      { "type": "FLAG", "condition": "CANNIBALISM", "name": { "str": "Babe-lonian beet stew", "str_pl": "Babes-lonian beet stew" } },
      {
        "type": "COMPONENT_ID",
        "condition": "mutant",
        "name": { "str": "ectoplasmic beet stew", "str_pl": "ectoplasmic beet stew" }
      }
    ],
    "weight": "3500 g",
    "color": "red",
    "spoils_in": "5 days",
    "container": "jar_3l_glass",
    "comestible_type": "FOOD",
    "symbol": "%",
    "healthy": 1,
    "calories": 299,
    "description": "An ancient recipe, translated from a 4000 year old Babylonian clay tablet, written in ancient Akkadian, consisting of beets, leeks, onions, garlic, lamb, and spices, simmered in beer. Best eaten with couscous.",
    "price": 290,
    "material": [ "flesh", "veggy" ],
    "volume": "3000 ml",
    "flags": [ "EATEN_HOT" ],
    "fun": 5,
    "charges": 10,
    "vitamins": [ [ "vitA", 14 ], [ "vitC", 7 ], [ "calcium", 6 ], [ "iron", 27 ] ]
  },

veggy_dishes.json

{
“type”: “COMESTIBLE”,
“id”: “pasta_primavera”,
“name”: { “str”: “pasta primavera”, “str_pl”: “pasta primavera” },
“weight”: “150 g”,
“color”: “yellow”,
“spoils_in”: “2 days”,
“comestible_type”: “FOOD”,
“symbol”: “%”,
“healthy”: 1,
“calories”: 226,
“description”: “Pasta with sauteed veggies, spices, and olive oil.”,
“price”: 1000,
“material”: [ “wheat”, “veggy” ],
“volume”: “1750 ml”,
“charges”: 8,
“flags”: [ “EATEN_HOT”, “FREEZERBURN” ],
“fun”: 4,
“vitamins”: [ [ “vitA”, 3 ], [ “vitC”, 3 ], [ “calcium”, 13 ], [ “iron”, 4 ] ]
}

and the recipes:
> {

    "result": "maggi_goreng",
    "type": "recipe",
    "category": "CC_FOOD",
    "subcategory": "CSC_FOOD_PASTA",
    "skill_used": "cooking",
    "difficulty": 1,
    "time": "20 m",
    "charges": 4,
    "autolearn": true,
    "qualities": [ { "id": "COOK", "level": 1 } ],
    "tools": [ [ [ "surface_heat", 6, "LIST" ] ] ],
    "components": [
      [ [ "noodles_fast", 4 ] ],
      [ [ "water", 1 ], [ "water_clean", 1 ] ],
      [ [ "any_butter_or_oil", 2, "LIST" ] ],
      [ [ "powder_eggs", 8 ], [ "eggs_bird", 8, "LIST" ], [ "egg_reptile", 8 ] ],
	  [ [ "meat_red_raw", 1, "LIST" ] ],
	  [ [ "sambal", 3 ] ],
	  [ [ "ketjap", 5 ] ],
	  [ [ "soysauce", 1 ] ]
    ]
  },
  {
    "result": "mie_goreng",
    "type": "recipe",
    "category": "CC_FOOD",
    "subcategory": "CSC_FOOD_PASTA",
    "skill_used": "cooking",
    "difficulty": 1,
    "time": "20 m",
    "charges": 4,
    "autolearn": true,
    "qualities": [ { "id": "COOK", "level": 1 } ],
    "tools": [ [ [ "surface_heat", 6, "LIST" ] ] ],
    "components": [
      [ [ "spaghetti_cooked", 1 ] ],
      [ [ "any_butter_or_oil", 2, "LIST" ] ],
      [ [ "powder_eggs", 8 ], [ "eggs_bird", 8, "LIST" ], [ "egg_reptile", 8 ] ],
	  [ [ "meat_red_raw", 1, "LIST" ] ],
	  [ [ "sambal", 3 ] ],
	  [ [ "ketjap", 5 ] ],
	  [ [ "soysauce", 1 ] ],
	  [ [ "ketchup", 5 ] ]
    ]
  },
  {
    "result": "hor_fun",
    "type": "recipe",
    "category": "CC_FOOD",
    "subcategory": "CSC_FOOD_PASTA",
    "skill_used": "cooking",
    "difficulty": 1,
    "time": "30 m",
    "charges": 4,
    "autolearn": true,
    "qualities": [ { "id": "COOK", "level": 3 } ],
    "tools": [ [ [ "surface_heat", 6, "LIST" ] ] ],
    "components": [
      [ [ "fun_raw", 1 ] ],
      [ [ "any_butter_or_oil", 2, "LIST" ] ],
      [ [ "powder_eggs", 4 ], [ "eggs_bird", 4, "LIST" ], [ "egg_reptile", 4 ] ],
	  [ [ "meat_red_raw", 1, "LIST" ] ],
	  [ [ "ketjap", 2 ] ],
	  [ [ "soysauce", 2 ] ],
	  [ [ "broth", 1 ] ]
    ]
  },
  {
    "result": "pasta_primavera",
    "type": "recipe",
    "category": "CC_FOOD",
    "subcategory": "CSC_FOOD_PASTA",
    "skill_used": "cooking",
    "difficulty": 1,
    "time": "20 m",
    "charges": 4,
    "autolearn": true,
    "qualities": [ { "id": "CUT", "level": 1 }, { "id": "COOK", "level": 3 } ],
    "tools": [ [ [ "surface_heat", 6, "LIST" ] ] ],
    "components": [
      [ [ "spaghetti_raw", 1 ], [ "macaroni_raw", 1 ], [ "noodles_fast", 1 ], [ "lasagne_raw", 1 ] ],
      [ [ "water", 1 ], [ "water_clean", 1 ] ],
        [ [ "any_butter_or_oil", 2, "LIST" ] ],
		[ [ "veggy", 4 ] ],
		[ [ "seasoning_italian", 1 ], [ "seasoning_salt", 1 ], [ "garlic", 1 ], [ "wild_herbs", 20 ] ],
		[ [ "salt", 1 ] ],
		[ [ "pepper", 1 ] ]
    ]
  },
  {
    "result": "sooji_halwa",
    "type": "recipe",
    "category": "CC_FOOD",
    "subcategory": "CSC_FOOD_PASTA",
    "skill_used": "cooking",
    "difficulty": 1,
    "time": "20 m",
    "charges": 4,
    "autolearn": true,
    "qualities": [ { "id": "CUT", "level": 1 }, { "id": "COOK", "level": 3 } ],
    "tools": [ [ [ "surface_heat", 6, "LIST" ] ] ],
    "components": [
      [ [ "couscous_raw", 2 ] ],
      [ [ "butter", 1 ], [ "ghee", 1 ] ],
	  [ [ "milk_standard", 3, "LIST" ], [ "milk_powder", 3 ], [ "can_coconut", 1 ] ],
      [
        [ "sugar", 3 ],
        [ "syrup", 3 ],
        [ "honey_bottled", 2 ], 
		[ "honey_glassed", 2 ]
      ],
	  [ [ "cinnamon", 20 ] ]
    ]
  },
  {
    "result": "couscous_cooked",
    "type": "recipe",
    "category": "CC_FOOD",
    "subcategory": "CSC_FOOD_PASTA",
    "skill_used": "cooking",
    "difficulty": 1,
    "time": "3 m",
    "charges": 4,
    "autolearn": true,
	"batch_time_factors": [ 95, 2 ],
    "qualities": [ { "id": "COOK", "level": 3 } ],
    "tools": [ [ [ "surface_heat", 6, "LIST" ] ] ],
    "components": [
      [ [ "couscous_raw", 1 ] ],
      [ [ "broth", 1 ] ],
	  [ [ "salt", 1 ] ]
    ]
  },
  {
    "type": "recipe",
    "result": "beet_stew",
    "category": "CC_FOOD",
    "subcategory": "CSC_FOOD_MEAT",
    "skill_used": "cooking",
    "difficulty": 2,
    "time": "4 h",
    "charges": 2,
    "qualities": [ { "id": "COOK", "level": 2 } ],
    "tools": [ [ [ "surface_heat", 8, "LIST" ] ] ],
    "components": [
      [
        [ "beer", 2 ],
        [ "belgian_ale", 2 ],
		[ "european_pilsner", 2 ],
        [ "hb_beer", 2 ],
        [ "india_pale_ale", 2 ],
        [ "wine_barley", 2 ],
        [ "pale_ale", 2 ],
        [ "stout", 2 ],
        [ "imperial_stout", 2 ]
      ],
      [ [ "sugar_beet", 10 ] ],
      [ [ "meat_red", 4, "LIST" ], [ "dry_meat", 4 ], [ "can_chicken", 4 ] ],
      [ [ "onion", 4 ] ],
      [ [ "veggy_wild", 5 ] ],
	  [ [ "cinnamon", 20 ] ],
	  [ [ "salt", 5 ], [ "seasoning_salt", 5 ] ]
    ]
  },
  {
    "result": "beetstew_withcouscous",
    "type": "recipe",
    "category": "CC_FOOD",
    "subcategory": "CSC_FOOD_PASTA",
    "skill_used": "cooking",
    "difficulty": 1,
    "time": "3 m",
    "charges": 4,
    "autolearn": true,
	"batch_time_factors": [ 95, 2 ],
    "qualities": [ { "id": "CONTAIN", "level": 1 } ],
    "components": [
      [ [ "beet_stew", 1 ] ],
      [ [ "couscous_cooked", 1 ] ],
	  [ [ "salt", 1 ] ]
    ]
  },
  {
    "type": "recipe",
    "result": "sambal",
    "category": "CC_FOOD",
    "subcategory": "CSC_FOOD_OTHER",
    "skill_used": "cooking",
    "difficulty": 2,
    "time": "45 m",
    "autolearn": true,
    "batch_time_factors": [ 75, 1 ],
    "tools": [ [ [ "rock_quern", -1 ], [ "clay_quern", -1 ] ] ],
    "components": [ 
		[ [ "chili_pepper", 4 ] ],
		[ [ "vinegar", 2 ] ],
		[ [ "sugar", 2 ] ],
		[ [ "salt", 2 ], [ "soysauce", 2 ], [ "seasoning_salt", 2 ] ]
	]
  },
  {
    "type": "recipe",
    "result": "ketjap",
    "category": "CC_FOOD",
    "subcategory": "CSC_FOOD_OTHER",
    "skill_used": "cooking",
    "difficulty": 2,
    "charges": 7,
    "time": "60 m",
    "autolearn": true,
	"batch_time_factors": [ 80, 1 ],
    "qualities": [ { "id": "COOK", "level": 2 } ],
    "tools": [ [ [ "surface_heat", 4, "LIST" ] ] ],
    "components": [ [ [ "sugar", 5 ] ], [ [ "soysauce", 10 ] ] ]
  },
{
    "result": "couscous_raw",
    "type": "recipe",
    "category": "CC_FOOD",
    "subcategory": "CSC_FOOD_PASTA",
    "skill_used": "cooking",
    "difficulty": 4,
    "time": "30 m",
    "autolearn": true,
    "tools": [ [ [ "surface_heat", 25, "LIST" ] ] ],
    "components": [ [ [ "flour", 5 ] ], [ [ "water", 1 ], [ "water_clean", 1 ] ] ]
  },
  {
    "result": "fun_raw",
    "type": "recipe",
    "category": "CC_FOOD",
    "subcategory": "CSC_FOOD_PASTA",
    "skill_used": "cooking",
    "difficulty": 4,
    "time": "2 m",
    "autolearn": true,
    "tools": [ [ [ "surface_heat", 25, "LIST" ] ], [ [ "sheet", -1 ] ], [ [ "rock_quern", -1 ], [ "clay_quern", -1 ], [ "mortar_pestle", -1 ] ] ],
	"qualities": [ { "id": "BOIL", "level": 1 }, { "id": "CUT", "level": 2 } ],
    "components": [ [ [ "dry_rice", 5 ] ], [ [ "water", 1 ], [ "water_clean", 1 ] ] ]
  }

(note: will edit to try to fix formatting after posting)

If I try to reproduce your errors, I have a lot of other errors pop up (but non of them related to what you stated), as it can’t find any couscous related ids.
Since there is no couscous in the base game, I assume that’s something that either your mod adds to the game or an other mod that you use.
If it’s the latter, please tell us the name of the mod. If it’s the former, please post the mod as a whole, just as anothersimulacrum has written, so we can rule out any bugs or fixes related to this.
Please use Github or similar to share code (or use zip to pack the mod and share it over a file sharing site), since it will preserve the formatting.

As for why this is important, imagine you go to a repair shop and tell the mechanic that your car does make such a weird noise. He can’t take a look at your car, since you don’t have it with you, but you hope he knows what causes that sound. There’s a chance that he does, but it’s really slim and you’re better off by showing him the defective car than just have him guess.
Later you come back to the repair shop, this time with a piston in your hand - that’s the thing that causes the noise, you think. He might be able to test it or see a defect if there is one, but without having the surrounding engine, there’s only so much he can do.

In other words: I have tested your code, and I had not one of the errors you had, but others caused by other parts of your (missing) code. I also have no idea on what version of Cataclysm you want it to work… since you never named one, I just picked a random one (build 10804).

Good point. I posted the bits of the mod that the game says are broken in hopes that it’s something obvious like a missing } or , that I’m just not seeing, or an invalid property that’s somehow not throwing errors in the main game, like the cookbook_indian issue. Though given how long I’ve been trying to fix the ketchup issue, that seems unlikely. Ya, couscous is from my mod as well. Haven’t got a github account (had a particular reason for that, but I’ve forgotten what it was), so I’ve posted the mod on my Patreon (as a public post), https://www.patreon.com/posts/cdda-mod-abrahms-39162798 I’m using 0.E stable (10478).

In case it’s helpful, mods.json from the current world I’m testing in:

[
“dda”,
“No_Fungi”,
“no_npc_food”,
“Mutation_Changes”,
“aftershock”,
“crt_expansion”,
“magiclysm”,
“safeautodoc”,
“SD_Magcrafting”,
“Mining_Mod”,
“fuji_mpp”,
“speedydex”,
“stats_through_kills”,
“StatsThroughSkills”,
“MMA”,
“AbrahmsMA”,
“AbrahmsRecipes1”
]

Thanks you for posting the full mod.

I finally got the time necessary to check it out.

I’ve downloaded it, unzipped it and moved it over into my mod folder. Without changing anything, I generated a world with only your mod in it.

First the errors I’ve run into:
Recipe ketchup_powder defines invalid result.
Recipe ketjap defines invalid result.
Recipe pasta_primavera defines invalid result.
Recipe sambal defines invalid result.

Explanation:
The item with the id “ketchup_powder” is missing and therefore it throws an error. I guess, you removed it because it didn’t work but forgot to remove the recipe too?
This is also the case for “ketjap”, “pasta_primavera” and “sambal”.

More errors:
ketjap in inline_recipe_hor_fun is not a valid item template
ketchup_powder in inline_recipe_ketchup_from_powder is not a valid item template
sambal in inline_recipe_maggi_goreng is not a valid item template
ketjap in inline_recipe_maggi_goreng is not a valid item template
sambal in inline_recipe_mie_goreng is not a valid item template
ketjap in inline_recipe_mie_goreng is not a valid item template

More explanation:
Again, the game tells you “I can’t find the item with "id": "..." in your mod, but the (recipe) … requires it as a component!”.

For example, you have defined a recipe (with no id, so it’s “inline”) with a result “ketchup” and an id_suffix “from_powder” that uses “ketchup_powder”. And since “ketchup_powder” is not defined, the game tells you that “[Not found ingredient] in the [recipe that requires it] is not a valid template”.


After that, I went ahead and added all the necessary item definitions you’ve posted a few posts back and it does not throw a single error.
Also, I’ve checked in game and the item existed and could be spawned in with the spawn menu.

My suggested fix:

  • Double check that the files under your data/mods folder do contain the item definitions. If not, add them in, save and try again.
  • If you edit your files with some special tool/program, make sure it saves them to the right place (not “project files” or something like that).
  • If you edit your files with some special tool/program, make sure it actually saves them to your drive and not just keeps it in memory or a temporary file.
  • If they are defined in your mod and you just removed them to upload the zip file in a “cleaner state”, please share a version that has them in, so we can rule out this cause of error.

Thanks for having a look. I understand what the errors mean, but I don’t understand why they’re appearing because the item definitions are in the mod, and I’ve verified that the spelling is consistent between the definitions and the recipes.

In the mod folder, item definitions are in
/items/comestibles
carnivore.json
drink_other.json
meat_dishes.json
spice.json
veggy_dishes.json
wheat.json

maintaining consistency with similar items defined in files with the same name and folder location in the main game.

Weapons are defined in /items/melee
bludgeons.json
spears_and_polearms.json
swords_and_blades.json

Food recipes are all located in /recipes
recipe_food.json

Weapon recipes are located in /recipes/weapon
bashing.json
cutting.json
piercing.json

Requirements lists are located in /requirements
cooking_components.json

Item groups (weapons only, haven’t added any food items to item groups) are in /itemgroups

I’ve verified that all of those folders and files are in the zip file I uploaded. If they’re not present in the file you downloaded, please let me know.

I’m using Notepad++ for editing.

Ok, figured out most of them. For some reason, spice.json, veggy_dishes.json, and drink_other.json were all saved in 0.D instead of 0.E (even though the mod in 0.E had all those files too), while all the other files were saved in the right place. Thanks for the help with that.

But, although it’s not producing any errors, the recipe for Babylonian beet stew isn’t showing up, even though the item shows up as a component in the recipe for Babylonian beet stew with couscous. It should be in the Meat category, but I’ve checked every category, as well as all recipes, and searched for beet. I’ve checked that the relevant files are saved in the right place. Everything else in the same files shows up in game, so the problem must be with the recipe. It’s in the post above (beet_stew). It’s currently auto-learned at cooking level 2 (will change that later, as it’s not quite that easy), and my character has level 8.

That’s what I meant with “make sure it saves them to the right place”. I did a text search over the whole mod and they were not defined anywhere, so I knew for sure that they are missing :wink:

The recipe for beet_stew is missing the "autolearn": true tag, in your post above and in the uploaded mod files, so it can not be auto-learned at cooking level 2.

1 Like

Aye, true. I made sure they were saving to the mod folder, not anywhere else. Which made sense since I created the files in the mod folder then opened them in the editor from the right-click menu. Guess I must have started work on the mod in the 0.D installation, then switched to 0.E, moved all the files over, but forgot to reopen those 3.

Ahhh, thanks! Knew it had to be something simple like that; my brain telling me it was there even though it wasn’t.