[0.18.24] Recipe prototype history shows wrong mods.

Bugs that are actually features.
Post Reply
MageKing17
Long Handed Inserter
Long Handed Inserter
Posts: 65
Joined: Thu Jun 01, 2017 6:52 pm
Contact:

[0.18.24] Recipe prototype history shows wrong mods.

Post by MageKing17 »

Sometimes, the prototype history for recipes indicates the wrong mod(s). As you can see from the screenshot below, it claims the recipe for the basic gun turret is modified by "Angel's Refining" and "Angel's Petro Chemical Processing". Needless to say, neither of those mods references gun-turret; as far as I can tell, it should say "Angel's Industries" and "Angel's Exploration (BETA)" instead. Save file demonstrating the bug is attached (it's just a freshly-started sandbox with all techs researched and cheat mode enabled). Only mods enabled are Angel's Industries and Angel's Exploration and their required dependencies.
Attachments
Recipe history bug confirmation.zip
Save file demonstrating bug.
(1.68 MiB) Downloaded 5 times
Cropped screenshot demonstrating bug.
Cropped screenshot demonstrating bug.
wrong_prototype_history.png (94.39 KiB) Viewed 212 times

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

Re: [0.18.24] Recipe prototype history shows wrong mods.

Post by Klonan »

A mod doesn't have to directly reference the prototype by name to influence it.
For instance you can just directly loop through the raw entity list and tweak all of them.

I don't see anything here that looks like a bug, and also I don't think it matters

The mod change system does a hash of all prototypes after every mod, so the mod doing something like changing an icon size or the recipe order will show as modifying the prototype

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

Re: [0.18.24] Recipe prototype history shows wrong mods.

Post by Rseding91 »

Base game generates this recipe for the turret:

Code: Select all

{
  "type": "recipe",
  "name": "gun-turret",
  "enabled": false,
  "energy_required": 8,
  "ingredients": 
  [
    
    [
      "iron-gear-wheel",
      10
    ],
    
    [
      "copper-plate",
      10
    ],
    
    [
      "iron-plate",
      20
    ]
  ],
  "result": "gun-turret"
}
Then angelsrefining changes it to this:

Code: Select all

{
  "type": "recipe",
  "name": "gun-turret",
  "enabled": false,
  "energy_required": 8,
  "ingredients": 
  [
    
    {
      "name": "iron-gear-wheel",
      "type": "item",
      "amount": 10
    },
    
    {
      "name": "copper-plate",
      "type": "item",
      "amount": 10
    },
    
    {
      "name": "iron-plate",
      "type": "item",
      "amount": 20
    }
  ],
  "result": "gun-turret"
}
Then angelspetrochem changes it to this:

Code: Select all

{
  "type": "recipe",
  "name": "gun-turret",
  "result": "gun-turret",
  "enabled": false,
  "energy_required": 8,
  "ingredients": 
  [
    
    {
      "type": "item",
      "name": "submachine-gun",
      "amount": 1
    },
    
    {
      "type": "item",
      "name": "iron-plate",
      "amount": 10
    },
    
    {
      "type": "item",
      "name": "copper-plate",
      "amount": 5
    }
  ]
}
So both mods are changing recipes around to zero end effect but because they change how the definition is ordered they get marked as changing things.
If you want to get ahold of me I'm almost always on Discord.

MageKing17
Long Handed Inserter
Long Handed Inserter
Posts: 65
Joined: Thu Jun 01, 2017 6:52 pm
Contact:

Re: [0.18.24] Recipe prototype history shows wrong mods.

Post by MageKing17 »

Rseding91 wrote:
Fri May 15, 2020 5:59 pm
So both mods are changing recipes around to zero end effect but because they change how the definition is ordered they get marked as changing things.
Then why isn't the one mod that very definitely actively changes the recipe (Angel's Exploration, which is replacing the iron gear wheels with the submachine gun and halving the copper plates) not listed? For that matter, why are the fields returning in different orders anyway, and this then counting as a modification?

EDIT: In hindsight, I probably should've mentioned that the reason I reported this in the first place was because I wanted to know what mod was changing the turret recipe to use a submachine gun, and the prototype history was supremely unhelpful in this regard; I guess I just assumed that it would be obvious that the turret recipe in the screenshot wasn't the vanilla recipe.

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

Re: [0.18.24] Recipe prototype history shows wrong mods.

Post by Rseding91 »

MageKing17 wrote:
Fri May 15, 2020 8:35 pm
Rseding91 wrote:
Fri May 15, 2020 5:59 pm
So both mods are changing recipes around to zero end effect but because they change how the definition is ordered they get marked as changing things.
Then why isn't the one mod that very definitely actively changes the recipe (Angel's Exploration, which is replacing the iron gear wheels with the submachine gun and halving the copper plates) not listed? For that matter, why are the fields returning in different orders anyway, and this then counting as a modification?

EDIT: In hindsight, I probably should've mentioned that the reason I reported this in the first place was because I wanted to know what mod was changing the turret recipe to use a submachine gun, and the prototype history was supremely unhelpful in this regard; I guess I just assumed that it would be obvious that the turret recipe in the screenshot wasn't the vanilla recipe.
angelspetrochem is the one that makes those changes.
If you want to get ahold of me I'm almost always on Discord.

MageKing17
Long Handed Inserter
Long Handed Inserter
Posts: 65
Joined: Thu Jun 01, 2017 6:52 pm
Contact:

Re: [0.18.24] Recipe prototype history shows wrong mods.

Post by MageKing17 »

Rseding91 wrote:
Sat May 16, 2020 12:03 am
MageKing17 wrote:
Fri May 15, 2020 8:35 pm
Rseding91 wrote:
Fri May 15, 2020 5:59 pm
So both mods are changing recipes around to zero end effect but because they change how the definition is ordered they get marked as changing things.
Then why isn't the one mod that very definitely actively changes the recipe (Angel's Exploration, which is replacing the iron gear wheels with the submachine gun and halving the copper plates) not listed? For that matter, why are the fields returning in different orders anyway, and this then counting as a modification?

EDIT: In hindsight, I probably should've mentioned that the reason I reported this in the first place was because I wanted to know what mod was changing the turret recipe to use a submachine gun, and the prototype history was supremely unhelpful in this regard; I guess I just assumed that it would be obvious that the turret recipe in the screenshot wasn't the vanilla recipe.
angelspetrochem is the one that makes those changes.
...Okay, so it turns out that Angel's Exploration sets up the recipe change through a utility function and then never actually tells those changes to execute, leaving them sitting in a table until the next Angel's mod happens to call the execute function, which just so happens to be petrochem. So this is, in fact, the fault of Angel's Exploration for not calling angelsmods.functions.OV.execute(). My bad; I had thought the OV.patch_recipes() function directly modified data.raw, but I must have been confusing it for RB.patch() (which OV.execute() calls).

Indeed, if I add an OV.execute() call to angelsexploration's data-updates.lua, the prototype history correctly shows that the recipe was modified by exploration instead of petrochem. I'll make sure to report this in the correct place: the Angel's mods subforum.

Post Reply

Return to “Not a bug”

Who is online

Users browsing this forum: No registered users