Arch666Angel / mods

Angelsmods Repository
https://forums.factorio.com/viewforum.php?f=185
82 stars 61 forks source link

Recipes for explosives and nitroglycerin are not produced anywhere #888

Closed ThCompiler closed 1 year ago

ThCompiler commented 1 year ago

Describe the bug Recipes: solid-nitroglycerin, solid-trinitrotoluene, nitroglycerin, - are not produced at any plant.

What I found In the latest release, the chemistry category was removed for the craft category field in advanced chemical plant. Recipes for explosives At the same time, the chemistry category remained in the explosives recipe. Therefore, this recipe should only be available at a conventional chemical plant. But the game does not allow you to use this recipe due to the fact that the number of input liquids is 3. And such a number of inputs is only in an advanced chemical plant.

Recipes for nitroglycerin In this case, when changing the nitroglycerin recipe, the crafting_category field is set. Therefore, the category field remains unchanged and is saved with the value chemistry. And this recipe also has 3 liquids at the input and should be producing in an advanced chemical plant.

To Reproduce Information to reproduce the behavior:

  1. Game Version 1.1.74 (build 60256, win64) steam
  2. Modlist
    • base
    • AfraidOfTheDark
    • alien-biomes
    • alien-biomes-hr-terrain
    • angelsaddons-cab
    • angelsaddons-mobility
    • angelsaddons-newlocales
    • angelsaddons-storage
    • angelsbioprocessing
    • angelsindustries
    • angelsinfiniteores
    • angelsrefining
    • angelssmelting
    • blueprint_flip_and_turn
    • bobangel2021
    • bobassembly
    • bobelectronics
    • bobenemies
    • bobequipment
    • bobinserters
    • boblibrary
    • boblocale
    • boblogistics
    • bobmining
    • bobmodules
    • bobores
    • bobplates
    • bobpower
    • bobrevamp
    • bobtech
    • bobvehicleequipment
    • bobwarfare
    • CleanFloor
    • EvoGUI
    • flib
    • FNEI
    • helmod
    • LogisticTrainNetwork
    • miniloader
    • Nanobots
    • Squeak Through
    • stdlib
    • Todo-List

Screenshots Used FNEI mod to display information about recipes.

Recipes for explosives image image

Recipes for nitroglycerin image

Suspected issue in mod code angelspetrochem/prototypes/recipes/petrochem-solids.lua

    type = "recipe",
    name = "solid-nitroglycerin",
    category = "chemistry",
   ...
    type = "recipe",
    name = "solid-trinitrotoluene",
    category = "chemistry",

angelspetrochem/prototypes/buildings/advanced-chemical-plant.lua

    type = "assembling-machine",
    name = "advanced-chemical-plant",
    ...
    crafting_categories = { "advanced-chemistry" },

angelspetrochem/prototypes/global-override/bobwarfare.lua

 OV.patch_recipes({
    {
      name = "nitroglycerin",
      subgroup = "petrochem-rocket",
      order = "ib",
      ingredients = hide_sulfuric_nitric_acid_mixture
          and {
            { type = "fluid", name = "sulfuric-nitric-acid", amount = 0 }, -- was 30
            { type = "fluid", name = "liquid-sulfuric-acid", amount = 15 },
            { type = "fluid", name = "liquid-nitric-acid", amount = 15 },
          }
        or nil,
      crafting_category = hide_sulfuric_nitric_acid_mixture and "advanced-chemistry" or nil,
      crafting_machine_tint = angelsmods.functions.get_recipe_tints({
        "liquid-glycerol",
        "liquid-sulfuric-acid",
        "liquid-nitric-acid",
      }),
    },
  })
LovelySanta commented 1 year ago

Thanks for the report! This is fixed for the next release.

LovelySanta commented 1 year ago

Extended unit-test-009 in https://github.com/Arch666Angel/mods/commit/02c11b7006339726a9955580a41ad5f0612280e0 to catch this issue.

Unit test result using the master branch (without the fix in https://github.com/Arch666Angel/mods/commit/96d0a47923a13e04682e13b9b892a2d235d2b6f8):

Starting unit test 009.
    There is no suitable machine or character that can craft recipe "solid-nitroglycerin" (crafting category "chemistry").
    There is no suitable machine or character that can craft recipe "solid-trinitrotoluene" (crafting category "chemistry").
    There is no suitable machine or character that can craft recipe "bob-fertiliser" (crafting category "chemistry").
    There is no suitable machine or character that can craft recipe "nitroglycerin" (crafting category "chemistry").
Unit test 009 FAILED!

Reopening the issue for bob-fertiliser...

LovelySanta commented 1 year ago

Now passes unit test 9 in all test configurations!