shanemadden / factorio-deadlock-beltboxes-loaders

Other
8 stars 16 forks source link

Fuel with "burnt_result" are not returning stacked "burnt_result" #25

Open billbo99 opened 3 years ago

billbo99 commented 3 years ago

The Original fuel item

["charged-antimatter-fuel-cell"] = {
      burnt_result = "empty-antimatter-fuel-cell",
      fuel_category = "antimatter-fuel",
      fuel_value = "300GJ",
      icon = "__Krastorio2__/graphics/icons/items/charged-antimatter-fuel-cell.png",
      icon_mipmaps = 4,
      icon_size = 64,
      name = "charged-antimatter-fuel-cell",
      order = "r[uranium-processing]-b2[antimatter-fuel-cell]-a2[charged-antimatter-fuel-cell]",
      stack_size = 10,
      subgroup = "intermediate-product",
      type = "item"
    }

The STACKED fuel item should have

burnt_result = "deadlock-stack-empty-antimatter-fuel-cell"

["deadlock-stack-charged-antimatter-fuel-cell"] = {
      allow_decomposition = false,
      flags = {},
      fuel_category = "antimatter-fuel",
      fuel_value = "1500GJ",
      icons = {
        {
          icon = "__deadlock-beltboxes-loaders__/graphics/icons/square/blank.png",
          icon_size = 32,
          scale = 1
        },
        {
          icon = "__Krastorio2__/graphics/icons/items/charged-antimatter-fuel-cell.png",
          icon_mipmaps = 4,
          icon_size = 64,
          scale = 0.425,
          shift = {
            0,
            3
          }
        },
        {
          icon = "__Krastorio2__/graphics/icons/items/charged-antimatter-fuel-cell.png",
          icon_mipmaps = 4,
          icon_size = 64,
          scale = 0.425,
          shift = {
            0,
            0
          }
        },
        {
          icon = "__Krastorio2__/graphics/icons/items/charged-antimatter-fuel-cell.png",
          icon_mipmaps = 4,
          icon_size = 64,
          scale = 0.425,
          shift = {
            0,
            -3
          }
        }
      },
      localised_name = {
        "item-name.deadlock-stacking-stack",
        {
          "item-name.charged-antimatter-fuel-cell"
        },
        5
      },
      name = "deadlock-stack-charged-antimatter-fuel-cell",
      order = "117",
      stack_size = 10,
      subgroup = "stacks-intermediate-products",
      type = "item"
    }
shanemadden commented 3 years ago

Tricky - we could check for whether deadlock-stack-X exists where X is the burnt_result, but that depends on the integration mod creating the burnt-stuff stack first, which is fiddly. I suppose we could just assume that it'll always get created, but if an integration mod doesn't do that it'll crash the data stage - might be a breaking change with some existing ones, but probably the better route.

Deadlock989 commented 3 years ago

I think this would be better handled with another optional parameter in add_stack. Ideally add_stack should be taking a table as a parameter like add_tier does but changing that now would be annoying.

That said, burnt_results are so rarely used in mods, I don't think it's unreasonable for a third party mod to manually set that up themselves.