I'm new to Factorio modding. I'm currently making a custom scenario. I want to disable a vanilla technology (landfill).
Any idea how can I do this?
Disable vanilla technology (landfill)
Re: Disable vanilla technology (landfill)
In the control.lua of your scenario:
Code: Select all
game.forces["player"].technologies["landfill"].enabled = false
Re: Disable vanilla technology (landfill)
Thank you, unfortunately I'm getting an error:
Re: Disable vanilla technology (landfill)
You need to call it from inside an event, e.g.
If you already have an on_player_created event then just add the line to it.
Code: Select all
script.on_event(defines.events.on_player_created, function(event)
game.forces["player"].technologies["landfill"].enabled = false
end)
Re: Disable vanilla technology (landfill)
No errors now, but the technology is still available and still researchable.
Re: Disable vanilla technology (landfill)
That code only works when starting a new game with the scenario. I tested it by adding the line to the freeplay scenario (in the on_player_created event), worked without problems.Maniah wrote:No errors now, but the technology is still available and still researchable.
Re: Disable vanilla technology (landfill)
What forces you have?Maniah wrote:No errors now, but the technology is still available and still researchable.
Re: Disable vanilla technology (landfill)
That was the hint I needed! It needs to be disabled for every force.
Thank you!
Thank you!