Fluid Permutations

by spiwn

Rotate fluid inputs and outputs of buildings

Utilities
3 years ago
0.16 - 1.1
15.7K

b [Fixed] Error found

4 years ago

error in data-final-fixes.lua:334 attempt to concatenate field 'name' (a nil value)
function 'generateLocalisation'(line 334)
function 'generateRecipes' (line 390)
in main chunk (line 441)

this happens when this mod (https://mods.factorio.com/mod/MomoTweak) is active, and this other (https://mods.factorio.com/mod/MoreSciencePacks) is not, if both, none, or just the second one, everything works fine

4 years ago

I have a fix for this:
In data-final-fixes.lua, starting at line 331, change this

                    if recipe.results[1].type == "fluid" then
                        newRecipeLocalisedName = {"fluid-name."..recipe.results[1].name}
                    else
                        newRecipeLocalisedName = {"item-name."..recipe.results[1].name}
                    end

to this:

                    if recipe.results[1].type == "fluid" then
                        newRecipeLocalisedName = {"fluid-name."..recipe.results[1].name}
                    elseif recipe.results[1][1] then
                        newRecipeLocalisedName = {"item-name."..recipe.results[1][1]}
                    else
                        newRecipeLocalisedName = {"item-name."..recipe.results[1].name}
                    end

As per here, products can either have a type and name key like

{type = "item", name = "iron-plate", amount = 2}

or they can just do this:

{"iron-plate", 2}

The code I have changed accounts for this properly.

4 years ago

Thank you.
I have updated the code. I will update the mod in the next few days.

4 years ago
(updated 4 years ago)

0.1.2 Fixes this.
Had to change the code in a few more places :)

Edit: I see one more place where I must address this, but it is only for localization so I will leave it for next update.

New response