[MOD 0.15.X] Pollution detector

Topics and discussion about specific mods

[MOD 0.15.X] Pollution detector

Postby Schorty » Sun Aug 16, 2015 6:05 pm

Image

Type: Mod
Name: Pollution detector
Description: Adds a sensor for pollution in the chunk for hooking it up into the circuit network
License: Beer-Ware License
Version: 0.4.0
Release: 2015-08-16
Tested-With-Factorio-Version: 0.16.7 (Steam)
Category: Item
Tags: sensor, pollution, circuit, network
Download-Url: Download

License
"THE BEER-WARE LICENSE" (Revision 42):
Daniel "Schorty" Krüger wrote this file. As long as you retain this notice you
can do whatever you want with this stuff. If we meet some day, and you think
this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp


Long description
Contents:
  • Adds a sensor for pollution for usage in circuit networks
  • Adds technology for pollution detector

This mod is intended to use for turning on and off some factories depending on pollution levels in the chunk where the detector is placed.


Pictures
Image
Image


Changelog
Changelog:
0.4.0 (current)
- Optera made it 0.16 compatible
- Updated with HD Graphics (credit goes to Optera aswell)

0.3.0
- Rewrite by Optera for enhanced performance

0.2.3
- Made it 0.15 compatible

0.2.2
- Made it 0.14 compatible

0.2.1
- Performance update (Thanks to optera for pointing this out). Pollution detector now updates once per second/Every 60 ticks

0.2.0
- Updated to fit modding changes made in Patch 0.13.0

0.1.2
- Updated to fit modding changes made in Patch 0.12.11

0.1.1
- Fixed a bug, that prevented pollution detectors from working after loading a saved game (reported by Zeeth_Kyrah)

0.1.0
- Added the basic contents of the mod (Entity, Technology, Items)
Last edited by Schorty on Wed Dec 27, 2017 3:54 pm, edited 10 times in total.
Tired of not being able to reduce the pollution? Try the Air-Filter-Mod
With this, you are able to use the pollution levels in your circuit network: Pollution detector
User avatar
Schorty
Fast Inserter
Fast Inserter
 
Posts: 171
Joined: Tue Aug 12, 2014 10:29 am

Re: [MOD 0.12.X] Pollution detector

Postby Zeeth_Kyrah » Wed Aug 19, 2015 1:50 pm

This is a pretty cool mod. I'm using 0.12.3 with it, and it's working well. I will say I've had a problem: when I'm loading a saved level, the detectors lock up and display a single value instead of a continuous measurement. I have to remove and replace to get them working again, which also means re-adding the signal wire they're connected to. I'm pretty sure it's a simple on-load statement to reset the detector when the level is started and the entities are already placed. Could you take care of that, please?
Planned projects: Energy Crystals Plus, Minor Fluid Handling, Small electric furnaces
(high-energy materials and assembler, fluid void burner and small tank, tiny and slow furnaces with charcoal)
Zeeth_Kyrah
Long Handed Inserter
Long Handed Inserter
 
Posts: 66
Joined: Tue Jan 21, 2014 10:05 pm

Re: [MOD 0.12.X] Pollution detector

Postby Schorty » Wed Aug 19, 2015 1:53 pm

Oh, haven't noticed this. I'll have a look into this. Thanks for the report :)
Tired of not being able to reduce the pollution? Try the Air-Filter-Mod
With this, you are able to use the pollution levels in your circuit network: Pollution detector
User avatar
Schorty
Fast Inserter
Fast Inserter
 
Posts: 171
Joined: Tue Aug 12, 2014 10:29 am

Re: [MOD 0.12.X] Pollution detector

Postby Schorty » Wed Aug 19, 2015 4:09 pm

Aaaaaand its fixed. At least its working for me now. Please let me know if its working for you, aswell :)
Tired of not being able to reduce the pollution? Try the Air-Filter-Mod
With this, you are able to use the pollution levels in your circuit network: Pollution detector
User avatar
Schorty
Fast Inserter
Fast Inserter
 
Posts: 171
Joined: Tue Aug 12, 2014 10:29 am

Re: [MOD 0.12.X] Pollution detector

Postby Zeeth_Kyrah » Thu Aug 20, 2015 11:40 pm

