[MOD 0.14.x] Trash Landfill

Topics and discussion about specific mods
Post Reply
zackman0010
Inserter
Inserter
Posts: 36
Joined: Wed May 18, 2016 8:34 pm
Contact:

[MOD 0.14.x] Trash Landfill

Post by zackman0010 »

Trash Landfill
Image

Description
Ever realize that you have a lot of useless stuff just laying around, clogging up your chests and/or inventory? The trash landfill mod allows you to throw those items away to allow them to degrade into pollution. Current pollution created is 5 per item, and items degrade approx 13000 ticks (216.67 seconds / 3.61 minutes) after they were thrown in. I originally made this mod to deal with certain byproducts in the Bob's Mod modpack, namely sodium hydroxide. The graphic is created from a bunch of vanilla items thrown together onto a darker colored version of the Field from Treefarm.

Features:
Get rid of unused items by letting them degrade into pollution

Future Plans (If I get around to them):
Adjustable rates of degradation
Adjustable pollution per item
More types of landfills, including one that burns trash to produce power (Cannot promise this will happen)

Known Bugs:
Do your best not to remove any items from the landfill after they are put in. My code only detects if every copy of a certain type of item is removed from the landfill. For example, if you put in 50 Iron Plate but later remove 25, the pollution produced will still be as if there were 50 Iron Plates in the landfill. Removing items could also cause other bugs that I didn't discover. I'm still trying to figure out ways around these.


Download:
https://mods.factorio.com/mods/zackman0 ... h-Landfill

Update Log:
v0.13.15 - Original
v1.1.1 - Changed version numbering scheme; Fixed possible desync caused by my lack of LUA knowledge
v1.1.2 - Updated for 0.14
v1.1.3 - Fixed bugs caused by a stupid mistake on my end. Resulted in crash due to negative numbers ending up in the item tables. Also a possible cause of desyncs.
Last edited by zackman0010 on Thu Dec 15, 2016 6:17 pm, edited 1 time in total.

Demosthenex
Fast Inserter
Fast Inserter
Posts: 144
Joined: Mon Mar 14, 2016 3:51 pm
Contact:

Re: [MOD 0.14.x] Trash Landfill

Post by Demosthenex »

Looks great, works great!

Until I just hit an error:

Code: Select all

 141.286 Error MainLoop.cpp:788: Exception at tick 40695000: Error while running event on_tick (ID 0)
Item stack count has to a be positive number
stack traceback:
        __ZCS-Trash-Landfill__/control.lua:58: in function 'delete_check'
        __ZCS-Trash-Landfill__/control.lua:92: in function <__ZCS-Trash-Landfill__/control.lua:74>
 141.286 Error ServerMultiplayerManager.cpp:93: MultiplayerManager failed: "Error while running event on_tick (ID 0)
Item stack count has to a be positive number
stack traceback:
        __ZCS-Trash-Landfill__/control.lua:58: in function 'delete_check'
        __ZCS-Trash-Landfill__/control.lua:92: in function <__ZCS-Trash-Landfill__/control.lua:74>"
 141.286 Info ServerMultiplayerManager.cpp:658: mapTick(40695000) changing state from(InGame) to(Failed)
/quit
It's corrupted the save (ie: it happens on each restart). I'm rolling back to a prior version.

To my knowledge the landfills are just automatically receiving from belts, not manually adding or removing.

zackman0010
Inserter
Inserter
Posts: 36
Joined: Wed May 18, 2016 8:34 pm
Contact:

Re: [MOD 0.14.x] Trash Landfill

Post by zackman0010 »

Can't say I've ever seen that error before while testing. I'll take a look at it next time I'm back at my laptop. Thank you for the report!

Demosthenex
Fast Inserter
Fast Inserter
Posts: 144
Joined: Mon Mar 14, 2016 3:51 pm
Contact:

Re: [MOD 0.14.x] Trash Landfill

Post by Demosthenex »

What an amazingly fast reply. OMG. I'm on IRC if you have questions or want a copy of the bad save.

We're playing Bob's + Angel's and wow did we need a trashcan! Plus I love the graphic, it's so cute!

zackman0010
Inserter
Inserter
Posts: 36
Joined: Wed May 18, 2016 8:34 pm
Contact:

Re: [MOD 0.14.x] Trash Landfill

Post by zackman0010 »

Lol. I always sign up for email notifications to topics I'm interested in. I was surprised when I saw this one is the one that got pinged.
Can you upload a copy of the save as well as either your modpack or a list of mods you're using? I'll need to see how the error happened to know how to prevent it in the future. I won't be back at my computer for a little while, though.
As for the graphic, it's just a little bit of copying graphics from the game, then resizing and rotating them. Lol. I wish I was better at graphic design so I could make better ones.

