Krastorio Legacy deprecated


Caution!!! Krastorio 2 is now available! Therefore Krastorio Legacy is no longer supported! This mod expands the endgame, adds 30+ HR buildings, 60+ technologies, new ores, new items and rebalances almost all vanilla game content, making it harder.

Overhaul
4 years ago
0.17 - 0.18
163

g [Fixed] Incompatibility with AAI Industry

Linver β˜†
4 years ago

Hi again, trying play with some mod I find this incompatibility with ur mod and AAI Industry:
https://puu.sh/DudZL/5a6f070961.png

The problem is that both add "power-armor" to ingredients of "power-armor-mk2".
Looking the code a bit i see that AAI Industry use a function that add or manipulate an ingredient of an existing recipe,
in our code u override the recipe with a new in the data.lua on line 1963.

AAI Industry do it in:
\prototypes\recipe\recipe-update.lua line 899:
if data.raw.armor["power-armor"] and data.raw.recipe["power-armor-mk2"] then
util.replace_or_add_ingredient(data.raw.recipe["power-armor-mk2"], nil, "power-armor", 1)
end

Could u make a compatibility update?
Like check if "power-armor" already is an ingredient of "power-armor-mk2",
if there's aai-industry installed not insert ingredient "power-armor" (so that aai-industry could do it)?

Thank u in advance

PS (file used):
aai-industry_0.3.17
Krastorio_1.0.13

4 years ago

No problems. I will do it very soon.

4 years ago
(updated 4 years ago)

Seems there is an issue with solar panels now.

"Error while running setup for recipe prototype "solar panel" recipe: Duplicate item ingredients are not allowed (glass exists 2 or more times)"

AAI industries adds its own sand and glass resources that also probably further complicate things. I have no idea but could they be overwritten with Krastorio's versions of the resources?

Linver β˜†
4 years ago
(updated 4 years ago)

It's true, if playing with space exploration installed this problem is solved because aai industry and space exploration make on start some compatibility procedure that help Krastorio too but, only with aai industry the problem appears.

The problem with sand and glass already solved, to be more precise aai industry and space exploration is developed by Earendel and he make it compatible by default using an his standard system

I solve this modifing on line 2533 in data.lua (in Krastorio):

if mods["space-exploration"] then

else

    table.insert(data.raw["recipe"]["solar-panel"].ingredients, 1, {name = "glass", amount = 10})
    table.insert(data.raw["recipe"]["small-lamp"].ingredients, 1, {name = "glass", amount = 1})

end

into:

if not mods["space-exploration"] then

    if not mods["aai-industry"] then

        table.insert(data.raw["recipe"]["solar-panel"].ingredients, 1, {name = "glass", amount = 10})

    end

    table.insert(data.raw["recipe"]["small-lamp"].ingredients, 1, {name = "glass", amount = 1})

end

Testing using:

Krastorio_1.0.15 (modified)
aai-industry_0.3.17

Krastorio_1.0.15 (modified)
space-exploration_0.1.63 (and dependency)

Krastorio_1.0.15 (modified)
aai-industry_0.3.17
space-exploration_0.1.63 (and dependency)

PS:

I see an interesting library in Earendel mods called data-util.lua, the function util.replace_or_add_ingredient solve this problem with similar mod that add the same ingredient to the same recipes, doing proper checks, to avoid these problems in future with other mods, I suggest to ask him if u could use it, Krastor

New response