I game the updated version a try today, and it works! Thank you. This is just what I needed to track pollution counts. I combine it with the Nixie Tubes mod to get a continuous readout, and then when pollution is high in a chunk, I have smart inserters put clean filters in the air filter machines near my highest-polluting chunks. Saves time, energy, and the coal I'd otherwise spend recycling filters when I don't need to.

If I weren't using the air filters mod, I'd still want this, so I could do things like disable high energy-cost or high-pollution devices when their pollution reaches certain chunks I want to keep clean.
Planned projects: Energy Crystals Plus, Minor Fluid Handling, Small electric furnaces
(high-energy materials and assembler, fluid void burner and small tank, tiny and slow furnaces with charcoal)
Zeeth_Kyrah
Long Handed Inserter
Long Handed Inserter
 
Posts: 66
Joined: Tue Jan 21, 2014 10:05 pm

Re: [MOD 0.12.X] Pollution detector

Postby Devildog » Sun Sep 06, 2015 5:40 am

@Schorty, Adding to the mod pack version 0.2.0
Last edited by Devildog on Fri Sep 11, 2015 7:19 pm, edited 1 time in total.
Image
Check Out Factorio Mod Madness 2.0 Here : http://bit.ly/1afTDl0
Mod Madness ModPack
User avatar
Devildog
Fast Inserter
Fast Inserter
 
Posts: 170
Joined: Tue Aug 19, 2014 8:19 pm
Location: Dallas, Texas

Re: [MOD 0.12.X] Pollution detector

Postby Schorty » Sun Sep 06, 2015 9:37 am

Yeah, go ahead man. :)
Tired of not being able to reduce the pollution? Try the Air-Filter-Mod
With this, you are able to use the pollution levels in your circuit network: Pollution detector
User avatar
Schorty
Fast Inserter
Fast Inserter
 
Posts: 171
Joined: Tue Aug 12, 2014 10:29 am

Re: [MOD 0.12.X] Pollution detector

Postby mrtux » Sat Dec 26, 2015 2:31 pm

Will there be a release for 0.12.20?
If only my thesis could be done in Factorio …
mrtux
Long Handed Inserter
Long Handed Inserter
 
Posts: 53
Joined: Thu Dec 04, 2014 10:04 pm

Re: [MOD 0.12.X] Pollution detector

Postby Dr. Walrus » Wed Dec 30, 2015 6:55 pm

mrtux wrote:Will there be a release for 0.12.20?


The 12.11 update broke the mod. I got it working by replacing game.on_event with script.on_event in the control.lua file.

This is my control.lua file from the pollution detector mod on my computer that i edited. it seems to work fine for me. If you replace the file that comes with the mod with this one the mod should work.
http://www.mediafire.com/download/xlnsw ... ontrol.lua
Visit my profile on mods.factorio to see some unique, off the wall mods: Mod page for madmaster5000 (me)

Older mods:
Pressure Plates
User avatar
Dr. Walrus
Long Handed Inserter
Long Handed Inserter
 
Posts: 94
Joined: Fri Nov 20, 2015 6:30 am

Re: [MOD 0.12.X] Pollution detector

Postby Alexs » Mon Jan 25, 2016 2:32 pm

@ dr.walrus - thx
Alexs
Fast Inserter
Fast Inserter
 
Posts: 101
Joined: Sun Sep 07, 2014 9:46 am

Re: [MOD 0.12.X] Pollution detector

Postby miturion » Tue Feb 02, 2016 7:49 pm

this is a nice idea. Better than reading red color tones
miturion
Long Handed Inserter
Long Handed Inserter
 
Posts: 68
Joined: Mon Aug 03, 2015 5:46 pm

Re: [MOD 0.12.X] Pollution detector

Postby ares0027 » Sun Mar 06, 2016 3:58 am

not working right now;

Image
ares0027
Long Handed Inserter
Long Handed Inserter
 
Posts: 63
Joined: Sun May 04, 2014 6:48 pm

Re: [MOD 0.12.X] Pollution detector

Postby daniel34 » Sun Mar 06, 2016 3:07 pm

ares0027 wrote:not working right now;

Image

Dr. Walrus wrote:The 12.11 update broke the mod. I got it working by replacing game.on_event with script.on_event in the control.lua file.

