[MOD 0.13.0+|v0.12]Recycling Machines

Topics and discussion about specific mods
User avatar
DRY411S
Filter Inserter
Filter Inserter
Posts: 731
Joined: Sun Mar 13, 2016 9:48 am
Contact:

[MOD 0.13.0+|v0.12]Recycling Machines

Post by DRY411S »


Recycling Machines

Now released for Factorio v0.13 and available on the mod portal at https://mods.factorio.com/mods/DRY411S/ZRecycling

Most of this topic refers to the mod when it was in development, and is not the latest version. Please report bugs for the latest versions at the end of this topic or on my GitHub. At the end of the topic you will also find the latest news on the mod.


Description:

Fully tested with all Bob's Mods, 5dim mods, Yuoki Industries, Marathon and KS Mods
The mod adds 3 levels of recycling machines that can change crafted items back to their raw ingredients.
It recycles the items that you put into the machines and gives 100% back, though you can easily change this with one of the Trigger Mods
It differs from all the furnace based mods by letting you specify exactly what you want to recycle in each machine.

Download Latest versions

For Factorio 0.13 Download v0.13.20 is now available on the mod portal. Updated 27-Jul-2016.

For Factorio 0.12 Download v0.12.38 Updated 12-Jul-2016. Image

Version for Factorio 0.13 updated 27-Jul-2016

Download Trigger mods for Factorio v0.13 from the Mod Portal

10% https://mods.factorio.com/mods/DRY411S/RecycleRatio010
20% https://mods.factorio.com/mods/DRY411S/RecycleRatio020
40% https://mods.factorio.com/mods/DRY411S/RecycleRatio040
50% https://mods.factorio.com/mods/DRY411S/RecycleRatio050

Download Trigger mods for Factorio v0.12 from GitHub

Download 10% Trigger
Download 20% Trigger
Download 40% Trigger
Download 50% Trigger
LONG DESCRIPTION
KNOWN ISSUES
ACKNOWLEDGEMENT

I learned a lot by studying Reverse Factory a smelter based recycling mod by Taniotoshi
Thanks to Arch666Angel for suggesting 'trigger' mods to change the amount of ingredients that the Recycling Machines return.
CHANGELOG prior to Factorio v0.13
Last edited by DRY411S on Wed Jul 27, 2016 1:17 pm, edited 26 times in total.
AlexTheNotsogreat
Long Handed Inserter
Long Handed Inserter
Posts: 97
Joined: Thu May 14, 2015 12:54 am
Contact:

Re: [ALPHA for 0.12]Recycling Machines

Post by AlexTheNotsogreat »

How does it give back, say, 20% of a solid item, with only whole number stack sizes?
User avatar
DRY411S
Filter Inserter
Filter Inserter
Posts: 731
Joined: Sun Mar 13, 2016 9:48 am
Contact:

Re: [ALPHA for 0.12]Recycling Machines

Post by DRY411S »

AlexTheNotsogreat wrote:How does it give back, say, 20% of a solid item, with only whole number stack sizes?
It rounds up. So any recipe where an ingredient is less than or equal to 5 you get 1 back, between 6 and 10 you get 2 back, 11 and 15 you get 3, etc.

It rounds up fluids too. Maybe I could change that.

The 20% ratio is a declared variable in constants.lua. You can change it by hand editing the file, and it would be applied the next time you started a new map.

At the moment, you could edit the ratio so that it is more than 100% and recycling would yield more results than the original ingredients. I need to fix that.
Last edited by DRY411S on Wed Jun 22, 2016 3:48 pm, edited 1 time in total.
BlakeMW
Filter Inserter
Filter Inserter
Posts: 952
Joined: Thu Jan 21, 2016 9:29 am
Contact:

Re: [ALPHA for 0.12]Recycling Machines

Post by BlakeMW »

Ironically ammo is the only thing I'd want to actually recycle
User avatar
DRY411S
Filter Inserter
Filter Inserter
Posts: 731
Joined: Sun Mar 13, 2016 9:48 am
Contact:

Re: [ALPHA for 0.12]Recycling Machines

Post by DRY411S »

BlakeMW wrote:Ironically ammo is the only thing I'd want to actually recycle
Thank you for the feedback.

