Page 1 of 2

[MOD 0.12.x] Item Collectors

Posted: Sun Aug 17, 2014 1:15 am
by Rseding91
This is a very simple mod I quickly made for someone that collects items off the ground in a 50x50 area centered on the chest.

No screenshot of it because it's a simple chest (it uses the smart chest icon) - just place it where you want it to pick up stuff and it will do its thing.

Changelog:

Code: Select all

1.1.6: updated for Factorio 0.12.11
1.1.5: updated for 0.12 and full multi-surface support
1.1.4: improved performance
1.1.3: fixed MP desync bug
1.1.2: 0.11 compatible
1.1.1: collectors no-longer pick up items off belts
1.0.0: initial release
Current version: 1.1.6

Download [0.12+]:
Item Collectors_1.1.6.zip
(15.52 KiB) Downloaded 1442 times
Download [0.11.16+]:
Item Collectors_1.1.4.zip
(15.5 KiB) Downloaded 968 times

Re: [MOD 0.10.x] Item Collectors

Posted: Tue Aug 19, 2014 5:08 am
by starxplor
Does it know the difference between items on a belt and items on the ground?

Re: [MOD 0.10.x] Item Collectors

Posted: Tue Aug 19, 2014 6:33 am
by Rseding91
starxplor wrote:Does it know the difference between items on a belt and items on the ground?
It doesn't, but I have a version that I'll be uploading tomorrow that does.

EDIT: updated to 1.1.1 - the collectors now won't pick up items if they're on belts.

Re: [MOD 0.10.x] Item Collectors

Posted: Wed Aug 20, 2014 11:56 pm
by starxplor
Sweet, I will try this tonight after work, thanks!

Re: [MOD 0.10.x] Item Collectors

Posted: Thu Aug 21, 2014 6:06 am
by SHarper
Isn't this also included in the DY-Tech Demo ?

Does the in my opinion bugfix:

Code: Select all

table.remove(glob.itemCollectors, k)
if #glob.itemCollectors == 0 then
glob.itemCollectors = nil
Fix the Problem with Collectors not working if one is removed (seems to still be in the newest Release of Dy-Tech)

edit:

I also have a little Bug that some Items which seem to be on a belt get collected,
I'have tried to fix that using a bigger box (1.0 instead of 0.4 eg. 0.5) but this fix results in constantly happening Mirco-Laags.
I thinks its because every "Pickup-Tick" all ITEMS are checked if they are on a belt.

Maybe there is a way to exclude the Tiles with Belt before all items on Ground are counted.

Re: [MOD 0.10.x] Item Collectors

Posted: Thu Aug 21, 2014 6:10 am
by Rseding91
SHarper wrote:Isn't this also included in the DY-Tech Demo ?

Does the in my opinion bugfix:

Code: Select all

table.remove(glob.itemCollectors, k)
if #glob.itemCollectors == 0 then
glob.itemCollectors = nil
Fix the Problem with Collectors not working if one is removed (seems to still be in the newest Release of Dy-Tech)

DyTech demo? I know DyTech has item collectors but they're over complicated for what a item collector needs to do and someone wanted a item collector so I wrote this :)

Re: [MOD 0.10.x] Item Collectors

Posted: Thu Aug 21, 2014 6:25 am
by SHarper
Sorry, not Tech Demo its in the Core-Module....

I had a Bug with the Item-Collectors from DY-Tech stopping to Work for "no Reason".

So i dug into the Code (pretty much identical to ur code) and then fixed the problem by resetting the global var for the Collector (if entity mined)
I thought of the "glob.itemColl = nil" beeing the source of all evil, but didn't have time to test this.

Still there is the Question with the "item-on-belt" performance Issue, i think i will look for a method to avoid checking items that are on a "belt-tile"
e.g. create an Array for the Search-Box excluding Belt-Tiles which should increase performance. (but uses a little more memory)

Re: [MOD 0.10.x] Item Collectors

Posted: Thu Aug 21, 2014 2:18 pm
by Rseding91
SHarper wrote:Still there is the Question with the "item-on-belt" performance Issue, i think i will look for a method to avoid checking items that are on a "belt-tile"
e.g. create an Array for the Search-Box excluding Belt-Tiles which should increase performance. (but uses a little more memory)
The only method I've thought of that might work would be a rotatable pickup range so you simply don't have it checking an area with belts (or a very small area with belts instead of a large section of your base).

