Reverse Factory machine will recycle (uncraft) nearly any item placed inside. Supports the recycling of most, if not all, modded items. Fully featured integration with Bobs Mods, Industrial Revolution, and Fantario (independently, not simultaneously)
Mods introducing new content into the game.
Furnaces, assembling machines, production chains.
Explaining the issue:
i have recently fixed the vanilla recycling problem my mod have had since space age releas. tho i step in to an issue with your mod and when both my mod & bobs are active my mod removes all Armour & equipment's from bobs tho when recycling my Armour MK 4 it returners the recipe from bobs MK4 rather than mine. which i hope was fixed along the recycling fix. but no so i want to ask for a bit of help to solve this on ether sides.
Have started like this on my side. Just not sure how this "rf." is required from your mod 100%. and do you have an example that i could use for the code below?
rf = {}
if mods["reverse-factory"] then
if (rf) and (rf.custom_recycle) then
table.insert(rf.custom_recycle, {"item", "example-item-result", "example-recipe"})
end
end
Again I'm no pro I still try learning easy/advanced code.
Also came to ask if there is a way to have this auto fix itself in a way due to recipe changing in 2+ ways for vanilla & space age then many more times for any other mod compatibilities that may be loaded & re creating these senarios are tedious if one recipe results in ~50 variations.
So the issue is just that this "Armour MK 4" is returning the wrong ingredients?
I can tell you a bit of information on how this mod operates, that should maybe explain some things for your situation. For every item in the game, my mod checks for a recipe that has the same internal name as the item in question, which works for basically all items in the vanilla game, with the exception of recipes that are like "basic-oil-processing", or "metallic-asteroid-processing", which does not match the name for any of the items those recipes produce; these recipes don't even get looked at by my mod.
If there is no match for an item, that item gets skipped. There are some other checks the recipe has to pass before it gets a reverse recipe created (like not on blacklist, not percentage based, etc) but that's the first important milestone. If you are getting a reverse recipe that does not match the ingredients for the base recipe, then one of two things are happening: the item name does not match your intended recipe name, but another one does, so it pulls from the wrong recipe. OR your mod is loading after mine, and makes changes to the recipe that are not being accounted for. If your mod runs during data-final-fixes, then it's possible this is happening
If that info doesn't help solve the problem, then you can find examples of the manual recipe addition within my mod, under prototypes > added_manual_recipes.lua, but here's a couple of excerpts:
if mods["kj_fuel"] then
if data.raw.item["kj_gascan"] and data.raw.recipe["kj_gascan_fill"] then
table.insert(rf.custom_recycle, {"item", "kj_gascan", "kj_gascan_fill"})
end
if data.raw.item["kj_energy_cell"] and data.raw.recipe["kj_energy_cell_load"] then
table.insert(rf.custom_recycle, {"item", "kj_energy_cell", "kj_energy_cell_load"})
end
if data.raw.item["kj_kerosine"] and data.raw.recipe["kj_kerosine_fill"] then
table.insert(rf.custom_recycle, {"item", "kj_kerosine", "kj_kerosine_fill"})
end
if data.raw.item["kj_gasbarrel"] and data.raw.recipe["kj_gasbarrel_fill"] then
table.insert(rf.custom_recycle, {"item", "kj_gasbarrel", "kj_gasbarrel_fill"})
end
end
if mods["Hovercrafts"] then
if data.raw["item-with-entity-data"]["hcraft-entity"] and data.raw.recipe["hcraft-recipe"] then
table.insert(rf.custom_recycle, {"item-with-entity-data", "hcraft-entity", "hcraft-recipe"})
end
if data.raw["item-with-entity-data"]["mcraft-entity"] and data.raw.recipe["mcraft-recipe"] then
table.insert(rf.custom_recycle, {"item-with-entity-data", "mcraft-entity", "mcraft-recipe"})
end
if data.raw["item-with-entity-data"]["lcraft-entity"] and data.raw.recipe["lcraft-recipe"] then
table.insert(rf.custom_recycle, {"item-with-entity-data", "lcraft-entity", "lcraft-recipe"})
end
end
NOTE: From my mod, I check for the existence of other mods, but other mods would want to check for the existence of mine, hence the use of
if mods["reverse-factory"] then
First off, you do not need to define rf within your mod's code (and you should not redefine rf from within your mod, that will overwrite the table that we are using, basically deleting all the entries that were added before). Checking for the existence of rf and rf.custom_recycle may not be necessary, and you could just omit those lines and skip straight to table.insert
As for the table insertion function, we are inserting into the table rf.custom_recycle (the table that my mod uses to create manual recipes), and we are inserting this data into that table:
{"item", "example-item", "example-recipe"}
"item" defines the type of item (which is why I use "item-with-entity-data" for the hovercrafts mod), "example-item" should be the internal name of the item in question (under data.raw.item["item-name"]), and "example-recipe" should be the name of the recipe you are trying to assign to that item (under data.raw.recipe["recipe-name"])
EDIT: I updated the FAQ for this section, to hopefully clarify the wording. I realize that you probably want to use "armor" instead of "item" in your table.insert, wrong item type won't get properly matched
So the issue is just that this "Armour MK 4" is returning the wrong ingredients?
More or less that. Tho it happens to 20 or 30 of my 79 recipes.
Tho if i understand this correctly I would just add my 20-30 recipes to this list and your will mod auto fixes recipes automatically?
if data.raw.item["kj_gasbarrel"] and data.raw.recipe["kj_gasbarrel_fill"] then
table.insert(rf.custom_recycle, {"item", "kj_gasbarrel", "kj_gasbarrel_fill"})
end
So when i come to table.insert do i iterate all items in the recipe or... only the failing item which is all. Since my entire recipe output fails if bobs are active.
not sure if i have asked tho if you use discord i would be happy to chat in a voice chat if you have a time.
User:@Sgamez
Another thing i notice is that many of my recipes get this in the log from you mod
2.290 Script @reverse-factory/func.lua:52: Recipe uses probability: par-solar-panel-mk9
2.290 Script @reverse-factory/func.lua:52: Recipe uses probability: par-solar-panel-mk10
2.292 Script @reverse-factory/func.lua:52: Recipe uses probability: par-laser-mk7
2.292 Script @reverse-factory/func.lua:52: Recipe uses probability: par-laser-mk8
2.292 Script @reverse-factory/func.lua:52: Recipe uses probability: par-laser-mk9
2.292 Script @reverse-factory/func.lua:52: Recipe uses probability: par-laser-mk10
2.294 Script @reverse-factory/func.lua:52: Recipe uses probability: par-shield-mk9
2.294 Script @reverse-factory/func.lua:52: Recipe uses probability: par-shield-mk10
2.294 Script @reverse-factory/func.lua:52: Recipe uses probability: par-belt-immunity-mk2
even tho i have no % based recipes
I have tried in multiple load stages updates & final fixes still nothing.
Since both objects are in my mods or vanilla i don't see why I would use the if section. Also "rf." is undefined global
table.insert(rf.custom_recycle, {"armor", "par-armour-mk1", "modular-armor"})
I do have a Discord (same username, @Kryzeth), but I don't think a voice call would help any more than text chat. We also might be in different time zones that don't line up for a good meeting time.
What might help is having a copy of your in-progress mod so I can see what's happening internally, because I'm not sure I understand why the recipes you're defining are failing to match. Either your definition is improper/incorrect, or my detection logic is wrong, and the only way to know for sure is to have a copy of the mod in question
As for the log in question, it should only happen if it fails this check (i.e. if noProb is false at the end of this check):
function checkProbs(recipe,item)
local noProb = true
if recipe.results then
if #recipe.results > 1 then noProb = false end
for _, ingred in ipairs(recipe.results) do
if ingred.probability then noProb = false end
end
end
return noProb
end
The most likely reason would be if you are using multiple results in all of these recipes (which shouldn't be the case, since it sounds like they should only produce one item, not multiple). If you are defining recipes with multiple results, that could be the reason your recipes are all failing to match
Want to say the code that shows are the last one i tired tho I've attempted multiple things to try & have it work
Also when it come to time zones i can be fleksible. & supposedly i want my availability to be around 02:00-16:00 CET/CEST
I don't think this is quite enough for me to tell what's going wrong, I need an actual copy of the mod so I can test it on my end. I need to like, actually debug it, seeing what the recipes and stuff look like before they hit my recycling functions.
the mod was linked on that git page https://github.com/SGZ-Creations/Power-Armour-Replacer from here you would need to click the button named code & download a zipped version if the mod
Okay, I finally got around to testing this, and I see exactly what's happening.
You added my mod as an optional dependency, which forces it to load first, and then you also make changes to recipes during data-final-fixes. You should technically be making those changes during data-updates, since bob's mods don't make any recipe changes (as far as I can tell) during final-fixes, so you don't need to either.
If you insist on making your mod perform recipe changes during final-fixes, then we need to reverse the load order so that my mod has an optional dependency on yours, instead of the other way around. If you make my mod run first, my mod will create the reverse recipes based on what has been altered before it. If your mod runs after that point, it changes the recipes, but my mod will never see those changes, because it never gets a chance to run afterwards.
None of the code attempts I mentioned above will work, specifically because when your mod enters its data-final-fixes, my mod has already done everything it can and will do; there is no further opportunity for my mod to make any changes. I recommend going with the first solution, moving your recipe changes to data-updates instead of data-final-fixes, but from my testing with 3.18.1 on github, just removing reverse-factory as an optional dependency made the recipes work properly.
You should probably do both of those things, honestly. No mods with recipe changes should have a dependency on this mod; this mod absolutely NEEDS to load LAST
0.3.18-1 dose mot even have any of the code so testing that version was pointless.
You need to get the source or use my 0.3.23 on my discord sever found in my profile.
Tho I'll try removing the dependency and see.
Fixed on my end for 0.3.24 of PAR.
Thank for the help.
Deleted
Not sure if you would be able to have increased output slots in settings for Reverse Factory would like to see setting on all 3 versions.
Unable to Reverse Armour mk10 since the recipe uses more then you 13 output slots my MK10 Armour has 18 items + 1 liquid = 19 output in you mod due to the solid liquids.
alternative from settings:
What i would love to see if your up for it is having a machine mk4 to show up if PA&R mod is active
then should it be possible make that machine have 20+ items output?