Currently possible to change polution?

Place to get help with not working mods / modding interface.
Post Reply
midnight109
Long Handed Inserter
Long Handed Inserter
Posts: 55
Joined: Thu Jun 27, 2013 3:59 pm
Contact:

Currently possible to change polution?

Post by midnight109 »

Dosent seem possible yet, but so far can only think of creating a - pollution value, but dosent seem to work.
Curious if thier is a known way to make a entity absorb or remove pollution so long as it has power and water. I was considering making a Water Filtration system for the Air pollution you could place in areas that would take away some of the pollution passing by

midnight109
Long Handed Inserter
Long Handed Inserter
Posts: 55
Joined: Thu Jun 27, 2013 3:59 pm
Contact:

Re: Currently possible to change polution?

Post by midnight109 »

and I did see the emissions_per_tick = -0.0001 for trees, but looking for something diffrent. It seems it always functions, prob is I want the reductions to stop if the new entity losses key parts such as water or power. Using the plain emissions_per_tick = -0.0001 setup seems I can place it, and it just works, even without bing plugged into the grid

User avatar
FreeER
Smart Inserter
Smart Inserter
Posts: 1266
Joined: Mon Feb 18, 2013 4:26 am
Contact:

Re: Currently possible to change polution?

Post by FreeER »

simple :D , instead of

Code: Select all

--note taken from basic-mining-drill
emissions = 0.15 / 1.5,
simply make it negative. thus

Code: Select all

emissions = -0.15 / 1.5,
Now if you don't have electricity going to the mining drill it will not decrease the pollution. If you did this with a boiler it would need both water and coal to work, etc.

You could also call entity.setactive(false) if you needed to manually prevent it from working (in 0.7.1 this will change to entity.active=false) do note that entity is a reference to an actual entity, not the code you would write.

hmm, just saw that you said
midnight109 wrote:creating a - pollution value, but dosent seem to work.
but I did just test it with the electric mining drill and it did work perfectly, pollution levels started dropping (rather rapidly since the drills are my main polluters, besides boilers and electric furnaces).
<I'm really not active any more so these may not be up to date>
~FreeER=Factorio Modding
- Factorio Wiki
- My Factorio Modding Guide
- Wiki Modding Guide
Feel free to pm me :)
Or drop into #factorio on irc.esper.net

ficolas
Smart Inserter
Smart Inserter
Posts: 1068
Joined: Sun Feb 24, 2013 10:24 am
Contact:

Re: Currently possible to change polution?

Post by ficolas »

Can we use emition per tick on any entity or just on trees?

User avatar
FreeER
Smart Inserter
Smart Inserter
Posts: 1266
Joined: Mon Feb 18, 2013 4:26 am
Contact:

Re: Currently possible to change polution?

Post by FreeER »

ficolas wrote:Can we use emition per tick on any entity or just on trees?
well I tested putting it on mining drills and transport belts (using -1 instead of -0.0001 gives very quick dispersal for that area)...so I'd assume most entities will allow emissions_per_tick
<I'm really not active any more so these may not be up to date>
~FreeER=Factorio Modding
- Factorio Wiki
- My Factorio Modding Guide
- Wiki Modding Guide
Feel free to pm me :)
Or drop into #factorio on irc.esper.net

ficolas
Smart Inserter
Smart Inserter
Posts: 1068
Joined: Sun Feb 24, 2013 10:24 am
Contact:

Re: Currently possible to change polution?

Post by ficolas »

FreeER wrote:
ficolas wrote:Can we use emition per tick on any entity or just on trees?
well I tested putting it on mining drills and transport belts (using -1 instead of -0.0001 gives very quick dispersal for that area)...so I'd assume most entities will allow emissions_per_tick
Ya I know about assembling machines mining drills, boilers, trees etc.
But what about... A chest?
I cant try atm thats why I ask :)

kovarex
Factorio Staff
Factorio Staff
Posts: 8078
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: Currently possible to change polution?

Post by kovarex »

ficolas wrote:
FreeER wrote:
ficolas wrote:Can we use emition per tick on any entity or just on trees?
well I tested putting it on mining drills and transport belts (using -1 instead of -0.0001 gives very quick dispersal for that area)...so I'd assume most entities will allow emissions_per_tick
Ya I know about assembling machines mining drills, boilers, trees etc.
But what about... A chest?
I cant try atm thats why I ask :)
It will work

User avatar
FreeER
Smart Inserter
Smart Inserter
Posts: 1266
Joined: Mon Feb 18, 2013 4:26 am
Contact:

Re: Currently possible to change polution?

Post by FreeER »

ficolas wrote:But what about... A chest?
I cant try atm thats why I ask :)
I went ahead and tested both wooden and smart chests for you, both worked so I assume any other containers (or entity) would as well :D
<I'm really not active any more so these may not be up to date>
~FreeER=Factorio Modding
- Factorio Wiki
- My Factorio Modding Guide
- Wiki Modding Guide
Feel free to pm me :)
Or drop into #factorio on irc.esper.net

slpwnd
Factorio Staff
Factorio Staff
Posts: 1835
Joined: Sun Feb 03, 2013 2:51 pm
Contact:

Re: Currently possible to change polution?

Post by slpwnd »

There is two things:

1) emissions_per_tick They work for every entity and define a constant value that is emitted / absorbed every tick independent of the entity state.
2) Every energy source has emissions field. That defines emissions based on the energy it is producing. This can be used to make a pollution absorbing machine (that would be powered by the electric energy).

We don't have a concept for an assembling machine like entity that needs water yet. Generator cannot be used either because it doesn't take the energy from the energy source (hence doesn't pollute). But this (entities that need not only electricity but also some liquids) will come in the future.

Post Reply

Return to “Modding help”