Disable vanilla technology (landfill)

Place to get help with not working mods / modding interface.
Post Reply
Maniah
Inserter
Inserter
Posts: 40
Joined: Thu Mar 24, 2016 4:31 am
Contact:

Disable vanilla technology (landfill)

Post 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?

daniel34
Global Moderator
Global Moderator
Posts: 2761
Joined: Thu Dec 25, 2014 7:30 am
Contact:

Re: Disable vanilla technology (landfill)

Post by daniel34 »

In the control.lua of your scenario:

Code: Select all

game.forces["player"].technologies["landfill"].enabled = false
quick links: log file | graphical issues | wiki

Maniah
Inserter
Inserter
Posts: 40
Joined: Thu Mar 24, 2016 4:31 am
Contact:

Re: Disable vanilla technology (landfill)

Post by Maniah »

Thank you, unfortunately I'm getting an error:
Image

daniel34
Global Moderator
Global Moderator
Posts: 2761
Joined: Thu Dec 25, 2014 7:30 am
Contact:

Re: Disable vanilla technology (landfill)

Post 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.
quick links: log file | graphical issues | wiki

Maniah
Inserter
Inserter
Posts: 40
Joined: Thu Mar 24, 2016 4:31 am
Contact:

Re: Disable vanilla technology (landfill)

Post by Maniah »

No errors now, but the technology is still available and still researchable.

daniel34
Global Moderator
Global Moderator
Posts: 2761
Joined: Thu Dec 25, 2014 7:30 am
Contact:

Re: Disable vanilla technology (landfill)

Post 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.
quick links: log file | graphical issues | wiki

User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2903
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: Disable vanilla technology (landfill)

Post by darkfrei »

Maniah wrote:No errors now, but the technology is still available and still researchable.
What forces you have?

Maniah
Inserter
Inserter
Posts: 40
Joined: Thu Mar 24, 2016 4:31 am
Contact:

Re: Disable vanilla technology (landfill)

Post by Maniah »

That was the hint I needed! It needs to be disabled for every force.

Thank you!

Post Reply

Return to “Modding help”