[0.10.x] and [0.11.x] Scrap Mod - now with recycling!

Topics and discussion about specific mods
Schmendrick
Fast Inserter
Fast Inserter
Posts: 222
Joined: Wed Apr 30, 2014 11:17 pm
Contact:

[0.10.x] and [0.11.x] Scrap Mod - now with recycling!

Post by Schmendrick »

I have been working on a small mod that is mostly complete and should answer, to a limited extent, the demand people have for recycling machines: An structure that is destroyed drops (some of) its ingredients, down to and including ore, which will need to be re-smelted ("purified") to be reused. The mod affects everything that can be crafted, placed, and picked up: crashing cars to test this was pretty fun.

It excludes liquid ingredients (so something using sulfuric acid would never drop sulfur) and will not break down any recipe of type "chemistry" or "oil-processing;" this may change in the future depending on how the game changes.

As separate but similar effect, it also gives trees a wood drop (less than their minable/choppable result - most trees will drop between 0 and 3 wood instead of their nominal yield of 5), so deforestation projects will leave a lot of wood on the ground - this may or may not be a pleasant side effect, depending on your disposition regarding wood.

So far, I'm pretty happy with it.

Current concerns:
  • Mod load order - doesn't affect mods that load after it, of course. Mods which load after it and alter basic game recipes will make it inconsistent with the modified recipes. However, it should work well with any mods it does get processed after. update: should work with F-mod and DyTech
  • Any item with multiple recipes may be processed weirdly - Scrap Mod only uses the first recipe it encounters. In current vanilla this is not an issue, but it could become one later or with mods.
  • Items with less than one of an ingredient per item and/or recipes in their chain containing very few ingredients (such as telephone poles) could be set either have zero potential drops or percentage chances to drop each of its intermediate ingredients (a telephone pole built from 1/2 unit of wood and 1/2 unit of copper having small chances to drop each of: processed wood, raw wood, copper cable, copper plate, and copper ore), so if the game "rolls" well, the scrap could potentially be more than was input). I'm not sure which way to go on this; while it enables weird situations where a net gain is provided, each drop's probability is small enough that statistically over time this should not be an issue (even accounting for productivity modules) but it does make for the odd inconsistency. The currently uploaded version allows for these possible overdrops.
  • This adds loot entries to buildings, none of which have drops in vanilla. If a mod or future development grants buildings drops, together the result will probably be too much.
  • Construction robots replacing a destroyed building will also overwrite the scrap, making Scrap Mod less useful. I am considering adding a collector item such as found in other mods to help with this. Bot collection behavior in the future would be nice.
  • Batteries, as a "chemical" recipe, would currently be considered a base ingredient except that I have coded an ugly exception for them to generate copper and iron scrap. Commentary in the lua files suggests batteries will be changed to an assembler process, at which point this blemish can be removed.
  • Because this mod changes basically every placeable building, those buildings will show up with the mod's tag on it, which could be distracting, annoying, or confusing, especially when combined with other mods.