Demosthenex
Fast Inserter
Fast Inserter
Posts: 144
Joined: Mon Mar 14, 2016 3:51 pm
Contact:

Re: [MOD 0.14.x] Trash Landfill

Post by Demosthenex »

Demosthenex wrote:Looks great, works great!

Until I just hit an error:

Code: Select all

 141.286 Error MainLoop.cpp:788: Exception at tick 40695000: Error while running event on_tick (ID 0)
Item stack count has to a be positive number
stack traceback:
        __ZCS-Trash-Landfill__/control.lua:58: in function 'delete_check'
        __ZCS-Trash-Landfill__/control.lua:92: in function <__ZCS-Trash-Landfill__/control.lua:74>
 141.286 Error ServerMultiplayerManager.cpp:93: MultiplayerManager failed: "Error while running event on_tick (ID 0)
Item stack count has to a be positive number
stack traceback:
        __ZCS-Trash-Landfill__/control.lua:58: in function 'delete_check'
        __ZCS-Trash-Landfill__/control.lua:92: in function <__ZCS-Trash-Landfill__/control.lua:74>"
 141.286 Info ServerMultiplayerManager.cpp:658: mapTick(40695000) changing state from(InGame) to(Failed)
/quit
It's corrupted the save (ie: it happens on each restart). I'm rolling back to a prior version.

To my knowledge the landfills are just automatically receiving from belts, not manually adding or removing.
We just crashed again to the same error. My partner was wondering if it could be related to trying to landfill an item with a durability less than full?

zackman0010
Inserter
Inserter
Posts: 36
Joined: Wed May 18, 2016 8:34 pm
Contact:

Re: [MOD 0.14.x] Trash Landfill

Post by zackman0010 »

Could possibly be it. I've been on vacation, that's why it's taking me so long to check it out. Today is the earliest I've been able to get back to my laptop. I have some debug code in mind that can tell me exactly what's causing the problem, though.

zackman0010
Inserter
Inserter
Posts: 36
Joined: Wed May 18, 2016 8:34 pm
Contact:

Re: [MOD 0.14.x] Trash Landfill

Post by zackman0010 »

Demosthenex wrote:
Demosthenex wrote:Looks great, works great!

Until I just hit an error:

Code: Select all

 141.286 Error MainLoop.cpp:788: Exception at tick 40695000: Error while running event on_tick (ID 0)
Item stack count has to a be positive number
stack traceback:
        __ZCS-Trash-Landfill__/control.lua:58: in function 'delete_check'
        __ZCS-Trash-Landfill__/control.lua:92: in function <__ZCS-Trash-Landfill__/control.lua:74>
 141.286 Error ServerMultiplayerManager.cpp:93: MultiplayerManager failed: "Error while running event on_tick (ID 0)
Item stack count has to a be positive number
stack traceback:
        __ZCS-Trash-Landfill__/control.lua:58: in function 'delete_check'
        __ZCS-Trash-Landfill__/control.lua:92: in function <__ZCS-Trash-Landfill__/control.lua:74>"
 141.286 Info ServerMultiplayerManager.cpp:658: mapTick(40695000) changing state from(InGame) to(Failed)
/quit
It's corrupted the save (ie: it happens on each restart). I'm rolling back to a prior version.

To my knowledge the landfills are just automatically receiving from belts, not manually adding or removing.
We just crashed again to the same error. My partner was wondering if it could be related to trying to landfill an item with a durability less than full?
I found the error, and I have to say.. It was a really dumb one of me. Lol. I should I have a fix pushed in just a little bit. Fix is now uploaded, make sure you have v1.1.3
This is kind of a workaround fix, however. I'm not sure how the main problem that occurred happened. Somehow one of the item numbers in my internal storage became negative, which means it didn't get deleted from the table as intended. It's possible the fix I implemented will also prevent this from occurring, but I'm not positive about that.
This update will also include a migration script that will automatically fix the problem in existing saves. You won't have to restart your world.

Demosthenex
Fast Inserter
Fast Inserter
Posts: 144
Joined: Mon Mar 14, 2016 3:51 pm
Contact:

Re: [MOD 0.14.x] Trash Landfill

Post by Demosthenex »

zackman0010 wrote:
Demosthenex wrote:
Demosthenex wrote: I found the error, and I have to say.. It was a really dumb one of me. Lol. I should I have a fix pushed in just a little bit. Fix is now uploaded, make sure you have v1.1.3
This is kind of a workaround fix, however. I'm not sure how the main problem that occurred happened. Somehow one of the item numbers in my internal storage became negative, which means it didn't get deleted from the table as intended. It's possible the fix I implemented will also prevent this from occurring, but I'm not positive about that.
This update will also include a migration script that will automatically fix the problem in existing saves. You won't have to restart your world.
Excellent! Thanks for your hard work. We'll update immediately.

Post Reply

Return to “Mods”