Page 1 of 1

Changing the pollution of an entitiy

Posted: Thu Apr 12, 2018 11:28 am
by M.Colcko
I'm absolutely new to modding (not only Factorio but in general) and I was trying to create a pollution tecchnology mod.
Problem is I've got no idea how to find the information i need to do that.
I've tried reading through the data.raw (https://gist.githubusercontent.com/Bilk ... 5200.16.35)
but i couldn't get any pollution entries related to electric-mining-drill.

So how do i aproach this problem?

Re: Changing the pollution of an entitiy

Posted: Thu Apr 12, 2018 2:49 pm
by Deadlock989
Pollution is a factor of an entity's energy use, so it's part of the energy_source definition, called emissions. For electric mining drills that's currently specified as:

Code: Select all

energy_source = {
        emissions = 0.09999999999999998,
        type = "electric",
        usage_priority = "secondary-input"
}
If you need more help, you'll need to describe what you're trying to do in more detail - it's not clear what "pollution technology" means.

Re: Changing the pollution of an entitiy

Posted: Thu Apr 12, 2018 4:42 pm
by darkfrei
No emissions (not tested):

Code: Select all

for type_name, type_prototype it pairs (data.raw) do
  for element_name, element_prototype it pairs (type_prototype) do
    if element_prototype.energy_source and element_prototype.energy_source.emissions then
      element_prototype.energy_source.emissions = 0
    end
  end
end