This is my control.lua file from the pollution detector mod on my computer that i edited. it seems to work fine for me. If you replace the file that comes with the mod with this one the mod should work.
http://www.mediafire.com/download/xlnsw ... ontrol.lua
daniel34
Global Moderator
Global Moderator
 
Posts: 2741
Joined: Thu Dec 25, 2014 7:30 am
Location: Austria

Re: [MOD 0.12.X] Pollution detector

Postby Schorty » Sun Mar 06, 2016 3:50 pm

Thanks for pointing that out. I've overlooked the last hint on this. Will have a look at the bug!
Tired of not being able to reduce the pollution? Try the Air-Filter-Mod
With this, you are able to use the pollution levels in your circuit network: Pollution detector
User avatar
Schorty
Fast Inserter
Fast Inserter
 
Posts: 171
Joined: Tue Aug 12, 2014 10:29 am

Re: [MOD 0.12.X] Pollution detector

Postby Schorty » Sun Mar 06, 2016 4:53 pm

Mod has been updated. It will work now. Sorry for the inconvinience!

Greetings,
Schorty
Tired of not being able to reduce the pollution? Try the Air-Filter-Mod
With this, you are able to use the pollution levels in your circuit network: Pollution detector
User avatar
Schorty
Fast Inserter
Fast Inserter
 
Posts: 171
Joined: Tue Aug 12, 2014 10:29 am

Bug: pollution detector

Postby 1nf3ct3d » Tue Mar 15, 2016 2:09 pm

It says _ _ pollution-detector_ _/ control.lua6: attempt to index global "game" (a nil value)
when i try to load a game or start a new one

i have to delete bobs mod and c&p the modpack in again so it works again.

any solutions for this?
1nf3ct3d
Manual Inserter
Manual Inserter
 
Posts: 3
Joined: Tue Mar 15, 2016 2:02 pm

Re: Bug: pollution detector

Postby daniel34 » Tue Mar 15, 2016 2:12 pm

You have an old version of pollution detector installed, update or delete it:
[MOD 0.12.X] Pollution detector

EDIT: wasn't sure where to move this topic (was in Bob's mods), so just merged it to here.
daniel34
Global Moderator
Global Moderator
 
Posts: 2741
Joined: Thu Dec 25, 2014 7:30 am
Location: Austria

Re: [MOD 0.13.X] Pollution detector

Postby Schorty » Tue Jun 28, 2016 9:16 am

This mod has just been updated to match requirements of Factorio 0.13

Just download version 0.2.0!
Tired of not being able to reduce the pollution? Try the Air-Filter-Mod
With this, you are able to use the pollution levels in your circuit network: Pollution detector
User avatar
Schorty
Fast Inserter
Fast Inserter
 
Posts: 171
Joined: Tue Aug 12, 2014 10:29 am

Re: [MOD 0.13.X] Pollution detector

Postby Optera » Tue Jul 05, 2016 11:35 am

Having detectors all over the base seems to be very taxing on my game.
20160704172549_1.jpg
20160704172549_1.jpg (1.09 MiB) Viewed 12324 times

Reducing the update interval to every 60 ticks made the time drop from ~4.5 to ~0.04
Code: Select all
script.on_event(defines.events.on_tick, function(event)
  ticks = ticks + 1
  if ticks >= 60 then
    ticks = 0
    for i, pollution_detector in ipairs(pollution_detectors) do
     setPollutionValue(pollution_detector)
   end   
  end
end)

lua isn't really my thing, so there might be better ways to achieve that.
My Mods:
User avatar
Optera
Smart Inserter
Smart Inserter
 
Posts: 1484
Joined: Sat Jun 11, 2016 6:41 am
Location: Österreich

Re: [MOD 0.13.X] Pollution detector

Postby Schorty » Tue Jul 05, 2016 4:35 pm

You are probably right.. Once per Tick isn't really needed. I'll update the mod right away. Thanks for pointing this out!
Tired of not being able to reduce the pollution? Try the Air-Filter-Mod
With this, you are able to use the pollution levels in your circuit network: Pollution detector
User avatar
Schorty
Fast Inserter
Fast Inserter
 
Posts: 171
Joined: Tue Aug 12, 2014 10:29 am

Next

Return to Mods

Who is online

Users browsing this forum: Kitsune and 1 guest