[MOD 0.12.x] Reverse Factory

Topics and discussion about specific mods
Taniotoshi
Burner Inserter
Burner Inserter
Posts: 10
Joined: Sat Jul 11, 2015 7:47 pm
Contact:

[MOD 0.12.x] Reverse Factory

Post by Taniotoshi »

LAST UPDATE : 2016-02-15
Type: Mod
Name: Reverse Factory
Description: Adding a new entity, the Reverse Factory
License: No license
Version: 1.1.5
Release: 2015-07-25
Tested-With-Factorio-Version: 0.12.0 to 0.12.20
Category: Entity
GitHub Repository: https://github.com/VictorRos/reverse-factory
Description
Pictures
Version history
Additional information
I decide to post this mod because I thought it's useful. I hope you will be enjoyed this mod ;)

NB : Be careful on the mods you use.
I used the data lifecycle to make sure my mod is called in thed end to catch all recipes of every mods.
If in one of your mods, except mine, there's a « data-final-fixes.lua » it may not work.
Attachments
reverse-factory_1.1.5.zip
(59.78 KiB) Downloaded 1991 times
Last edited by Taniotoshi on Mon Feb 15, 2016 12:27 am, edited 15 times in total.

wpark712
Manual Inserter
Manual Inserter
Posts: 2
Joined: Thu Jul 23, 2015 1:19 am
Contact:

Re: [Mod 0.12.x] Reverse Factory

Post by wpark712 »

please support bobs mobs

ikodan
Inserter
Inserter
Posts: 32
Joined: Sun Jul 05, 2015 9:13 am
Contact:

Re: [Mod 0.12.x] Reverse Factory

Post by ikodan »

Hello, thank you for your mod, but :

Image
Image

User avatar
darkshadow1809
Filter Inserter
Filter Inserter
Posts: 306
Joined: Thu Jan 15, 2015 10:13 pm
Contact:

Re: [Mod 0.12.x] Reverse Factory

Post by darkshadow1809 »

pretty much that ^^^^^^^^^^^^^^


Lol :D Had an issue putting this mod into the modpack..

Compatibility issues with bobsmods. Its because your mod generates the recipes dynamically. but Bobsmods does not have a subgroup for each of his items/entity's . Probably this will help a bit more :P
ShadowsModpackDevelopment

User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7352
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: [Mod 0.12.x] Reverse Factory

Post by bobingabout »

Looking through the mod... This SHOULD make it compatable with my mod... but it doesn't...

Code: Select all

                    if #new_recipe.results > 1 then
                        new_recipe.subgroup = "rf-multiple-outputs"
                    end
There is another issue... My mod extinsively edits recipes on the data-updates phase to add new intermediates if they are available, base game content if they're not. All of the errored recipes listed in screenshots posted by darkshadow in my forums are recipes with a single product, the previous tier of machine/item before the additional components have been added.

This isn't something I can easilly fix by making my mods depend on each other, because you end up with a loop when one depends on another that depends on it, such as bobplates -> boblogistics -> bobplates -> boblogistics... As a specific example, Bobplates has machines in it, A lot of these machines are made with pipes, and can use new pipes if they are available. new pipes are in logistics mod, and are made from new materials. The new materials which new pipes are made from are added in bobplates. Therefore, this is achived by Logistics having plates as an optional prerequisite, this then adds the pipes if the materials are found. A function in bobplates data-updates.lua then checks to see if the new pipes exist, and if they do, adds them to the recipes, if not it adds base game pipe instead.

I think the best solution would be to make my mods an optional prerequisite of this mod, to force my mods to load first, so that my recipes are complete before trying to reverse engineer them.

As such, I edited info.json to test it.

Code: Select all

  "dependencies": ["base >= 0.12", "? bobassembly", "? bobelecoveride", "? bobenemies", "? boblogistics", "? bobmining", "? bobmodules", "? bobores", "? bobplates", "? bobpower", "? bobtech", "? bobwarfare"]
It loads, and seems to work. Though this isn't an ideal solution because it makes the mod's page in the mods list ingame massive, I'm not entirely sure what else you could do to make it compatable with my mods.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.

Taniotoshi
Burner Inserter
Burner Inserter
Posts: 10
Joined: Sat Jul 11, 2015 7:47 pm
Contact:

Re: [Mod 0.12.x] Reverse Factory

Post by Taniotoshi »

Thank you everyone for your feedbacks.
I forgot to test my mod with Bob's mods so maybye it explains why there're those feedbacks ^^

I'm grateful Bob you helped me to find a solution to fix this issue.
I find a way in the wiki on data lifecycle.

On load, and for all mods, data.lua are first load, then data-updates.lua and finally data-final-fixes.lua
So the lifecycle is : data.lua ==> data-updates.lua ==> data-final-fixes.lua

I renamed my file data-updates.lua to data-final-fixes.lua and it fixes the issue. I think it's the right thing to do because my mod needs to be call at the end to catch every recipes of every mods.
I will add a note in the description to warn people to be careful on mods they are using.

