Page 1 of 1

[Solved] Pre-Requisite Researchs

Posted: Thu Jul 30, 2015 1:19 pm
by ClayC
Hey guys, yet another problem I did add a few technologies dependent on each other so i added prerequisites = {"other-tech"} to make them unlock when the other technology was researched/

The issue is when you have let's say a series of tech1 to tech3 and you add each with the previous as prerequisite. Shouldn't this hide the tech2 and tech3 from the research list until tech1 is researched and then shows tech2 and after that is researched it shows tech3?

code example:

Code: Select all

data:extend({
  {
      type = "technology",
      name = "tech1",
      icon = "__MOD__/graphics/research1.png",
      effects =
      {
        {
            type = "unlock-recipe",
            recipe = "item1"
        }
      },
      prerequisites = {},
      unit =
      {
        count = 75,
        ingredients =
        {
          {"science-pack-1", 2},
          {"science-pack-2", 1},
          {"science-pack-3", 1}
        },
        time = 30
      }
  },
{
      type = "technology",
      name = "tech2",
      icon = "__MOD__/graphics/research2.png",
      effects =
      {
        {
            type = "unlock-recipe",
            recipe = "item2"
        }
      },
      prerequisites = {"tech1"},
      unit =
      {
        count = 75,
        ingredients =
        {
          {"science-pack-1", 2},
          {"science-pack-2", 1},
          {"science-pack-3", 1}
        },
        time = 30
      }
  },{
      type = "technology",
      name = "tech3",
      icon = "__MOD__/graphics/research3.png",
      effects =
      {
        {
            type = "unlock-recipe",
            recipe = "item3"
        }
      },
      prerequisites = {"tech3"},
      unit =
      {
        count = 75,
        ingredients =
        {
          {"science-pack-1", 2},
          {"science-pack-2", 1},
          {"science-pack-3", 1}
        },
        time = 30
      }
  }
})
Thanks in advance

Re: Pre-Requisite Researchs

Posted: Thu Jul 30, 2015 2:02 pm
by orzelek
Take a look at original game techs - you are missing upgrade property.

Add this:

Code: Select all

upgrade = true,
to all the techs including 1st one.

Re: Pre-Requisite Researchs

Posted: Thu Jul 30, 2015 2:24 pm
by ClayC
orzelek wrote:Take a look at original game techs - you are missing upgrade property.

Add this:

Code: Select all

upgrade = true,
to all the techs including 1st one.
snap how did I miss that! lol thanks alot man, you saved me a couple of hours for sure :)

EDIT: After adding it to all the researches they still appear without researching the one before

Re: [Solved] Pre-Requisite Researchs

Posted: Mon Aug 03, 2015 7:06 am
by ClayC
The fix was not only to add the upgrade = true but also to execute a command on my test save to reset recipes

Code: Select all

/c game.player.force.reset_recipes()