Error! (Fixed)

Place to get help with not working mods / modding interface.
Post Reply
BraveCaperCat
Long Handed Inserter
Long Handed Inserter
Posts: 50
Joined: Mon Jan 15, 2024 10:10 pm
Contact:

Error! (Fixed)

Post 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
}
}
Attachments
factorio-current.log
Factorio Log from the error.
(4.73 KiB) Downloaded 15 times
Last edited by BraveCaperCat on Mon Jan 15, 2024 11:01 pm, edited 1 time in total.

Pi-C
Smart Inserter
Smart Inserter
Posts: 1655
Joined: Sun Oct 14, 2018 8:13 am
Contact:

Re: Error!

Post 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.
A good mod deserves a good changelog. Here's a tutorial (WIP) about Factorio's way too strict changelog syntax!

BraveCaperCat
Long Handed Inserter
Long Handed Inserter
Posts: 50
Joined: Mon Jan 15, 2024 10:10 pm
Contact:

Re: Error!

Post by BraveCaperCat »

That feels so obvious now.

Post Reply

Return to “Modding help”