Changing the pollution of an entitiy

Place to get help with not working mods / modding interface.
M.Colcko
Inserter
Inserter
Posts: 21
Joined: Sun Dec 04, 2016 7:23 am
Contact:

Changing the pollution of an entitiy

Post 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?
User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2529
Joined: Fri Nov 06, 2015 7:41 pm

Re: Changing the pollution of an entitiy

Post 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.
User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2905
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: Changing the pollution of an entitiy

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

Return to “Modding help”