It's a recycling machine, not a bomb disposal squad. Hmm, maybe that's not a bad idea. :)

Seriously, I could allow ammo and capsules with a couple of edits. I'm thinking maybe I could add a GUI to let people choose at the start what recipe groups they want to recycle. What do you think?
BlakeMW
Filter Inserter
Filter Inserter
Posts: 952
Joined: Thu Jan 21, 2016 9:29 am
Contact:

Re: [ALPHA for 0.12]Recycling Machines

Post by BlakeMW »

I don't think ammo recycling is that crazy. Most explosives require particular conditions in order to detonate, you can have a box full of loose ammo and shake it around and be fairly confident it wont explode. Pulling apart a cartridge without detonating it is relatively simple, it is one of those "don't try this at home" type things, but you can clamp it in a vice and twist/pull the bullet out and do whatever you like with the components. You can see ammo dismantling on shows like Mythbusters, and Youtube gun enthusiast channels all the time (generally to do crazy stuff like firing teeth or nails out of a gun).

In any case, flexible configuration would be nice especially if recycling recipes clutter up any of the interfaces.
User avatar
DRY411S
Filter Inserter
Filter Inserter
Posts: 731
Joined: Sun Mar 13, 2016 9:48 am
Contact:

Re: [ALPHA for 0.12]Recycling Machines

Post by DRY411S »

BlakeMW wrote:
In any case, flexible configuration would be nice especially if recycling recipes clutter up any of the interfaces.
Thanks for the feedback. Maybe as a Brit, guns and ammunition just scare me, even before I've put them into a machine.

The worst thing about this mod is that it produces a very cluttered list of recipes already with vanilla recipes (over 130) before any mod recipes are added, but these are kept away completely from the other crafting tabs by using a dedicated recycling tab.
User avatar
DRY411S
Filter Inserter
Filter Inserter
Posts: 731
Joined: Sun Mar 13, 2016 9:48 am
Contact:

Re: [ALPHA for 0.12]Recycling Machines

Post by DRY411S »

EDIT: THESE SCREENS Are OUT OF DATE. SEE THE MORE RECENT VERSION AT THIS LINK

Here's a graphical walkthrough of the mod.

The recycling machines become available when the research for the same level of Assembling Machine. Here's an example of Automation, note the Recycling machine icon.
Research Automation
The machines themselves can be built from the Production Tab.
Recycling Machine on Production Tab
Note there's a a Recycle Tab on the crafting menu. This shows what can be recycled. It grows over time as new technologies are researched. To begin with it looks like this:
Initial Recycling Options
By the end of a vanilla game research, it looks like this:
End Game Recycling Tab
This is ugly, I wish I could hide it completely, as you're not allowed to hand craft recycling.
Also, the recipes are not in the correct order, something I need to fix.


The 3 machines look like this:
Recycling Machines
The crafting menu for a recycling machine shows you what you can recycle in that machine. Here's the Level 1 Recycling Machine crafting menu at end of game.
Level 1 Machine End Game Recycling
Finally, here's a Level 3 machine recycling electric engines, including the fluids. Note how it's taking 1 input, and producing 3 outputs.
Electric Engine Recycling
Last edited by DRY411S on Wed Jun 22, 2016 3:52 pm, edited 2 times in total.
User avatar
DRY411S
Filter Inserter
Filter Inserter
Posts: 731
Joined: Sun Mar 13, 2016 9:48 am
Contact:

Re: [ALPHA for 0.12]Recycling Machines

Post by DRY411S »

I have a new version under development that cleans up the crafting menus. It works perfectly with vanilla. I and am now testing it with Bob's Mods. I'm having some issues. Currently it has problems when any of these are enabled..
  • bobtech
    bobplates
    bobelectronics
    bobgreenhouse
    boblogistics
    bobmodules
It works fine with:
  • bobtechsave
    bobassembly
    bobenemies
    bobores
    bobmining
    bobpower
If anybody has tried the version here with Bob's Mods and are seeing issues like this one below (which is when Bob's electronics is enabled), please let me know.
bobelectronics.png
bobelectronics.png (17.32 KiB) Viewed 14334 times
The message can vary between mods, and between startups of the game.
User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7352
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: [ALPHA for 0.12]Recycling Machines

