my idea where like
Code: Select all
on_console_command check /turbine
if technology x and x are researched then enable this technology
thanks in advance
Code: Select all
on_console_command check /turbine
if technology x and x are researched then enable this technology
Code: Select all
commands.add_command("check_something", nil, function() game.print("check something was called") end)
Code: Select all
script.on_event(defines.events.on_research_finished,function(event) --this code is just for scenario because some scenarios wont load the mod.
if event.research.name == "engine" then
game.player.force.technologies['wind-turbine'].enabled=true
end
if event.research.name == "electric-engine" and event.research.name == "wind-turbine" then
game.player.force.technologies['wind-turbine2'].enabled=true
end
if event.research.name == "advanced-electronics-2" and event.research.name == "wind-turbine2" then
game.player.force.technologies['wind-turbine3'].enabled=true
end
--old and janky
--if game.player.force.technologies['engine'].researched=true then
-- game.player.force.technologies['wind-turbine'].enabled=true
--end
--if game.player.force.technologies['wind-turbine'].researched=true and game.player.force.technologies['electric-engine'].researched=true then
--game.player.force.technologies['wind-turbine2'].enabled=true
--end
--if game.player.force.technologies['wind-turbine2'].researched=true and game.player.force.technologies['advanced-electronics-2'].researched=true then
--game.player.force.technologies['wind-turbine3'].enabled=true
--end
end)