When I tested bob's mods with reverse factory mod I observe that when a object is disassemble inserters can't take some of result items from the reverse factory (like pump jack, pipes, mining drills or gemstones).
In the end it blocks the reverse factory. Maybye some recipes are missing. I will check this when I've time to spare.

But now it's working with Bob's mods and the most of Bob's mods recipes are reversed.

DreamSmith
Inserter
Inserter
Posts: 42
Joined: Wed Mar 26, 2014 7:43 pm
Contact:

Re: [Mod 0.12.x] Reverse Factory

Post by DreamSmith »

Excellent mod, just one niggle, the DyTech support is limited on the slots to disassemble some items. Power Armour Mk III to be exact. Is it possable to add more output slots?

RadioMan
Burner Inserter
Burner Inserter
Posts: 12
Joined: Fri May 08, 2015 6:33 pm
Contact:

Re: [Mod 0.12.x] Reverse Factory

Post by RadioMan »

I got another error, this one is related to the stirling engine from the yuoki mod, I can't seem to be posting an image inhere, well not sure how that works, so here is a link......https://www.dropbox.com/s/kpo0hpwoda6t8 ... 2.png?dl=0

And if that doesn't work, here's what it says:
Error in assignID, 'y-1stirling-engine-recipe' was not recognized id of item

User avatar
Ralord89
Inserter
Inserter
Posts: 26
Joined: Sat Jul 25, 2015 6:06 am
Contact:

Re: [Mod 0.12.x] Reverse Factory

Post by Ralord89 »

I get this error when running it with Cursed Programmable Inserters

Image

I have put this post in this thread and Cursed Programmable inserters

Taniotoshi
Burner Inserter
Burner Inserter
Posts: 10
Joined: Sat Jul 11, 2015 7:47 pm
Contact:

Re: [Mod 0.12.x] Reverse Factory

Post by Taniotoshi »

@DreamSmith : You can do that by modifying the value « result_inventory_size » in the file entity.lua
%Reverse-Factory-directory%/prototypes/entity.lua at line 33
Default it's 8. When the value of result_inventory_size increased, the window when you right click on the reverse factory in game is deformed by the number of result_inventory_size. That's why I put 8 but you can put the value you want. Just be warn by the weird deform effect ^^

@RadioMan & @Ralord89 : Thank you for feedbacks. I will debug those errors. But I'm in vacation so maybye the corrected version will come later.

Taniotoshi
Burner Inserter
Burner Inserter
Posts: 10
Joined: Sat Jul 11, 2015 7:47 pm
Contact:

Re: [Mod 0.12.x] Reverse Factory

Post by Taniotoshi »

@DreamSmith : I put result_inventory_size default value to 10. So you just need to download the new version.

@RadioMan : I fixed the problem. Now it's working with Yuoki Industries and Yuoki Engines.

@Ralord89 : I looked at Cursed Programmable Inserter and when I checked the content of the recipe of the inserter « cursed-pa » I've this :

Code: Select all

{
  enabled = true,
  ingredients = {},
  name = "cursed-pa",
  order = "a1",
  results = {
    {
      amount = 1,
      name = "cursed-pa",
      type = "item"
    }
  },
  type = "recipe"
}
The ingredients part is empty, that's why the error message said the recipe to disassemble the inserter « cursed-pa » must have at least one product.
The Reverse Factory reverse the ingredients part with the result part of all recipes.
For example, if we have the recipe toto with ingredient A give result B then the Reverse Factory mod create the recipe rf-toto with ingredient B give result A.
But if A or B is missing then the Reverse Factory can't create the appropriate recipe.
I think it will be better to ask first the creator of Cursed Programmable Inserter why ingredients is empty. Maybye he needs it or maybye he can let this part not empty and then the Reverse Factory could be work.
But without ingredients, there is not a lot I can do about that.



Version 1.1.2 : Let me know if you encounter errors.

Programmdude
Burner Inserter
Burner Inserter
Posts: 17
Joined: Fri May 02, 2014 2:46 pm
Contact:

Re: [Mod 0.12.x] Reverse Factory

Post by Programmdude »

It's possible to exploit this to generate infinite resources. I put an assembler creating gear wheels with productivity modules, and fed the gear wheels into the recycler to get the iron back, and then repeated the process. This is because of the "free" gear wheels the productivity modules give me.

Taniotoshi
Burner Inserter
Burner Inserter
Posts: 10
Joined: Sat Jul 11, 2015 7:47 pm
Contact:

Re: [Mod 0.12.x] Reverse Factory

Post by Taniotoshi »

@Programmdude : Thank you for this feedback. After your post I think about the « module_slot » field for the Reverse Factory and I will delete it unless I find a way to accept all modules except productivty module to avoid this.



Version 1.1.3 : Let me know if you encounter errors.

