[MOD 0.13.0+|v0.12]Recycling Machines

Topics and discussion about specific mods
User avatar
DRY411S
Filter Inserter
Filter Inserter
Posts: 727
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: 727
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: 727
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: 727
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: 2633
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: 727
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: 727
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.

flabort
Inserter
Inserter
Posts: 25
Joined: Wed May 11, 2016 2:57 am
Contact:

Re: [MOD 0.12.33+]Recycling Machines

Post by flabort »

Well, what chemical reaction can't be reversed with a little finagling?
Take Water, for example. You can split it into hydrogen and oxygen through application of electricity, or you can put them back together through application of heat.
Plastics are often melted down for recycling, often to form new items that are made of plastic as well, but sometimes are broken down into the composite hydrogen and carbon (and oxygen, sometimes), to be shaped into other forms of plastic or rubber, or sometimes other chemicals entirely. Sure, it takes a lot more energy to reverse a reaction such as plastics-making, but it's been done. Now, I'm not sure about getting the carbon back in COAL form, but certainly in a burnable form; perhaps if a recipe requires coal to make it, such as plastic, you could have your script which automatically makes the recycling-recipe output solid-fuel instead.

I'm not saying everything should have a recycler - the oil refinery, for example, should not. Heh, imagine mixing the light and heavy oils with petrol to get crude oil and water back. No, that would be a bad idea. But the chemical plant does seem like a likely candidate to me.

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

Re: [MOD 0.12.33+]Recycling Machines

Post by DRY411S »

Just to confirm that I've now checked that this mod is compatible with the Marathon Mod.

inick
Long Handed Inserter
Long Handed Inserter
Posts: 55
Joined: Thu Jun 16, 2016 7:36 pm
Contact:

Re: [MOD 0.12.33+]Recycling Machines

Post by inick »

Thanks for the idea!

Appreciate the mod, really like the thought in it. I feel a 100% return is too grateful though. I really would rather a configurable amount/percent.

I just enabled it in 0.12.35 64-bit and found an existing world doesn't allow you to craft the recycling machines. I expect completing the research would enable it as it should. This is past research, and didn't have access to craft the recycler.


Can you add a check for if the research was already finished, then enable the machine?
thanks!

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

Re: [MOD 0.12.33+]Recycling Machines

Post by DRY411S »

inick wrote:Thanks for the idea!

Appreciate the mod, really like the thought in it. I feel a 100% return is too grateful though. I really would rather a configurable amount/percent.

I just enabled it in 0.12.35 64-bit and found an existing world doesn't allow you to craft the recycling machines. I expect completing the research would enable it as it should. This is past research, and didn't have access to craft the recycler.


Can you add a check for if the research was already finished, then enable the machine?
thanks!
Thanks for the feedback.

This is my first factorio mod so I'm learning as I go, but I'm pretty sure that I cannot enable it in an existing world. But I'll do so more reading around the start up phases in the game, and see if I can improve it.

Regarding 100% return, I'm also think about a GUI for that, but again as I understand it, I cannot present a GUI to the user until a world is fully created, and again that's too late to change any recipes.

If you wish to manually edit the percentage return, you can unzip the mod in the mods folder, put the zip file somewhere safe out of the way, and in the unzip, edit constants.lua. The next time you start a new world, the new percentage will be used.

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

Re: [MOD 0.12.33+]Recycling Machines

Post by DRY411S »

DRY411S wrote:
inick wrote:Thanks for the idea!

Appreciate the mod, really like the thought in it. I feel a 100% return is too grateful though. I really would rather a configurable amount/percent.

I just enabled it in 0.12.35 64-bit and found an existing world doesn't allow you to craft the recycling machines. I expect completing the research would enable it as it should. This is past research, and didn't have access to craft the recycler.


Can you add a check for if the research was already finished, then enable the machine?
thanks!
Thanks for the feedback.

This is my first factorio mod so I'm learning as I go, but I'm pretty sure that I cannot enable it in an existing world. But I'll do so more reading around the start up phases in the game, and see if I can improve it.

Regarding 100% return, I'm also think about a GUI for that, but again as I understand it, I cannot present a GUI to the user until a world is fully created, and again that's too late to change any recipes.

