[0.17.3] Inconsistent technology/unlock-recipe behaviour

Bugs that are actually features.
Post Reply
User avatar
DRY411S
Filter Inserter
Filter Inserter
Posts: 727
Joined: Sun Mar 13, 2016 9:48 am
Contact:

[0.17.3] Inconsistent technology/unlock-recipe behaviour

Post by DRY411S »

I note that most if not all the entities available at the start of the game are now in the technology.lua in 0.17. This was not the case in 0.16. An example is this....

Code: Select all

  {
    type = "technology",
    name = "basic-mining",
    icon_size = 128,
    icon = "__base__/graphics/technology/demo/basic-mining.png",
    enabled = false,
    effects =
    {
      {
        type = "unlock-recipe",
        recipe = "burner-mining-drill"
      },
      {
        type = "unlock-recipe",
        recipe = "wooden-chest"
      },
      {
        type = "unlock-recipe",
        recipe = "automation-science-pack"
      },
      {
        type = "unlock-recipe",
        recipe = "iron-gear-wheel"
      },
      {
        type = "unlock-recipe",
        recipe = "stone-furnace"
      },
      {
        type = "unlock-recipe",
        recipe = "iron-plate"
      },
      {
        type = "unlock-recipe",
        recipe = "copper-plate"
      }
    },
    unit =
    {
      count = 8,
      ingredients = {{"automation-science-pack", 1}},
      time = 1
    },
    order = "c-a"
  },
The issue here is that the technologies are set to enabled = false even though the items are available in game. This is causing an issue in mods that rely on the technology enabled flag.

Can this be changed?
Last edited by DRY411S on Sat Mar 02, 2019 10:20 am, edited 1 time in total.

User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5152
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: [0.17.3] Technology disabled at start that should be enabled?

Post by Klonan »

I don't quite understand the issue,
Mods are reading the technology prototype incorrectly and messing things up?

What is your proposed change to the prototype?

User avatar
DRY411S
Filter Inserter
Filter Inserter
Posts: 727
Joined: Sun Mar 13, 2016 9:48 am
Contact:

Re: [0.17.3] Technology disabled at start that should be enabled?

Post by DRY411S »

Yes it's hard to explain. :oops:

Something's going on in the on_init handler in my mod (when a saved game is loaded for the first time with my mod).
The mod uses reset_technology_effects() in the handler
The starting items in the game weren't attached to technologies in 0.16, but are in 0.17.

I'll try and get some lower level debug information from the mod.

User avatar
DRY411S
Filter Inserter
Filter Inserter
Posts: 727
Joined: Sun Mar 13, 2016 9:48 am
Contact:

Re: [0.17.3] Inconsistent technology/unlock-recipe behaviour

Post by DRY411S »

OK what's happening is this. I've changed the title of the bug report to align with what I've found:
  • For every recipe my mod finds, it adds a 'recycling' recipe.
  • If those recipes are unlocked by technologies, then my mod attaches my recipes to the same technologies, because I want my recipe unlocked at the same time.
  • These new technologies in 0.17 like the one above are never unlocked, and therefore my mod's recipes aren't unlocked either.
  • Hardcoded into the game though, the recipes in the new technologies are unlocked, even though the technology isn't.
I can workaround this, but it isn't really consistent, to have recipes that are shown as being unlocked by researching 'false' technologies, and then enabling the recipes anyway. :)

The force_technology_reset() is also going to produce some inconsistent behaviour, I would have thought.

User avatar
Impatient
Filter Inserter
Filter Inserter
Posts: 883
Joined: Sun Mar 20, 2016 2:51 am
Contact:

Re: [0.17.3] Inconsistent technology/unlock-recipe behaviour

Post by Impatient »

I would like to help solve this problem, as I use your mod and want it to work properly.

I have a first question to approach this systematically:

What does

Code: Select all

technology.enabled = true
signify? That it is available for research or that it is researched or generally speaking, that it and all its recipes are available in game or ... ?
https://wiki.factorio.com/Prototype/Technology#enabled

User avatar
DRY411S
Filter Inserter
Filter Inserter
Posts: 727
Joined: Sun Mar 13, 2016 9:48 am
Contact:

Re: [0.17.3] Inconsistent technology/unlock-recipe behaviour

Post by DRY411S »

Impatient wrote:
Sat Mar 02, 2019 1:47 pm
I would like to help solve this problem, as I use your mod and want it to work properly.

I have a first question to approach this systematically:

What does

Code: Select all

technology.enabled = true
signify? That it is available for research or that it is researched or generally speaking, that it and all its recipes are available in game or ... ?
https://wiki.factorio.com/Prototype/Technology#enabled
Thank you for your concern.

I have a fix in testing, but it is a workaround. And I can remove the workaround if this is accepted as a valid bug and fixed. It's just dangerous to have technologies in the game that cannot be researched, in my opinion. Other modders may have similar challenges.

Rseding91
Factorio Staff
Factorio Staff
Posts: 13247
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.17.3] Inconsistent technology/unlock-recipe behaviour

Post by Rseding91 »

Thanks for the report however nothing you're describing here is a bug.
  • Multiple Technologies can have the same effect (unlock recipe) with any combination of enabled/disabled/researched
  • A recipe can be enabled without a technology being researched that has the effect "unlock recipe"
What ever mod code you're using is simply incorrect.
If you want to get ahold of me I'm almost always on Discord.

User avatar
DRY411S
Filter Inserter
Filter Inserter
Posts: 727
Joined: Sun Mar 13, 2016 9:48 am
Contact:

Re: [0.17.3] Inconsistent technology/unlock-recipe behaviour

Post by DRY411S »

Thank you for confirming this is working as intended. I will adjust the code in my mod.

Post Reply

Return to “Not a bug”