Multi-Product Recipe Details

by KvaNTy

Lists all product names in recipe description if there are more than one product in the recipe.

Utilities
4 years ago
0.16 - 1.1
13.2K

b Conflict with "Expanded Rocket Payloads Touched By An AngelBob"

6 years ago

Using both of these mods at the same time (with angel+bob mods) cause the following error:

https://i.imgur.com/yLXIRIU.png

6 years ago
(updated 6 years ago)

That's actually the problem I had.
You can probably fix it (unless those items add more localised strings...) by changing
if results ~= nil and #results > 1 then
in data-final-fixes
to
if results ~= nil and #results > 1 and #results < 9 then
for explanation:

I had a problem with some of angel's refining recipes (when mad clown used) which had 9 resulting items. The generated description had too many localised string and was crashing on startup. The game claims that 20(?) is the maximum and the limit was being exceeded. I fixed it by limiting the description generation to omit recipes with >=9 resulting items. It's hacky but may help some people.

6 years ago
      results = {
        {name = "iron-ore", amount = 30, probability = 0.50},
        {name = "iron-ore", amount = 10, probability = 0.30},
        {name = "iron-ore", amount = 40, probability = 0.05},
        {name = "copper-ore", amount = 20, probability = 0.35},
        {name = "copper-ore", amount = 50, probability = 0.05},
        {name = "nickel-ore", amount = 30, probability = 0.20},
        {name = "nickel-ore", amount = 50, probability = 0.05},
        {name = "bauxite-ore", amount = 20, probability = 0.25}, -- aluminium ore
        {name = "bauxite-ore", amount = 40, probability = 0.05}, -- aluminium ore
        {name = "cobalt-ore", amount = 10, probability = 0.10},
        {name = "cobalt-ore", amount = 30, probability = 0.05},
        {name = "gold-ore", amount = 15, probability = 0.15},
        {name = "gold-ore", amount = 30, probability = 0.01},
        mods["angelssmelting"] and {name = "platinum-ore", amount = 1, probability = 0.01},
        mods["angelssmelting"] and {name = "platinum-ore", amount = 5, probability = 0.001}
      },

Thats the code section of my mod that adds this. Yeah i could make it more condense but glad it isn't my "bug".

6 years ago

Well it depends on how you look at it. It wasn't me who made such a huge recipe. I'm joking.

Well, this limit is actually a serious problem. Not sure it even existed before 0.17. "localised_description" can't contain more than 20 element, and can't be longer than 200 symbols so plain text is not an option either.

Currently each product name has to be separated either by comma or new line symbol, so number of elements is basically results_count*2 plus two additional with formatting data. It gets worse it you enable "Show amounts and probability" option so it has to create one additional element per product.

There is nothing can be done atm to properly make it work in all circumstances. I hate such solutions, but looks like until this limit is raised or removed we just have to ignore such recipes.

New response