Serenity wrote:Can I add this to an existing game or does it require a new one?
Can't speak to the current release of the mod or game, but I added the mod to an existing save in 0.15 and it worked fine.
Re: [MOD 0.16.x|0.15.x|0.14.x]Recycling Machines
Posted: Mon Dec 25, 2017 7:07 am
by DRY411S
Serenity wrote:Can I add this to an existing game or does it require a new one?
dgw wrote:Can't speak to the current release of the mod or game, but I added the mod to an existing save in 0.15 and it worked fine.
You should be able to add this to an existing game however there is a bug in my 0.16 'upgrade' script that may cause it to not show all the recycling menus. I'll publish an update which fixes this, after the holidays.
Using your latest version in 0.16.7 loaded into an existing bobs plus a few others run. no recipes in the recycler. i tried: Save. exit, toggle mod off, load save. save again. exit. toggle back on. load save. save again, exit. load save. no change.
sigh
Re: [MOD 0.16.x|0.15.x|0.14.x]Recycling Machines
Posted: Fri Dec 29, 2017 9:33 am
by DRY411S
pleauser wrote:Using your latest version in 0.16.7 loaded into an existing bobs plus a few others run. no recipes in the recycler. i tried: Save. exit, toggle mod off, load save. save again. exit. toggle back on. load save. save again, exit. load save. no change.
sigh
Oh dear. Another edge case.
Re: [MOD 0.16.x|0.15.x|0.14.x]Recycling Machines
Posted: Fri Dec 29, 2017 10:04 am
by DRY411S
DRY411S wrote:
pleauser wrote:Using your latest version in 0.16.7 loaded into an existing bobs plus a few others run. no recipes in the recycler. i tried: Save. exit, toggle mod off, load save. save again. exit. toggle back on. load save. save again, exit. load save. no change.
sigh
Oh dear. Another edge case.
If there are no recipes in the recycler, this means that the migration script in the mod is not running. The migration script should run:
the first time the mod is used in a game,
when the mod was used, then toggled off, then toggled back on again,
when the mod is upgraded, and the mod includes a migration script with a version number greater than or equal to the mod version
Version 0.16.1 was failing because I had not updated the migration script number.
In a map played in vanilla factorio 0.16.7, and then the mod has been added to the game, I cannot reproduce this problem, and the things you say you've tried above should force the migration script to run. Can you provide more information please?
Had you previously had this mod loaded in a v0.15 map and then upgraded the game and the mod to v0.16.x?
If not, and this a map played only in v0.16.x of factorio, had you previously used the v0.16.1 version of the mod?
Please could you attach your factorio-current.log file when you add the mod to a game that includes all the other mods, but the recycler ends up with no recipes?
Re: [MOD 0.16.x|0.15.x|0.14.x]Recycling Machines
Posted: Tue Jan 09, 2018 10:44 pm
by JDoolin
Well, I was using your program with 100% recycling, and it occurred to me to exploit it of course, by using a recycling machine in combination with productivity modules. With Bob's mods, you can get these "pure productivity" modules that just add to the productivity with no increase in power use or pollution.
Well, I set up for recycling transistors, which cost 1 plastic, 1 tinned copper wire, and 2 silicon wafers, and provide 5 transistors. However, when I went to recycle, I expected it to take 5 transistors and output 1 plastic, 1 tinned copper wire, and 2 silicon wafers. A similar phenomenon occurs with Basic Electronics Components and Integrated Electronics.
It didn't bother me so much; as a matter of fact, I immediately began taking advantage of the new-found sources of tin, copper, silicon, plastic, carbon, and sulfuric acid. This was what I was expecting to see by the time I got to "Productivity Module 8" combined with recycling machines--source materials essentially flowing from nowhere, if I ever got that far.
Do you have to key in every recipe for every item from every mod, or is it automated somehow? I can see how it would be a hassle to have to change it for all the mods, every time anybody makes a change. Ahh, I think maybe you discussed this here: viewtopic.php?f=70&t=3453&p=186423&hili ... ng#p186423 where you said recipe.result is not always reliable.
Re: [MOD 0.16.x|0.15.x|0.14.x]Recycling Machines
Posted: Tue Jan 09, 2018 11:21 pm
by orzelek
JDoolin wrote:Well, I was using your program with 100% recycling, and it occurred to me to exploit it of course, by using a recycling machine in combination with productivity modules. With Bob's mods, you can get these "pure productivity" modules that just add to the productivity with no increase in power use or pollution.
Well, I set up for recycling transistors, which cost 1 plastic, 1 tinned copper wire, and 2 silicon wafers, and provide 5 transistors. However, when I went to recycle, I expected it to take 5 transistors and output 1 plastic, 1 tinned copper wire, and 2 silicon wafers. A similar phenomenon occurs with Basic Electronics Components and Integrated Electronics.
It didn't bother me so much; as a matter of fact, I immediately began taking advantage of the new-found sources of tin, copper, silicon, plastic, carbon, and sulfuric acid. This was what I was expecting to see by the time I got to "Productivity Module 8" combined with recycling machines--source materials essentially flowing from nowhere, if I ever got that far.
Do you have to key in every recipe for every item from every mod, or is it automated somehow? I can see how it would be a hassle to have to change it for all the mods, every time anybody makes a change. Ahh, I think maybe you discussed this here: viewtopic.php?f=70&t=3453&p=186423&hili ... ng#p186423 where you said recipe.result is not always reliable.
It looks like you are playing with productivity limitations disabled in Bob's modules settings. So it's an intended effect in a way - you opted out of limits so you can do stuff like this.
Re: [MOD 0.16.x|0.15.x|0.14.x]Recycling Machines
Posted: Wed Jan 10, 2018 12:29 am
by DRY411S
JDoolin wrote:Well, I was using your program with 100% recycling, and it occurred to me to exploit it of course, by using a recycling machine in combination with productivity modules. With Bob's mods, you can get these "pure productivity" modules that just add to the productivity with no increase in power use or pollution.
I'm not familiar with Bobs mods. The recycling machines do support vanilla productivity modules though which makes it possible to get up to 140% of the original recipe ingredients back.
Well, I set up for recycling transistors, which cost 1 plastic, 1 tinned copper wire, and 2 silicon wafers, and provide 5 transistors. However, when I went to recycle, I expected it to take 5 transistors and output 1 plastic, 1 tinned copper wire, and 2 silicon wafers. A similar phenomenon occurs with Basic Electronics Components and Integrated Electronics.
That's possibly a bug. What you expected is what I would expect. I'll investigate.
It didn't bother me so much; as a matter of fact, I immediately began taking advantage of the new-found sources of tin, copper, silicon, plastic, carbon, and sulfuric acid. This was what I was expecting to see by the time I got to "Productivity Module 8" combined with recycling machines--source materials essentially flowing from nowhere, if I ever got that far.
Do you have to key in every recipe for every item from every mod, or is it automated somehow? I can see how it would be a hassle to have to change it for all the mods, every time anybody makes a change. Ahh, I think maybe you discussed this here: viewtopic.php?f=70&t=3453&p=186423&hili ... ng#p186423 where you said recipe.result is not always reliable.
I key in no recipes apart for the ones for the Recycling Machines themselves. The recycling recipes are built at game load time, and include any mod recipes that are also installed.
Recipe.result is now completely reliable. That post is very old, the mod now includes code for handling all the different recipe.result formats.
Re: [MOD 0.16.x|0.15.x|0.14.x]Recycling Machines
Posted: Wed Feb 07, 2018 6:27 am
by Mahribar
DRY411S wrote:
DRY411S wrote:
pleauser wrote:Using your latest version in 0.16.7 loaded into an existing bobs plus a few others run. no recipes in the recycler. i tried: Save. exit, toggle mod off, load save. save again. exit. toggle back on. load save. save again, exit. load save. no change.
sigh
Oh dear. Another edge case.
If there are no recipes in the recycler, this means that the migration script in the mod is not running. The migration script should run:
the first time the mod is used in a game,
when the mod was used, then toggled off, then toggled back on again,
when the mod is upgraded, and the mod includes a migration script with a version number greater than or equal to the mod version
Version 0.16.1 was failing because I had not updated the migration script number.
In a map played in vanilla factorio 0.16.7, and then the mod has been added to the game, I cannot reproduce this problem, and the things you say you've tried above should force the migration script to run. Can you provide more information please?
Had you previously had this mod loaded in a v0.15 map and then upgraded the game and the mod to v0.16.x?
If not, and this a map played only in v0.16.x of factorio, had you previously used the v0.16.1 version of the mod?
Please could you attach your factorio-current.log file when you add the mod to a game that includes all the other mods, but the recycler ends up with no recipes?
I've got exactly the same problem. Added Recycling Machines after some hours of modded gameplay. Built the Recycler and there is no recipe. Tried to toggle off/on but nothing happened.
Never played the map an version 0.15.x and not have used the mod before 0.16.2.
Added factorio-current.log to attachment.
Re: [MOD 0.16.x|0.15.x|0.14.x]Recycling Machines
Posted: Wed Feb 07, 2018 9:03 am
by DRY411S
Thank you for the log file. Do you by any chance have a save file from just before you added my mod?
Re: [MOD 0.16.x|0.15.x|0.14.x]Recycling Machines
Posted: Wed Feb 07, 2018 10:01 am
by Mahribar
I'm sorry, but no. I do only have one save-file and the auto saves.
Auto saves does not work, because I've played without using the recycler for some hours, before I've searched for the problem. Thought it was my own fault.
After I've ended the session, I've overwritten my only one "normal" save.
Re: [MOD 0.16.x|0.15.x|0.14.x]Recycling Machines
Posted: Wed Feb 07, 2018 6:02 pm
by DRY411S
OK not to worry, can you send me just the latest save then please. I can see that the migration script in my mod does not run at all. Is that the log file from the FIRST time you tried to add the mod?
Re: [MOD 0.16.x|0.15.x|0.14.x]Recycling Machines
Posted: Wed Feb 07, 2018 7:15 pm
by DRY411S
I am not able to find and fix this reported issue.
Attached is a vanilla 0.16 save for a 'lazy bastard' play through just before the rocket is launched. No mods were used at all in this play through.
If you enable my mod and then load this save, it is possible to build recycling machines and they have the recycling recipes. So the mod and the migration script are working as intended.
I can only think that people who are reporting this issue have a mod that is badly behaved and it is the cause of all my recycling recipes to be disabled. Here is my migration code:
for index, nextforce in pairs(game.forces) do
nextforce.reset_recipes()
nextforce.reset_technologies()
-- Reenable reverse recipes where necessary
force = nextforce
if nextforce.technologies["automation"].researched and nextforce.technologies["automation"].researched == true then
for _,v in pairs(force.recipes) do
if v.enabled == true then
ZRecycling.Unlock_Recipe(force,v.name)
end
end
end
-- Unlock recycling machines if the appropriate research has completed
if nextforce.technologies["automation"].researched and nextforce.technologies["automation"].researched == true then
force.recipes["recycling-machine-1"].enabled = true
ZRecycling.Unlock_Recipe(force,"recycling-machine-1")
end
if nextforce.technologies["automation-2"].researched and nextforce.technologies["automation-2"].researched == true then
force.recipes["recycling-machine-2"].enabled = true
ZRecycling.Unlock_Recipe(force,"recycling-machine-2")
end
if nextforce.technologies["automation-3"].researched and nextforce.technologies["automation-3"].researched == true then
force.recipes["recycling-machine-3"].enabled = true
ZRecycling.Unlock_Recipe(force,"recycling-machine-3")
end
end
The first part of the code prefixed with the comment:
enables the recipes for my recycling machines to use if the equivalent non-recycling recipe is also enabled. (The recycling recipes are created in my data-final-fixes.lua file.)
Then in that code above, after the correct recycling recipes are enabled, the recipes for the recycling machines themselves are enabled in the code after the comment:
-- Unlock recycling machines if the appropriate research has completed
People are reporting to me that the machines themselves are craftable, but the there are no recycling recipes for the machines to use. But if the machines themselves are craftable, then the migration script code to enable the recipes and the machines has definitely run too.
I can only conclude that some other mod is removing or disabling all my recipes from the game.
Re: [MOD 0.16.x|0.15.x|0.14.x]Recycling Machines
Posted: Wed Feb 07, 2018 8:10 pm
by DRY411S
Confirmed.
This is something to do with other mods changing the behaviour of the game so that the Recycling Recipes cannot be enabled by my migration script. The mod works fine in vanilla, but with this particular combination of mods, it stops working when added to a game that uses them. I don't see what I can do to fix this unless I can figure some hardcoding which reacts to the presence of the mod that is causing mine to fail.
mod-list.json that will stop my mod from working if it is added to a save game that includes all these.
(If this mod is enabled at start, with these other mods, it works just fine! If this mod is enables afer a start without these mods present, it also works just fine. One of these other mods is causing the issue.)
Re: [MOD 0.16.x|0.15.x|0.14.x]Recycling Machines
Posted: Wed Feb 07, 2018 9:13 pm
by DRY411S
Further update. If I start a game with all the mods in the above list enabled, make a save, then disable bob's mods and add my own mod, then my mod works fine.
Conclusion is that my mod and Bob's have stopped working together properly.
Still, that doesn't matter does it? Nobody uses Bob's Mods.
Re: [MOD 0.16.x|0.15.x|0.14.x]Recycling Machines
Posted: Wed Feb 07, 2018 9:27 pm
by orzelek
Thats pretty strange.
Bob's mod set doesn't remove and/or rename automation techs in any way.
Might try one of two things:
1. Apply log() around the place and see if you can find something
2. Try to post a bug report and see if devs can help
Re: [MOD 0.16.x|0.15.x|0.14.x]Recycling Machines
Posted: Wed Feb 07, 2018 10:30 pm
by DRY411S
orzelek wrote:Thats pretty strange.
Bob's mod set doesn't remove and/or rename automation techs in any way.
Might try one of two things:
1. Apply log() around the place and see if you can find something
2. Try to post a bug report and see if devs can help
Yep I have a debug version with log() statements that confirms that the migration script runs, it finds the game recipes, finds my recycling recipes and enables them if the equivalent game recipes are also enabled.
Have PMed bobingabout and asked him for his views.
Re: [MOD 0.16.x|0.15.x|0.14.x]Recycling Machines
Posted: Wed Feb 07, 2018 10:43 pm
by DRY411S
Test cases so far:
If the game starts with my mod and Bobs: no problem
If my mod is added to a game that is using Bob's mods, none of my recipes are available in my recycling machines
If my mod is added to game where Bobs mods were used, but I disable Bob's and add mine, my recipes are available
Add Bobs mods back in again, my recipes are gone again
Start a game with only my mod, my recipes are there
Add Bob's mods to that game, my recipes are gone again
Start a game with my mod and Bob's: no problem
Remove Bob's Mods. My recipes are still present
Re-add Bob's mods back in, my recipes are gone again.
By "Bob's mods" I'm referring to the list of mods a few posts above, including third-party "Shiny Bob's Mods".
I'm wondering whether the regrouping of recipes into different tabs in crafting menus may have something to do with this. Although this hasn't seemed to be a problem before.
Re: [MOD 0.16.x|0.15.x|0.14.x]Recycling Machines
Posted: Thu Feb 08, 2018 4:56 am
by Mahribar
Allright. So I will as a start do nothing with my game, and will wait, until you and bobingabout have found a workaround. Right!?