Page 1 of 1

Disable vanilla technology (landfill)

Posted: Wed Mar 08, 2017 1:42 pm
by Maniah
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?

Re: Disable vanilla technology (landfill)

Posted: Wed Mar 08, 2017 1:54 pm
by daniel34
In the control.lua of your scenario:

Code: Select all

game.forces["player"].technologies["landfill"].enabled = false

Re: Disable vanilla technology (landfill)

Posted: Wed Mar 08, 2017 2:40 pm
by Maniah
Thank you, unfortunately I'm getting an error:
Image

Re: Disable vanilla technology (landfill)

Posted: Wed Mar 08, 2017 3:14 pm
by daniel34
You need to call it from inside an event, e.g.

Code: Select all

script.on_event(defines.events.on_player_created, function(event)
  game.forces["player"].technologies["landfill"].enabled = false
end)
If you already have an on_player_created event then just add the line to it.

Re: Disable vanilla technology (landfill)

Posted: Wed Mar 08, 2017 3:32 pm
by Maniah
No errors now, but the technology is still available and still researchable.

Re: Disable vanilla technology (landfill)

Posted: Wed Mar 08, 2017 7:59 pm
by daniel34
Maniah wrote:No errors now, but the technology is still available and still researchable.
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.

Re: Disable vanilla technology (landfill)

Posted: Wed Mar 08, 2017 8:01 pm
by darkfrei
Maniah wrote:No errors now, but the technology is still available and still researchable.
What forces you have?

Re: Disable vanilla technology (landfill)

Posted: Thu Mar 09, 2017 4:15 am
by Maniah
That was the hint I needed! It needs to be disabled for every force.

Thank you!