Page 1 of 1

disable recipe after researched a new Technologie

Posted: Mon May 23, 2016 5:12 pm
by BOFan80
is it possible to disable a recipe or technologie after researched an other technolgie?

for example i researched technoligie a and after succesfull resarched this technolige the game disabled technologie b to research.

Like a decision in a techtree.

Re: disable recipe after researched a new Technologie

Posted: Mon May 23, 2016 5:17 pm
by Rseding91
You can listen to the research completed event and when the research you want is completed you disable the other one.

Re: disable recipe after researched a new Technologie

Posted: Mon May 23, 2016 5:18 pm
by prg

Re: disable recipe after researched a new Technologie

Posted: Mon May 23, 2016 5:23 pm
by BOFan80
ok thx, but i need a little bit more help, i am an absolut noob in modding with lua scripts

can you please post a code, so i can understand it?

after researched technology "Superassambler" the game schould disable the Technogie or recipes from the logistic-robot

Re: disable recipe after researched a new Technologie

Posted: Mon May 23, 2016 5:27 pm
by prg

Code: Select all

script.on_event(defines.events.on_research_finished, function(event)
    if event.research.name == "some-tech" then
        event.research.force.technologies["other-tech"].enabled = false
    end
end)

Re: disable recipe after researched a new Technologie

Posted: Mon May 23, 2016 5:45 pm
by BOFan80
prg wrote:

Code: Select all

script.on_event(defines.events.on_research_finished, function(event)
    if event.research.name == "some-tech" then
        event.research.force.technologies["other-tech"].enabled = false
    end
end)
thx that helps