A problem is however, that for some mods i can edit the tech(nology).lua so that the upgraded tiers (higher MKs) of technologies are hidden until the prerequisites have been researched.
For one mod I figured out, that I would have to set "upgrade = true", which I did and it worked.
The .lua where it works:
Code: Select all
data:extend({
{
type = "technology",
name = "wind-turbine-2",
icon = "__Wind_Turbine__/graphics/wind_turbine_icon-mk2.png",
effects =
{
{
type = "unlock-recipe",
recipe = "wind-turbine-mk2"
}
},
prerequisites = {},
upgrade = true,
unit =
{
count = 50,
ingredients =
{
{"science-pack-1", 1}
},
time = 5
},
order = "a-h-d",
},
{
type = "technology",
name = "wind-turbine-3",
icon = "__Wind_Turbine__/graphics/wind_turbine_icon-mk3.png",
effects =
{
{
type = "unlock-recipe",
recipe = "wind-turbine-mk3"
}
},
prerequisites = {"wind-turbine-2"},
upgrade = true,
unit =
{
count = 50,
ingredients =
{
{"science-pack-1", 1},
{"science-pack-2", 1}
},
time = 5
},
order = "a-h-d",
},
{
type = "technology",
name = "wind-turbine-4",
icon = "__Wind_Turbine__/graphics/wind_turbine_icon-mk4.png",
effects =
{
{
type = "unlock-recipe",
recipe = "wind-turbine-mk4"
}
},
prerequisites = {"wind-turbine-3"},
upgrade = true,
unit =
{
count = 50,
ingredients =
{
{"science-pack-1", 1},
{"science-pack-2", 1},
{"science-pack-3", 1}
},
time = 5
},
order = "a-h-d",
},
{
type = "technology",
name = "wind-turbine-5",
icon = "__Wind_Turbine__/graphics/wind_turbine_icon-mk5.png",
effects =
{
{
type = "unlock-recipe",
recipe = "wind-turbine-mk5"
}
},
prerequisites = {"wind-turbine-4"},
upgrade = true,
unit =
{
count = 50,
ingredients =
{
{"science-pack-1", 1},
{"science-pack-2", 1},
{"science-pack-3", 1},
{"alien-science-pack", 1}
},
time = 5
},
order = "a-h-d",
}
})
Code: Select all
data:extend({
{
type = "technology",
name = "force-fields",
icon = "__Force Fields__/graphics/forcefields.png",
prerequisites = {"alien-technology", "battery", "advanced-electronics", "optics"},
effects =
{
{
type = "unlock-recipe",
recipe = "forcefield-emitter"
},
{
type = "unlock-recipe",
recipe = "forcefield-tool"
}
},
unit =
{
count = 300,
ingredients =
{
{"science-pack-1", 1},
{"science-pack-2", 1}
},
time = 35,
},
order = "a-h-d"
},
{
type = "technology",
name = "green-fields",
icon = "__Force Fields__/graphics/green-forcefields.png",
prerequisites = {"force-fields"},
unit =
{
count = 150,
ingredients =
{
{"science-pack-1", 1},
{"science-pack-2", 1}
},
time = 30,
},
upgrade=true,
order = "a-h-d"
},
{
type = "technology",
name = "purple-fields",
icon = "__Force Fields__/graphics/purple-forcefields.png",
prerequisites = {"green-fields"},
unit =
{
count = 200,
ingredients =
{
{"science-pack-1", 1},
{"science-pack-2", 1}
},
time = 30,
},
upgrade = true,
order = "a-h-d"
},
{
type = "technology",
name = "red-fields",
icon = "__Force Fields__/graphics/red-forcefields.png",
prerequisites = {"purple-fields"},
unit =
{
count = 200,
ingredients =
{
{"science-pack-1", 1},
{"science-pack-2", 1},
{"science-pack-3", 1}
},
time = 30,
},
upgrade = true,
order = "a-h-d"
}
}
)
What am I doing wrong, trying to make those force-field upgrades only visible when the previous one has been researched?