MetalsForYou

by Timeken

This is a collection of my mods inspired by Brevven's BZ mods

Mod packs
1 year, 8 months ago
1.1
5.80K

g Error on Startup

1 year, 9 months ago

I attempted to try this mod with all BZ mods, Brass Tacks, If I Had a Nickel, Space Exploration, Krastorio2, and some other mods.
I get a message saying:
Failed to load mods: Error while loading recipe prototype "zinc-plate" (recipe): Key "icon" not found in property tree at ROOT.recipe.zinc-plate
Modifications: Brass Tacks > MetalsForYou > Space Exploration

It appears to load properly without MetalsForYou.

1 year, 9 months ago

Should be fixed now

1 year, 9 months ago

Hmm. It still seems broken as of 0.1.2. I've also tested it with only Space Exploration (plus dependencies), Brass Tacks, and MetalsForYou, and the error still happens, so I don't think it was an issue with my original complicated modlist.

1 year, 9 months ago

I think it is fixed now

1 year, 9 months ago

So it seems to be still not fixed. But now the error is different depending on what mods I load it with. When I load with only Space Exploration, Brass Tacks, and MetalsForYou it gives:
Failed to load mods: Error in assignID: item-subgroup with name "engine-components" does not exist.
Source: turbine-blades (item)

When I load with SE, Krastorio 2, all BZ mods, Brass Tacks, If I Had A Nickel, and MetalsForYou it gives the error:
Failed to load mods: Error while loading recipe prototype "tantalum-capacitor" (recipe): Difficulty normal: Key "name" not found in property tree at ROOT.recipe.tantalum-capacitor.ingredients[1]
Modifications: MetalsForYou > Space Exploration

and when I try to load with the entire modpack I'm making, which also includes Them Thar Hills and Lasing Around, it gives the zinc-plate error I reported at the beginning.

By the way, thanks for your speedy updates; I'm sure it can't be easy to check against all the mod combinations that might or might not be present.

1 year, 9 months ago

The engine-components subgroup is only added by If I Had A Nickel.

The zinc-plate error can be fixed by either commenting this line in recipe-modify.lua:

util.add_product("zinc-plate", {name="indium-plate", amount=1, probability=0.6})

or by enabling Bismuth, which affects the same recipe. This suggests your add_product function is not setting the main_product of the recipe - recipes with multiple outputs need either an explicitly defined icon or a main_product to grab the icon from. (Oddly, the indium byproduct does not actually appear in the game when the line isn't commented and bismuth + K2 are loaded.)

The tantalum capacitor error is caused by this line in tantalum-recipe.lua:

tantalum_capacitor_ingredients = {{mods["bzlead"] and "lead-plate", 1}, {mods["manganese"] and "manganese-plate", 1}, {"tantalum-plate", 1}}

If bzlead or manganese is not installed, the first part of the ingredient specification is omitted, and you have an amount without an item. You want the syntax to be

mods["bzlead"] and {"lead-plate", 1}

which will omit the entire ingredient if the mod is not installed.

There are also a few places throughout your code where you check for mods["modname"] and "itemname" - this doesn't do what you want it to. "itemname" is just a string. You need to check whether the item prototype exists at data.raw.item["itemname"]

1 year, 9 months ago

This clarifies some of the errors I was getting, because I'm not using Manganese or Bismuth.

1 year, 9 months ago

I can now confirm it loads when I add both Bismuth and Manganese. Now that I can load it, I'm checking out some of the intermediate products and they look quite interesting. However it appears that "thoriated filament" has no uses according to FNEI.

1 year, 9 months ago
(updated 1 year, 9 months ago)

The engine-components subgroup is only added by If I Had A Nickel.
-That explains it, I was sure it was from AAI industry

The zinc-plate error can be fixed by either commenting this line in recipe-modify.lua:

util.add_product("zinc-plate", {name="indium-plate", amount=1, probability=0.6})

-I will see if I can fix it

The tantalum capacitor error is caused by this line in tantalum-recipe.lua:

tantalum_capacitor_ingredients = {{mods["bzlead"] and "lead-plate", 1}, {mods["manganese"] and "manganese-plate", 1}, {"tantalum-plate", 1}}

-Yupp I missed that

There are also a few places throughout your code where you check for mods["modname"] and "itemname" - this doesn't do what you want it to. "itemname" is just a string. You need to check whether the item prototype exists at data.raw.item["itemname"]
-I see, thanks for the help. You are very good at explaining things!

(not sure how this forum format works)

This thread has been locked.