If you wish to manually edit the percentage return, you can unzip the mod in the mods folder, put the zip file somewhere safe out of the way, and in the unzip, edit constants.lua. The next time you start a new world, the new percentage will be used.
OK! I was wrong about not being able to use the mod in a previously saved world. New version now in test that allows this. :)

Still a way to go with a version that lets you choose the recycling return that is always 100% at the moment.

inick
Long Handed Inserter
Long Handed Inserter
Posts: 55
Joined: Thu Jun 16, 2016 7:36 pm
Contact:

Re: [MOD 0.12.33+]Recycling Machines

Post by inick »

DRY411S wrote:
OK! I was wrong about not being able to use the mod in a previously saved world. New version now in test that allows this. :)

Still a way to go with a version that lets you choose the recycling return that is always 100% at the moment.

I'll throw it on and play with your testing version if you wanna link me. I'm not a fast player and often have hours of "I hate this layout. Why do I keep doing this style layout to myself?!" Let me know if you want another tester! :)

--iNick

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

Re: [MOD 0.12.33+]Recycling Machines

Post by DRY411S »

inick wrote:
DRY411S wrote:
OK! I was wrong about not being able to use the mod in a previously saved world. New version now in test that allows this. :)

Still a way to go with a version that lets you choose the recycling return that is always 100% at the moment.

I'll throw it on and play with your testing version if you wanna link me. I'm not a fast player and often have hours of "I hate this layout. Why do I keep doing this style layout to myself?!" Let me know if you want another tester! :)

--iNick
You can always download (at your own risk) an unreleased test version by downloading the latest source code (NOT the release zipfile) from https://github.com/DRY411S/Recycling-Machines

The latest 'master' branch code up there is always tested by me, but not always built into the release at the top of this topic.

That's not for the faint-hearted though, you need to know how to name the mod folder the same as the info.json file.

inick
Long Handed Inserter
Long Handed Inserter
Posts: 55
Joined: Thu Jun 16, 2016 7:36 pm
Contact:

Re: [MOD 0.12.33+]Recycling Machines

Post by inick »

DRY411S wrote:
inick wrote:
DRY411S wrote:
OK! I was wrong about not being able to use the mod in a previously saved world. New version now in test that allows this. :)

Still a way to go with a version that lets you choose the recycling return that is always 100% at the moment.

I'll throw it on and play with your testing version if you wanna link me. I'm not a fast player and often have hours of "I hate this layout. Why do I keep doing this style layout to myself?!" Let me know if you want another tester! :)

--iNick
You can always download (at your own risk) an unreleased test version by downloading the latest source code (NOT the release zipfile) from https://github.com/DRY411S/Recycling-Machines

The latest 'master' branch code up there is always tested by me, but not always built into the release at the top of this topic.
<SNIP>

Yea see... I know what github is, I understand it's purpose, but I haven't the faintest of ideas, clues, suggestions, howtos, or overall plain knowledge on how to leverage "building" from github. I don't get it, and don't visit github often enough to even think it's worth my time learning. Guess I'll wait for a release. Thanks, though.

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

Re: [MOD 0.12.33+]Recycling Machines

Post by DRY411S »

inick wrote:<snip>

I just enabled it in 0.12.35 64-bit and found an existing world doesn't allow you to craft the recycling machines. I expect completing the research would enable it as it should. This is past research, and didn't have access to craft the recycler.


Can you add a check for if the research was already finished, then enable the machine?
thanks!
This is now available in v0.12.32, just released. The first post in the topic is updated with the new download location, and you can also download it by clicking here

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

Re: [MOD 0.12.33+]Recycling Machines

Post by DRY411S »

I believe that I cannot make the recycling return percentage interactive.
  • The recycling recipes are built during the 'data' phase when they cannot access any global variables.
  • I can present the player with a box where they can choose a new percentage only in the 'control' phase, when the recipes are now built, and read-only.
  • I could store this new percentage in a global and force the 'data' phase again.
  • But the data phase cannot read the global....
  • doom loop
If any modding experts can point me the right way, I'll have a go, but right now I cannot figure out a way.

Locked

Return to “Mods”