Re: [MOD 0.10.x] Item Collectors

Posted: Wed Oct 22, 2014 3:40 pm
by Boogieman14
I noticed this mod still seems to pick up items from underground belt exits. With my very limited lua skills, it looks like those should get skipped but looks like they don't.

Re: [MOD 0.10.x] Item Collectors

Posted: Wed Oct 22, 2014 6:29 pm
by Rseding91
Boogieman14 wrote:I noticed this mod still seems to pick up items from underground belt exits. With my very limited lua skills, it looks like those should get skipped but looks like they don't.
I should be able to fix that later today but in general it's best to keep the item collectors away from any belts if you value game performance at all :)

Re: [MOD 0.11.x] Item Collectors

Posted: Sat Nov 08, 2014 10:27 pm
by Rseding91
Updated to 0.11 and fixed a bug with MP desyncing while using the mod.

Re: [MOD 0.11.x] Item Collectors

Posted: Sat Nov 22, 2014 3:17 pm
by MrDrummer
Great mod! I would like one feature though... when you hover over the collector, for it to show the area.

Also, to make the area bigger, woulf i just change the "25"s in:

Code: Select all

~control.lua, line 59 and 60
		if collector.valid then
			items = game.findentitiesfiltered({area = {{x = collector.position.x - 25, y = collector.position.y - 25}, {x = collector.position.x + 25, y = collector.position.y + 25}}, name = "item-on-ground"})
to the radius i wish? I know the radius graphic would be wrong, but hey!

(I wama use this to collect artifacts when i attack mega bases, so then i don't have 100 large biters attacking me!

Re: [MOD 0.11.x] Item Collectors

Posted: Mon Nov 24, 2014 1:11 am
by Dodging_Rain
Yes that works though be warned that if you make the search radius too large and place it too near your base, it may grab stuff from nearby underground belts.

Re: [MOD 0.11.x] Item Collectors

Posted: Mon Mar 02, 2015 10:34 pm
by Rseding91
Updated to 1.1.4 - significant performance improvements and hopefully fixed the bug where it picked up items on belt-to-grounds.

Re: [MOD 0.11.x] Item Collectors

Posted: Mon Mar 02, 2015 11:04 pm
by Nagshell
So, would you recommend it to a friend using DyTech to collect bitters bodies? This friend of my who totally isn't me is not fond of making huge areas of belts and doing fancy stuff with walls to try to controll items laying on ground.

Re: [MOD 0.11.x] Item Collectors

Posted: Mon Mar 02, 2015 11:09 pm
by Rseding91
Nagshell wrote:So, would you recommend it to a friend using DyTech to collect bitters bodies? This friend of my who totally isn't me is not fond of making huge areas of belts and doing fancy stuff with walls to try to controll items laying on ground.
It does work well for that use.

Re: [MOD 0.11.x] Item Collectors

Posted: Wed Mar 04, 2015 1:51 pm
by darkshadow1809
Awesome man! Putting it in the modpack if you dont mind :) Great work!

Re: [MOD 0.11.x] Item Collectors

Posted: Wed Mar 04, 2015 2:29 pm
by nfcc08
Going to be so nice for collection of bodies on Dytech. I am curious though, does it act as a normal chest? (wooden/iron/steel)? The reason I ask is it would be nice if it would be possible to have a upgraded version as well that could be used in a Logistics system with robots as that could be a fully automated production of bodies in Dytech then :D

Re: [MOD 0.11.x] Item Collectors

Posted: Wed Mar 04, 2015 7:07 pm
by Rseding91
nfcc08 wrote:Going to be so nice for collection of bodies on Dytech. I am curious though, does it act as a normal chest? (wooden/iron/steel)? The reason I ask is it would be nice if it would be possible to have a upgraded version as well that could be used in a Logistics system with robots as that could be a fully automated production of bodies in Dytech then :D
You could just use an inserter into an active provider chest if that's what you wanted :)

Re: [MOD 0.11.x] Item Collectors

Posted: Mon May 04, 2015 9:52 am
by DOSorDIE
Is it possible to make a Filter what I want to collect?
Its Ok when i must change it in the .lua ... but who and what? (make 2 or 3 as sample)

Thanks