[0.16.25] AssignID error when deleting base recipe

Place to get help with not working mods / modding interface.
User avatar
Impatient
Filter Inserter
Filter Inserter
Posts: 883
Joined: Sun Mar 20, 2016 2:51 am
Contact:

[0.16.25] AssignID error when deleting base recipe

Post by Impatient »

Hi,

I found an unexpected behavior in the engine while tinkering with my own mod.

I was creating a different recipe for "electronic-circuit" and erased the old one, like so:

Code: Select all

data:extend{
  {
    type = "recipe",
    name = "new-recipe-for-electronic-circuit",
    normal =
    {
      ...
      result = "electronic-circuit",
    },
    expensive =
    {
      ...
      result = "electronic-circuit",
    }
  }
}

data.raw.recipe["electronic-circuit"] = nil
When loading this, factorio threw an error. These are the lines from factoro-current.log:

Code: Select all

...

   2.013 Error ModManager.cpp:1023: Error in assignID, recipe with name 'electronic-circuit' does not exist.

Source: productivity-module (module).

...
I did not change the prototype for the item "electronic-circuit". Does that mean, that the recipe for "productivity-module" references the recipe for "electronic-circuit" and not the item "electronic-circuit"? If yes, is this a bug or the intended behavior?
Last edited by Impatient on Mon Feb 26, 2018 2:45 pm, edited 1 time in total.
User avatar
Impatient
Filter Inserter
Filter Inserter
Posts: 883
Joined: Sun Mar 20, 2016 2:51 am
Contact:

Re: [0.16.25] AssignID error when deleting base recipe

Post by Impatient »

It just crossed my mind, that this error might have something to do with the recipes the productivity module is able to influence.
User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5304
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: [0.16.25] AssignID error when deleting base recipe

Post by Klonan »

This is not a bug, but a modding error
User avatar
Impatient
Filter Inserter
Filter Inserter
Posts: 883
Joined: Sun Mar 20, 2016 2:51 am
Contact:

Re: [0.16.25] AssignID error when deleting base recipe

Post by Impatient »

Thank you Klonan.

Can anyone help me to properly remove a recipe that comes with the base mod? In case that it is possible at all. Thanks!
User avatar
Impatient
Filter Inserter
Filter Inserter
Posts: 883
Joined: Sun Mar 20, 2016 2:51 am
Contact:

Re: [0.16.25] AssignID error when deleting base recipe

Post by Impatient »

Another idea that came to my mind is, that this error might be caused by the factorio engine trying to calculate the total base ingredients of a productivity module.
User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5211
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: [0.16.25] AssignID error when deleting base recipe

Post by eradicator »

Removing things from base is often a bad idea if you want to keep compatibility. (Though i'm not really sure what the problem is here).

Why don't you just overwrite the old recipe, or set it to enabled = false?
data.raw.recipes['electronic-circuit'] = {<your new recipe here>}
User avatar
Impatient
Filter Inserter
Filter Inserter
Posts: 883
Joined: Sun Mar 20, 2016 2:51 am
Contact:

Re: [0.16.25] AssignID error when deleting base recipe

Post by Impatient »

Yes, I did so. For now I found a way around to achieve what I want. And enabled=false is a pretty smart solution to effectively remove a base recipe from gameplay. Thanks.
Post Reply

Return to “Modding help”