disable recipe after researched a new Technologie

Place to get help with not working mods / modding interface.
Post Reply
BOFan80
Inserter
Inserter
Posts: 23
Joined: Thu Apr 21, 2016 6:44 pm
Contact:

disable recipe after researched a new Technologie

Post 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.
please notice that my natove language is german, so my english is not so good. Thx

Rseding91
Factorio Staff
Factorio Staff
Posts: 13204
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: disable recipe after researched a new Technologie

Post by Rseding91 »

You can listen to the research completed event and when the research you want is completed you disable the other one.
If you want to get ahold of me I'm almost always on Discord.

User avatar
prg
Filter Inserter
Filter Inserter
Posts: 947
Joined: Mon Jan 19, 2015 12:39 am
Contact:

Re: disable recipe after researched a new Technologie

Post by prg »

Automatic Belt (and pipe) Planner—Automate yet another aspect of constructing your factory!

BOFan80
Inserter
Inserter
Posts: 23
Joined: Thu Apr 21, 2016 6:44 pm
Contact:

Re: disable recipe after researched a new Technologie

Post 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
please notice that my natove language is german, so my english is not so good. Thx

User avatar
prg
Filter Inserter
Filter Inserter
Posts: 947
Joined: Mon Jan 19, 2015 12:39 am
Contact:

Re: disable recipe after researched a new Technologie

Post 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)
Automatic Belt (and pipe) Planner—Automate yet another aspect of constructing your factory!

BOFan80
Inserter
Inserter
Posts: 23
Joined: Thu Apr 21, 2016 6:44 pm
Contact:

Re: disable recipe after researched a new Technologie

Post 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
please notice that my natove language is german, so my english is not so good. Thx

Post Reply

Return to “Modding help”