Post by bobingabout »

Well, the obvious problem is that "basic-circuit-board" is an item, not a fluid...

In my mod it should either be defined in recipes as {"basic-circuit-board", #} or {type = "item", name = "basic-circuit-board", amount = #}, so I'm not too sure why it would come up as a fluid in your mod. perhaps you should double check your recipe creation routine?

I might sugest you look at the functions in my library mod in the item-functions.lua file, specifically the... 4? at the top. the get_basic_item_type function is something I'd recomend you either use, or replicate in your mod to solve these kinds of errors. Basically, if it's a fluid it gets type=fluid, if it's anything else it gets type=item. there's also get_item_type that returns the actual type (tool, mining-tool, weapon, armor, module etc) but these don't work on recipes, which is why the basic version defaults them to item.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.
User avatar
DRY411S
Filter Inserter
Filter Inserter
Posts: 731
Joined: Sun Mar 13, 2016 9:48 am
Contact:

Re: [ALPHA for 0.12]Recycling Machines

Post by DRY411S »

That message isn't coming from my mod. :)

It's gotten through loading all the data.lua and data-updates and data-final-fixes for all mods, but before the game main menu appears, the error message appears.

Looking at my code though, it does seem to think that your board is a fluid. Sample reverse recipe....
reverse recipe with basic-circuit-board
OK, over to me to fix, thanks for pointing me in the right direction. :idea:

Edit: Found it. Your routine 'bobmods.lib.replace_recipe_item' inserts type="item" into the recipes. Although the official API documents talk about this being a valid type, the vanilla game never uses it, so I took the code out that was handling it. :)
User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7352
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: [ALPHA for 0.12]Recycling Machines

Post by bobingabout »

I think in the context of setting type=item is basically just saying it isn't type=fluid.
I'm sure I've seen examples of it being used.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.
User avatar
DRY411S
Filter Inserter
Filter Inserter
Posts: 731
Joined: Sun Mar 13, 2016 9:48 am
Contact:

Re: [ALPHA for 0.12]Recycling Machines

Post by DRY411S »

bobingabout wrote:I think in the context of setting type=item is basically just saying it isn't type=fluid.
I'm sure I've seen examples of it being used.
It's definitely not in vanilla, apart from in 'chemistry' recipes, which my mod doesn't handle. But it is syntactially valid, so my code now tests for it. :)
User avatar
DRY411S
Filter Inserter
Filter Inserter
Posts: 731
Joined: Sun Mar 13, 2016 9:48 am
Contact:

Re: [ALPHA for 0.12]Recycling Machines

Post by DRY411S »

This is now upgraded to v0.12.3. It's probably good to go as a release now, but I'm going to wait for 0.13 for my first 'proper' release.

Based on feedback, it now accepts Ammo and Capsules for recycling, and recycles at 100% 'yield'.

The major changes are for the menu interface and Mod support.

The menu interface has been redesigned. You basically get a 'Recycling' tab in the menus for every 'crafting' tab. So in the player's menu it looks like this.
New Recycling Crafting Groups
In the player's menu those recipes will always be unavailable, you can only recycle in machines. I wish I could get rid of those groups in the player's menu, but the devs say it's not possible.

The code knows about Bob's Mods, and will show recycling groups for those mods. (Note that to avoid clutter, these will only appear if Bob's Mods are installed.)
Recycling Crafting Groups for Bobs Mods
Similarly, the Crafting Menus for the machines are a lot more organised. This is from a Level 1 Recycling Machine. The 'bright' items are things you can recycle in the machine, the red ones need a higher level machine.

