Page 1 of 1

Error! (Fixed)

Posted: Mon Jan 15, 2024 10:20 pm
by BraveCaperCat
I have a problem, and i have no idea how to fix it. The game says that for my technology, it wants a normal.recipe member (i think that's what you call it) of my technology. However, the normal Member (which i deliberately set to nil after copying Processing Unit's technology) doesn't have any recipe property attached to it, according to the API docs. I try adding it and it brings a new error, that i tried to index a nil value: nil.recipe

Here is the error:
Failed to load mods: Error while loading technology prototype "bmd:computing" (Technology): Difficulty normal: Key "recipe" not found in property tree at ROOT.technology.bmd:computing.effects[0]
Modifications: Bigger Mining Drills

Mods to be disabled:
BiggerMiningDrills (0.1.0)

BiggerMiningDrills is the name of my mod, which is version 0.1.0. (Initial Release once uploaded to Mod Portal)
Luckily, my mod now prints the contents of the "bmd:computing" Technology in the log file:
{
effects = {
{
name = "bmd:computing-unit",
type = "unlock-recipe"
},
{
name = "bmd:advanced-computing-unit",
type = "unlock-recipe"
}
},
icon = "__base__/graphics/technology/advanced-electronics-2.png",
icon_mipmaps = 4,
icon_size = 256,
name = "bmd:computing",
order = "a-d-c",
prerequisites = {
"advanced-electronics-2",
"chemical-science-pack",
"bmd:steel-bending",
"laser-turret"
},
type = "technology",
unit = {
count = 175,
ingredients = {
{
"automation-science-pack",
3
},
{
"logistic-science-pack",
2
},
{
"chemical-science-pack",
2
}
},
time = 45
}
}

Re: Error!

Posted: Mon Jan 15, 2024 10:59 pm
by Pi-C
BraveCaperCat wrote: Mon Jan 15, 2024 10:20 pm Failed to load mods: Error while loading technology prototype "bmd:computing" (Technology): Difficulty normal: Key "recipe" not found in property tree at ROOT.technology.bmd:computing.effects[0]
Modifications: Bigger Mining Drills
The error message means that the "effects" property of your new technology requires a property with the key "recipe" (see here) that it couldn't find. Now look again at your definition:

Code: Select all

{
  effects = {
    {
      name = "bmd:computing-unit",
      type = "unlock-recipe"
    },
    {
      name = "bmd:advanced-computing-unit",
      type = "unlock-recipe"
    }
  },
  … 
}
Use "recipe" instead of "name" and it should work.

Re: Error!

Posted: Mon Jan 15, 2024 11:01 pm
by BraveCaperCat
That feels so obvious now.