Version 0.2.0
  • Recycling - introduces the recycler, a furnace-like item that can reduce anything placed in it to ore or scrapmetal, which can be separated in an assembling machine to component ores with a little sulfuric acid (currently only supports copper and iron, won't give you back any of the special stuff other mods may add).
  • Improved recipe parsing - items should never drop more than their ingredients could make, ever.
  • Chest contents reclamation - when chests (or vehicles) are destroyed, spill a portion of their contents to the ground. This includes fuel inventory and modules.
0.2.1: added a bunch of optional prerequisites, to encourage Scrap Mod to be loaded last.

0.2.2:this version works with Factorio 0.11.x

Considered additions:
  • Collectors, as mentioned above
Attachments
scrapmod_0.2.1.zip
(15.11 KiB) Downloaded 843 times
Last edited by Schmendrick on Sat Nov 01, 2014 5:59 am, edited 11 times in total.
Like my mods? Check out another! Or see older, pre-0.12.0 mods.

Airat9000
Smart Inserter
Smart Inserter
Posts: 1377
Joined: Fri Mar 28, 2014 12:32 am
Contact:

Re: Recycling? Here's some scrap...

Post by Airat9000 »

screen!!

Schmendrick
Fast Inserter
Fast Inserter
Posts: 222
Joined: Wed Apr 30, 2014 11:17 pm
Contact:

Re: Recycling? Here's some scrap...

Post by Schmendrick »

Don't drink and drive, kids.
Oops...
Oops...
crash.png (704.6 KiB) Viewed 29712 times
I got so angry at the wall I got a little crazy with my shotgun. It was all a drunken blur, and when I woke up the next day...

(Also the Assembly Machine 2 got magically upgraded to a 3, because I thought the scrap would be more impressive, and that's where the speed module came from. Modules operating in machines are just lost.)
Is this all that is left?
Is this all that is left?
scrap.png (729.76 KiB) Viewed 29712 times
By the way, protect your rocket defense.
Expensive.
Expensive.
rocketdefense.png (316.16 KiB) Viewed 29712 times
Like my mods? Check out another! Or see older, pre-0.12.0 mods.

User avatar
pantong51
Manual Inserter
Manual Inserter
Posts: 2
Joined: Thu May 15, 2014 6:43 pm
Contact:

Re: Recycling? Here's some scrap...

Post by pantong51 »

looks amazing! a good way of getting resources backas well. I'm a down load it soon!
Starting Twitch Streamer! Check me out at www.twitch.tv/pantong51

AndaleTheGreat
Inserter
Inserter
Posts: 38
Joined: Thu May 15, 2014 1:15 pm
Contact:

Re: Recycling? Here's some scrap...

Post by AndaleTheGreat »

good stuff

thebiftek
Manual Inserter
Manual Inserter
Posts: 1
Joined: Fri May 16, 2014 11:32 am
Contact:

Re: Recycling? Here's some scrap...

Post by thebiftek »

Oh yes

Schmendrick
Fast Inserter
Fast Inserter
Posts: 222
Joined: Wed Apr 30, 2014 11:17 pm
Contact:

Re: Recycling? Here's some scrap...

Post by Schmendrick »

Update, mainly for DyTech and F-mod users!

Changelog: 0.1.1:
  • Added "dependencies" (half-assedly requiring v1.0.0) for F-mod and DyTech and handling (or otherwise) for their recipe types, so it should create appropriate scrap for their machines. Increased specificity for recipe type parsing to avoid circular references (unpacking, for example) and consumed resources (sand in gem polishing).
  • Altered loot formula a little to reduce the potential for "bonus item drop" weirdness. It can still happen, but should be rarer.
If any F-mod or DyTech users encounter any issues, please let me know.
Like my mods? Check out another! Or see older, pre-0.12.0 mods.

User avatar
darius456
Fast Inserter
Fast Inserter
Posts: 222
Joined: Thu Jan 02, 2014 6:33 am
Contact:

Re: Recycling? Here's some scrap...

Post by darius456 »

Check your zip file... I think that there are file missing. Zip contain only info.json and data.lua.
Lenovo Y580 8GB Ram GF660m 128GB SSD W7

Schmendrick
Fast Inserter
Fast Inserter
Posts: 222
Joined: Wed Apr 30, 2014 11:17 pm
Contact:

Re: Recycling? Here's some scrap...

Post by Schmendrick »

That's all it needs. Data.lua parses the recipes and adds loot entries to entities; there are no new entities or dynamic behavior added.
Like my mods? Check out another! Or see older, pre-0.12.0 mods.

Schmendrick
Fast Inserter
Fast Inserter
Posts: 222
Joined: Wed Apr 30, 2014 11:17 pm
Contact:

Re: [0.9.x] Scrap Mod

Post by Schmendrick »

Changelog 0.1.2

Urg. Fixed a bug I introduced in the recipe category parsing that caused it to ignore a lot of recipes. Dumb table-using mistake; Lua is not my native language.
Like my mods? Check out another! Or see older, pre-0.12.0 mods.

orion420
Inserter
Inserter
Posts: 24
Joined: Fri Jun 06, 2014 12:12 am
Contact:

Re: [0.9.x] Scrap Mod

Post by orion420 »

Hey I love the mod, lets me know how many robots Ive lost flying to close to bitters :lol:. Bug issue tho (not directly connected with your mod but still)!! a very annoying one. So when a mine or pump jack is destoryed or say i used grenades to burned the forest dropping wood all over a ore area. Then using Construction robots to replace/build new mines cause this error and Crash to desktop (CTD). "Cant Insert into engine source." I have concluded (after seeing smelters pick up what they are built atop; placing it in the input square) that the mines and pumpjack are attempting to pick up the intermediate materials scattered about and causing a invalid item issue and thus the CTD. This is a vanilla issue but aggravated one by your great mod just the same. I will post to bug thread as well.

Schmendrick
Fast Inserter
Fast Inserter
Posts: 222
Joined: Wed Apr 30, 2014 11:17 pm
Contact:

Re: [0.9.x] Scrap Mod

Post by Schmendrick »

orion420 wrote:Hey I love the mod, lets me know how many robots Ive lost flying to close to bitters :lol:. Bug issue tho (not directly connected with your mod but still)!! a very annoying one. So when a mine or pump jack is destoryed or say i used grenades to burned the forest dropping wood all over a ore area. Then using Construction robots to replace/build new mines cause this error and Crash to desktop (CTD). "Cant Insert into engine source." I have concluded (after seeing smelters pick up what they are built atop; placing it in the input square) that the mines and pumpjack are attempting to pick up the intermediate materials scattered about and causing a invalid item issue and thus the CTD. This is a vanilla issue but aggravated one by your great mod just the same. I will post to bug thread as well.
Is it by any chance this bug?

https://forums.factorio.com/forum/vie ... f=7&t=3242

If so it should be fixed in 0.10.0.
Like my mods? Check out another! Or see older, pre-0.12.0 mods.

orion420
Inserter
Inserter
Posts: 24
Joined: Fri Jun 06, 2014 12:12 am
Contact:

Re: [0.9.x] Scrap Mod

Post by orion420 »

That would be the one. :D Says fixed for next version so good stuff.

Schmendrick
Fast Inserter
Fast Inserter
Posts: 222
Joined: Wed Apr 30, 2014 11:17 pm
Contact:

Re: [0.9.x] Scrap Mod

Post by Schmendrick »

While working on another mod, I realized Scrap Mod has a bug - it can get stuck on a circular recipe chain and hang Factorio on load. I have a pretty simple fix, but I'll be updating Scrap Mod more extensively soon anyway. Just letting everybody know.
Like my mods? Check out another! Or see older, pre-0.12.0 mods.

Spiro20004
Manual Inserter
Manual Inserter
Posts: 2
Joined: Wed Aug 06, 2014 11:14 am
Contact:

Re: [0.9.x] Scrap Mod

Post by Spiro20004 »

what about adding a researchable machine that can reduce items into there original components?

in the interest of balance you could make it so it is expensive to research or consumes a lot of electricity. but to make the machine worth while it would break stuff down into components to avoid re-smelting and would give a better return

Schmendrick
Fast Inserter
Fast Inserter
Posts: 222
Joined: Wed Apr 30, 2014 11:17 pm
Contact:

Re: [0.9.x] Scrap Mod

Post by Schmendrick »

Spiro20004 wrote:what about adding a researchable machine that can reduce items into there original components?
Kinda!

In version 2 I've added a recycling machine (unlocks along with steel furnaces and is made from 2 steel furnaces and 3 burner inserters) that reduces any item placed into it into iron ore, copper ore, or "scrapmetal" which can be separated into copper and iron ore in an assembling machine, along with a small amount of sulfuric acid.

Recycling should be compatible with just about any mod, except recycling recipes won't return anything but iron, copper, or scrap. If an item doesn't involve any iron or copper (such as a stone furnace), it can't be recycled (I may address this soonish, at least for stone). Some items only recycle in batches - for example, you need at least 5 regular bullet magazines to recycle them (and, at least in vanilla, they will yield 5 iron ore).

Scrapping should be compatible with every mod, regardless. And it should no longer grant the capability for anything to drop more ingredients than could have been used to make it. Note that if you have a mod that allows the possibility for a large productivity bonus, this will reduce scrap (and recycling) potential.
burningburners.jpg
burningburners.jpg (138.49 KiB) Viewed 10120 times
techentry.jpg
techentry.jpg (29.03 KiB) Viewed 10120 times
Like my mods? Check out another! Or see older, pre-0.12.0 mods.

Kane
Filter Inserter
Filter Inserter
Posts: 660
Joined: Fri Sep 05, 2014 7:34 pm
Contact:

Re: [0.10.x] Scrap Mod - now with recycling!

Post by Kane »

Nice looking mod :)

User avatar
Devildog
Fast Inserter
Fast Inserter
Posts: 170
Joined: Tue Aug 19, 2014 8:19 pm
Contact:

Re: [0.10.x] Scrap Mod - now with recycling!

Post by Devildog »

I'll Download it when my internet is stable.
Image
Check Out Factorio Mod Madness 2.0 Here : http://bit.ly/1afTDl0
Mod Madness ModPack

User avatar
Lone_Player
Inserter
Inserter
Posts: 44
Joined: Sat Jul 12, 2014 9:56 am
Contact:

Re: [0.10.x] Scrap Mod - now with recycling!

Post by Lone_Player »

Hello,

I just want to say Thank you, waited Age´s for a Recyling Machine. Finally i can get rid, of all the old Stuff that was sitting around in chest´s.

User avatar
Devildog
Fast Inserter
Fast Inserter
Posts: 170
Joined: Tue Aug 19, 2014 8:19 pm
Contact:

Re: [0.10.x] Scrap Mod - now with recycling!

Post by Devildog »

I get an Error when i load into game an the game closes an pops up an error msg.
Just says Error Scrap Mod - File name.
Image
Check Out Factorio Mod Madness 2.0 Here : http://bit.ly/1afTDl0
Mod Madness ModPack

Post Reply

Return to “Mods”

Who is online

Users browsing this forum: No registered users