bruteman
Inserter
Inserter
Posts: 43
Joined: Thu Jan 23, 2014 2:51 pm
Contact:

Re: [Mod 0.12.x] Reverse Factory

Post by bruteman »

Taniotoshi wrote:@Programmdude : Thank you for this feedback. After your post I think about the « module_slot » field for the Reverse Factory and I will delete it unless I find a way to accept all modules except productivty module to avoid this.



Version 1.1.3 : Let me know if you encounter errors.
Might wanna talk with Dysoch hes done just that and has blocked productivity modules in his MK6 + machines
Image

Taniotoshi
Burner Inserter
Burner Inserter
Posts: 10
Joined: Sat Jul 11, 2015 7:47 pm
Contact:

Re: [MOD 0.12.x] Reverse Factory

Post by Taniotoshi »

The error Ralord89 got will be corrected in the next release of Cursed PI (link).

@bruteman : I don't have time now for developping but your request takes into account.

Peter34
Smart Inserter
Smart Inserter
Posts: 1100
Joined: Mon Nov 10, 2014 12:44 pm
Contact:

Re: [MOD 0.12.x] Reverse Factory

Post by Peter34 »

I have an idea for how to use this mod, but it requires some data collection.

To start with there is one Chest, into which the player (or the players, in coop MP) can dump stuff they're sure won't be needed again, such as Burner Mining Drills..

This Chest then feeds into a Belt loop, via an Inserter.

After the insertion points comes one Smart Inserter, or if necessary several Smart Inserters. These are set up to filter out those items that cannot be dis-assembled.

After this point comes a row of Reverser Machines. Each takes from and outputs onto the loop, the same loop. In this way, if an item can be Reversed in multiple steps, for instance Green Circuit disassembles into Iron Plate and Copper Wire, and Copper Wire in turn disassembles further to Copper Plate, then the item will go two "rounds" in the loop before being taken out by one of the Smart Inserters as "finished and done with". Those items are put onto a new linear Belt going to an "end product" Chest.

The only thing missing is a list of all items from vanilla Factorio that cannot be disassembled (these are the items that the Smart Inserters should take out of the Belt loop), so I'll start by mentioning some, hoping others will add to this list:

Battery
Plastic
Iron Plate
Copper Plate
Steel Plate
Blue Circuit
The 4 Magic Science Potions
Bricks

So are that's 11 items, and since a Smart Inserter can handle only 5 filtered items, this means a minimum of 3 Smart Inserters are needed, and as the above list is unlikely to be complete (please add to it!), as many as 5, 6 or even 7 might be needed.

Of course, one implementation is to just plonk down 8 or 10 Smart Inserters right from the start, and then wait and see, and set the filters based on what you observe going around endlessly in the loop without being taken in by the Reverser Machines, adding to the filters every time you discover a new item that's doing the rounds.

Oh, and one more thing: In some cases, you need 2 of an item in order to be able to reverse it, e.g. yellow Belts. For this reason, such a loop needs to have several Reverser machines. Probably eventaully 6 or even 8, just to make sure one won't get clogged up with a Belt and just sit there doing nothing, waiting forever and forever to get a 2nd Belt to chew on so that it can get on with its life.

Edit: But you can start with just 2, or even 1, as long as you make sure that your Belt loop is large enough for additional Reverser machines to be added.

kinnom
Filter Inserter
Filter Inserter
Posts: 706
Joined: Fri Dec 26, 2014 4:20 pm
Contact:

Re: [MOD 0.12.x] Reverse Factory

Post by kinnom »

can this be updated for 0.12.11+?
no yes yes no yes no yes yes

Taniotoshi
Burner Inserter
Burner Inserter
Posts: 10
Joined: Sat Jul 11, 2015 7:47 pm
Contact:

Re: [MOD 0.12.x] Reverse Factory

Post by Taniotoshi »

It's working with the last update 0.12.17.

Taniotoshi
Burner Inserter
Burner Inserter
Posts: 10
Joined: Sat Jul 11, 2015 7:47 pm
Contact:

Re: [MOD 0.12.x] Reverse Factory

Post by Taniotoshi »

Small update which adding recipes for repair tools and mining tools.
Working with 0.12.20

Lurkily
Inserter
Inserter
Posts: 47
Joined: Mon Jan 11, 2016 1:55 am
Contact:

Re: [MOD 0.12.x] Reverse Factory

Post by Lurkily »

It would be nice if we could break down most recipes requiring liquid, even if it means the total loss of the liquid input. For instance, mostly-steel products requiring lubricant can't be scrapped for steel and gears.

Also, the factory chokes when fed items whose recipe has multiple products. (copper wire, belts, etc.) I couldn't find a good solution to that problem, except to have a separate recycling plant for every recipe that requires multiple products, with lots of smart chests/inserters sorting these to specialized recyclers, and everything else cycling back to the 'generic' inserter.

Post Reply

Return to “Mods”