From e6a0f20feb600725e00c6088adb3fc1bdd378759 Mon Sep 17 00:00:00 2001 From: Simon Brodtmann Date: Sat, 15 Feb 2025 13:21:01 +0100 Subject: [PATCH] Prevent getting Stuck on Nauvis --- lignumis/locale/en/strings.cfg | 1 + lignumis/prototypes/content/technology.lua | 20 ++++------- lignumis/prototypes/integrations/vanilla.lua | 36 +++++--------------- lignumis/scripts/init.lua | 8 +++++ 4 files changed, 23 insertions(+), 42 deletions(-) diff --git a/lignumis/locale/en/strings.cfg b/lignumis/locale/en/strings.cfg index 4abc56b..2f99c1f 100644 --- a/lignumis/locale/en/strings.cfg +++ b/lignumis/locale/en/strings.cfg @@ -150,6 +150,7 @@ wood-logistics=Slow but automatic transportation of goods. tree-seeding=[entity=burner-agricultural-tower] allows planting seeds into seedable soil. Planted seeds grow into trees that can be harvested.\n[entity=tree-plant] can grow on grass and dirt. [entity=gold-stromatolite] can grow on [tile=natural-gold-soil]. active-noise-cancelling=Helps handling noise. quality-assembler=High-end assembler to craft only the finest quality machines using a special resource only found on Lignumis. +automation-science-pack=Leave Lignumis to enable advanced technology research. [modifier-description] basic-gun-turret-attack-bonus=Basic gun turret damage: +__1__ diff --git a/lignumis/prototypes/content/technology.lua b/lignumis/prototypes/content/technology.lua index d875637..49b5258 100644 --- a/lignumis/prototypes/content/technology.lua +++ b/lignumis/prototypes/content/technology.lua @@ -134,13 +134,9 @@ if not mods["planet-picker"] then } }, prerequisites = { "planet-discovery-nauvis" }, - unit = { - count = 50, - ingredients = { - { "wood-science-pack", 1 }, - { "steam-science-pack", 1 } - }, - time = 15 + research_trigger = { + type = "mine-entity", + entity = "iron-ore" } }, { @@ -160,13 +156,9 @@ if not mods["planet-picker"] then } }, prerequisites = { "planet-discovery-nauvis" }, - unit = { - count = 50, - ingredients = { - { "wood-science-pack", 1 }, - { "steam-science-pack", 1 } - }, - time = 15 + research_trigger = { + type = "mine-entity", + entity = "copper-ore" } } }) diff --git a/lignumis/prototypes/integrations/vanilla.lua b/lignumis/prototypes/integrations/vanilla.lua index d3c89f2..a815fd4 100644 --- a/lignumis/prototypes/integrations/vanilla.lua +++ b/lignumis/prototypes/integrations/vanilla.lua @@ -145,40 +145,20 @@ end if not mods["planet-picker"] then local automation_science_pack_technology = data.raw.technology["automation-science-pack"] - automation_science_pack_technology.prerequisites = { "planet-discovery-nauvis" } + automation_science_pack_technology.enabled = false + automation_science_pack_technology.visible_when_disabled = true automation_science_pack_technology.research_trigger = nil automation_science_pack_technology.unit = { - count = 100, - ingredients = { - { "wood-science-pack", 1 }, - { "steam-science-pack", 1 } - }, - time = 30 + count = 1, + ingredients = {}, + time = 1 } local electronics_technology = data.raw.technology["electronics"] electronics_technology.prerequisites = { "copper-processing" } - electronics_technology.research_trigger = nil - electronics_technology.unit = { - count = 50, - ingredients = { - { "wood-science-pack", 1 }, - { "steam-science-pack", 1 } - }, - time = 15 - } local steam_power_technology = data.raw.technology["steam-power"] steam_power_technology.prerequisites = { "iron-processing" } - steam_power_technology.research_trigger = nil - steam_power_technology.unit = { - count = 50, - ingredients = { - { "wood-science-pack", 1 }, - { "steam-science-pack", 1 } - }, - time = 15 - } local automation_technology = data.raw.technology["automation"] automation_technology.ignore_tech_cost_multiplier = false @@ -217,7 +197,7 @@ if not mods["planet-picker"] then } local robots_speed_technology_3 = data.raw.technology["worker-robots-speed-3"] - robots_speed_technology_3.prerequisites = { "worker-robots-speed-2", "chemical-science-pack" } + robots_speed_technology_3.prerequisites = { "robotics", "chemical-science-pack" } robots_speed_technology_3.unit = { count = 150, ingredients = { { "automation-science-pack", 1 }, { "logistic-science-pack", 1 }, { "chemical-science-pack", 1 } }, @@ -260,7 +240,7 @@ if not mods["planet-picker"] then weapon_speed_technology_2.unit.ingredients = table.deepcopy(physical_damage_technology_2.unit.ingredients) local physical_damage_technology_3 = data.raw.technology["physical-projectile-damage-3"] - physical_damage_technology_3.prerequisites = { "physical-projectile-damage-2", "logistic-science-pack" } + physical_damage_technology_3.prerequisites = { "military-2", "logistic-science-pack" } physical_damage_technology_3.unit.ingredients = { { "automation-science-pack", 1 }, { "logistic-science-pack", 1 } } table.insert(physical_damage_technology_3.effects, { type = "turret-attack", @@ -269,7 +249,7 @@ if not mods["planet-picker"] then }) local weapon_speed_technology_3 = data.raw.technology["weapon-shooting-speed-3"] - weapon_speed_technology_3.prerequisites = { "weapon-shooting-speed-2", "logistic-science-pack" } + weapon_speed_technology_3.prerequisites = { "military-2", "logistic-science-pack" } weapon_speed_technology_3.unit.ingredients = table.deepcopy(physical_damage_technology_3.unit.ingredients) local physical_damage_technology_4 = data.raw.technology["physical-projectile-damage-4"] diff --git a/lignumis/scripts/init.lua b/lignumis/scripts/init.lua index 7f49ab6..344edce 100644 --- a/lignumis/scripts/init.lua +++ b/lignumis/scripts/init.lua @@ -91,6 +91,14 @@ Init.events[defines.events.on_player_changed_surface] = function(event) if player and player.surface.name == "nauvis" then storage.nauvis_visited = true end + + if player and player.surface.name ~= "lignumis" and player.force then + local automation = player.force.technologies["automation-science-pack"] + if not automation.researched then + automation.enabled = true + automation.researched = true + end + end end