Everything that appears in the recycling tabs is displayed in exactly the same order as the crafting menu equivalent
Recycling Machine Menu
(The screenshot above was with Bob's Mods disabled.)

The code is dynamically looking for recipes so it can create a recycling version. It should work with any mod that has recipes that are assembled in the vanilla assembly machines.

The code 'knows' about Bob's Mods which is why it can produce those recycling groups for those mods. Any mods that the code finds which it does not 'know', it *should* produce recipes. If those mods have their own crafting tabs like Bob's mods do, then it should put them under the default Recycling icon. Over time I will amend the code to 'know' about more mods.
Default Recycling Group
Finally, here is a screen grab of an 'anti-production' line using Recycling Machine.

I manually inserted Electric Engines in the bottom right machine.
Electric Engines are made into lubricant, engines and circuits.
The lubricant is stored in a tank.
The engines are turned back into cogs, steel-plate and pipes.
The pipes and cogs are made back into iron-plate.
Meanwhile the circuits are made into iron-plate and copper wire, and the copper wire back into copper plate.
Recycling In Action
User avatar
DRY411S
Filter Inserter
Filter Inserter
Posts: 731
Joined: Sun Mar 13, 2016 9:48 am
Contact:

Re: [ALPHA for 0.12]Recycling Machines

Post by DRY411S »

v0.12.31 update.

'Direct' support added for popular mods (5dim, DyTech, Yuoki), with the addition of bespoke tab-groups for those mods.
Fix for incompatibility with Spawn Gear mod.
Debug console output removed
User avatar
steinio
Smart Inserter
Smart Inserter
Posts: 2638
Joined: Sat Mar 12, 2016 4:19 pm
Contact:

Re: [MOD 0.12.33+]Recycling Machines

Post by steinio »

This opens all posibilities for a reverse in time scenario where you get only one rocketsilo with rocket and a recycling plant.

Idea not worked out to completeness... :?
Image

Transport Belt Repair Man

View unread Posts
User avatar
DRY411S
Filter Inserter
Filter Inserter
Posts: 731
Joined: Sun Mar 13, 2016 9:48 am
Contact:

Re: [MOD 0.12.33+]Recycling Machines

Post by DRY411S »

steinio wrote:This opens all posibilities for a reverse in time scenario where you get only one rocketsilo with rocket and a recycling plant.

Idea not worked out to completeness... :?
Interesting idea. It won't work with my mod though.

A rocket is made in a rocket silo, out of 100 rocket parts. My Machines only allow you to recycle things that you can create in assembling machines.

My mod will let you recycle the rocket-silo though, and causes one of the known issues with the progress bar 'bleeding' out of the crafting menu box. The screenshot below was taken with Bob's Mods installed. Note how the Machine produces Bob's circuit and not the vanilla one.
Recycling a rocket silo
So a scenario where the rocket has blasted off without you, starting you with only a few recycling machines, and a rocket-silo would be possible.
flabort
Inserter
Inserter
Posts: 25
Joined: Wed May 11, 2016 2:57 am
Contact:

Re: [MOD 0.12.33+]Recycling Machines

Post by flabort »

Reverse chemistry machine when? :P
With that, you could covert any excess oil-products into solid fuel, but when you need the oil products, boom, chemistry recycled. Gone would be the days of tiny fluid tanks, you could store far, far more petrol in a steel chest.
User avatar
DRY411S
Filter Inserter
Filter Inserter
Posts: 731
Joined: Sun Mar 13, 2016 9:48 am
Contact:

Re: [MOD 0.12.33+]Recycling Machines

Post by DRY411S »

flabort wrote:Reverse chemistry machine when? :P
With that, you could covert any excess oil-products into solid fuel, but when you need the oil products, boom, chemistry recycled. Gone would be the days of tiny fluid tanks, you could store far, far more petrol in a steel chest.
Nice idea, but my rationale for the Recycling Machines was that it felt realistic, certainly more realistic than furnances that turned iron-plate back into ore! Reverse Chemical plants doesn't 'feel' right.

The easiest way to avoid the problem you describe is to leave the oil in the ground. Save the planet! :D

But I understand that with vanilla oil refineries, you end up with types of oil that you don't want. Maybe that is what needs addressing somehow? Refineries that only produce light oil, or heavy oil or petroleum gas? I've no idea how that maps onto the real world.
British_Petroleum
Filter Inserter
Filter Inserter
Posts: 321
Joined: Tue Dec 23, 2014 7:21 am
Contact:

Re: [MOD 0.12.33+]Recycling Machines

Post by British_Petroleum »

ah great, finally a way to get rid of those old burner drills.
Locked

Return to “Mods”