[MOD 0.13.0+|v0.12]Recycling Machines

Topics and discussion about specific mods
User avatar
DRY411S
Filter Inserter
Filter Inserter
Posts: 703
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've just released v0.12.33. This uses a 100% return by default, but by adding a 'trigger' mod, you can change this to either 20, 40, 50, 60 or 80% :)

You need to download the main mod which recycles at 100% return, and as many of the trigger mods that you like. In the main Factorio screen on the mods screen, toggle the Trigger Mods to suit whatever return you want from the Recycling Machines. The Recycling Machines will use the HIGHEST trigger mod that you have enabled.

Download

Download Recycling Machines v0.12.33

Download Trigger mods

Download 20% Trigger
Download 40% Trigger
Download 50% Trigger
Download 60% Trigger
Download 80% Trigger

Thanks to Arch666Angel for the Trigger Mod idea.

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

Re: [MOD 0.12.33+]Recycling Machines

Post by DRY411S »

I've just released v0.12.34. This fixes a defect that was causing the amount returned from the Recycling Machines to be incorrect when the Trigger Mods were being used.

I've also changed the way the Trigger Mods work. Now, percentage return from the Trigger Mods is ADDED together. So before where you could have 20%, 40%, 50%, 60% and 80% returns, now you can have between 10% and 90% in 10% increments. :)

Download

Download v0.12.34Image

Download Trigger mods

Download 10% Trigger
Download 20% Trigger
Download 40% Trigger
Download 50% Trigger

You need to download the main mod which recycles at 100% return, and as many of the trigger mods that you like. In the main Factorio screen on the mods screen, toggle the Trigger Mods to suit whatever return you want from the Recycling Machines.

10% = 10% trigger
20% = 20% trigger
30% = 10% AND 20% triggers
40% = 40% trigger
50% = 50% trigger
60% = 10% AND 50% triggers
70% = 20% AND 50% triggers
80% = 10% AND 20% AND 50% triggers
90% = 40% AND 50% triggers
100% = NO trigger

If you select mods that add up to more than 100% (for example 20% + 40% + 50%) then the percentage is capped to 100%.

User avatar
Arch666Angel
Smart Inserter
Smart Inserter
Posts: 1636
Joined: Sun Oct 18, 2015 11:52 am
Contact:

Re: [MOD 0.12.33+]Recycling Machines

Post by Arch666Angel »

Now it's a mini game outside the game! :D

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

Re: [MOD 0.12.33+]Recycling Machines

Post by DRY411S »

Arch666Angel wrote:Now it's a mini game outside the game! :D
Maybe I should add two 1% triggers, a 2% and a 5% trigger, then people could have ANY percentage. ;)

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

Re: [MOD 0.13.0+]Recycling Machines

Post by DRY411S »

This is now released as v0.13.00 for Factorio v0.13.

It's available in the mod portal at https://mods.factorio.com/mods/DRY411S/ZRecycling

NateMcCloud
Burner Inserter
Burner Inserter
Posts: 8
Joined: Fri Jul 01, 2016 3:21 pm
Contact:

Re: [MOD 0.13.0+]Recycling Machines

Post by NateMcCloud »

I used this mod and attempted to load up my 0.12.33 save with it. I received this error message:

"Error while applying migration: Recycling Machines: ZRecycling_0.12.33.lua

Cannot execute command. Error: [string "-- ..."]: 16: attempt to index global 'ZRecycling' (a nil value)"

Starting a new game in 0.13.2, however, works just fine.

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

Re: [MOD 0.13.0+]Recycling Machines

Post by DRY411S »

NateMcCloud wrote:I used this mod and attempted to load up my 0.12.33 save with it. I received this error message:

"Error while applying migration: Recycling Machines: ZRecycling_0.12.33.lua

Cannot execute command. Error: [string "-- ..."]: 16: attempt to index global 'ZRecycling' (a nil value)"

Starting a new game in 0.13.2, however, works just fine.
Thanks I'll take look at that. The file which is giving that error is not used for a new world, only on saved worlds where the mod has not been used before. That explains why you see the error when you see it, and why you don't see it on new worlds. Now I need to figure why you see it at all. :)

NateMcCloud
Burner Inserter
Burner Inserter
Posts: 8
Joined: Fri Jul 01, 2016 3:21 pm
Contact:

Re: [MOD 0.13.0+]Recycling Machines

Post by NateMcCloud »

DRY411S wrote:
NateMcCloud wrote:I used this mod and attempted to load up my 0.12.33 save with it. I received this error message:

"Error while applying migration: Recycling Machines: ZRecycling_0.12.33.lua

Cannot execute command. Error: [string "-- ..."]: 16: attempt to index global 'ZRecycling' (a nil value)"

Starting a new game in 0.13.2, however, works just fine.
Thanks I'll take look at that. The file which is giving that error is not used for a new world, only on saved worlds where the mod has not been used before. That explains why you see the error when you see it, and why you don't see it on new worlds. Now I need to figure why you see it at all. :)
Heh heh, I gathered that. :P I took a look at the raws myself, and looked in the migration file for 0.12.33. The line it's referring to is the one with "ZRecycling.Unlock_Recipe(stuff)". I'm no expert modder, but the only possibilities I can see are that either the migration file is being run before control.lua. or the declaration of the "ZRecycling" global table is not reaching the migration files.

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

Re: [MOD 0.13.0+]Recycling Machines

Post by DRY411S »

I've been having a discussion about 0.13 mod comparability in another topic. Somebody in that topic has suggested that this may be a bug in Factorio 0.13.x and migration scripts. ZRecycling.Unlock_Recipe is defined in the mom's control.lua. so it will be nil if Factorio is not running it and there's not much I can do to fix that. :)

NateMcCloud
Burner Inserter
Burner Inserter
Posts: 8
Joined: Fri Jul 01, 2016 3:21 pm
Contact:

Re: [MOD 0.13.0+]Recycling Machines

Post by NateMcCloud »

Oof...damn...and I was hoping to be able to run it in my current save. :( Ah well...

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

Re: [MOD 0.13.0+]Recycling Machines

Post by DRY411S »

NateMcCloud wrote:Oof...damn...and I was hoping to be able to run it in my current save. :( Ah well...
Hmm I'm just about to disappear for the weekend too. If you're confident with looking at the raws (as you seem to be) this *might* work. Just delete ZRecycling_0.12.32.lua and ZRecycling_0.12.33.lua in the migrations folder, leaving only ZRecycling_0.13.00.lua.

NateMcCloud
Burner Inserter
Burner Inserter
Posts: 8
Joined: Fri Jul 01, 2016 3:21 pm
Contact:

Re: [MOD 0.13.0+]Recycling Machines

Post by NateMcCloud »

I'll give that a shot in a little while. Thanks for the tip!

Sakata
Burner Inserter
Burner Inserter
Posts: 18
Joined: Tue Apr 05, 2016 11:34 pm
Contact:

Re: [MOD 0.13.0+]Recycling Machines

Post by Sakata »

Can't leave the 13.0 one in either. Just ditch the entire migrations folder and it works fine.

NateMcCloud
Burner Inserter
Burner Inserter
Posts: 8
Joined: Fri Jul 01, 2016 3:21 pm
Contact:

Re: [MOD 0.13.0+]Recycling Machines

Post by NateMcCloud »

Sakata wrote:Can't leave the 13.0 one in either. Just ditch the entire migrations folder and it works fine.
That worked, but it didn't enable the recyclers to be crafted. I found a way around this, however...

Depending on how many levels of automation you've already researched, run these console commands:

/c game.player.force.technologies['automation'].researched = false
/c game.player.force.technologies['automation'].researched = true

/c game.player.force.technologies['automation-2'].researched = false
/c game.player.force.technologies['automation-2'].researched = true

/c game.player.force.technologies['automation-3'].researched = false
/c game.player.force.technologies['automation-3'].researched = true

Granted, using console commands will disable further achievement gains on that save file...

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

Re: [MOD 0.13.0+]Recycling Machines

Post by DRY411S »

NateMcCloud wrote:
Sakata wrote:Can't leave the 13.0 one in either. Just ditch the entire migrations folder and it works fine.
That worked, but it didn't enable the recyclers to be crafted. I found a way around this, however...

Depending on how many levels of automation you've already researched, run these console commands:

/c game.player.force.technologies['automation'].researched = false
/c game.player.force.technologies['automation'].researched = true

/c game.player.force.technologies['automation-2'].researched = false
/c game.player.force.technologies['automation-2'].researched = true

/c game.player.force.technologies['automation-3'].researched = false
/c game.player.force.technologies['automation-3'].researched = true

Granted, using console commands will disable further achievement gains on that save file...
What you are keying in on the console is part of what is done by the scripts that you have disabled.

I'll take a look at this early next week.

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

Re: [MOD 0.13.0+]Recycling Machines

Post by DRY411S »

This is now fixed. Some people still playing Factorio v0.12 were reporting issues, so I have released a new v0.12 and a new v0.13.

v0.13.10 is available from the mod portal https://mods.factorio.com/mods/DRY411S/ZRecycling

v0.12.35 is available from my GitHub https://github.com/DRY411S/Recycling-Ma ... g/v0.12.35

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

Re: [MOD 0.13.0+]Recycling Machines

Post by DRY411S »

v0.13.11 is now available from the mod portal https://mods.factorio.com/mods/DRY411S/ZRecycling

This is a fix for https://github.com/DRY411S/Recycling-Machines/issues/8 where v0.13 of Bob's Mods and this mod were incompatible.


User avatar
Mooncat
Smart Inserter
Smart Inserter
Posts: 1184
Joined: Wed May 18, 2016 4:55 pm
Contact:

Re: [MOD 0.12.33+]Recycling Machines

Post by Mooncat »

DRY411S wrote: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.
Hi, I saw your mods on mod portal. It feels a little bit weird to see a mod separated into different entries. And a question came to my mind: how the hell can someone maintain their works like this? If something is changed, he needs to apply the change 4 times. :shock:
Then I saw this post...

Yes, recipes and other things can only be created in data phase. They are all loaded during the loading screen of the game. Once loaded, the data table is gone and no more things can be added. So, in-game configuration is not a good option.

But you can also consider pre-game configuration which I would prefer in your mod as a player. You can put the value in, for example, config.lua. Then, use this value to create recipes in data.lua. The data file is just a lua file anyway, you can still do some maths inside it. ;)
I want to play more Factorio. I want to mod more Factorio.
But life sucks. So many things I need to do. So many things I want to do. So little time.

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

Re: [MOD 0.12.33+]Recycling Machines

Post by DRY411S »

Mooncat wrote:
Hi, I saw your mods on mod portal. It feels a little bit weird to see a mod separated into different entries. And a question came to my mind: how the hell can someone maintain their works like this? If something is changed, he needs to apply the change 4 times. :shock:
Agreed, but I implemented it this way to make it easier for the player, not easier for the Modder. :)
Mooncat wrote:Yes, recipes and other things can only be created in data phase. They are all loaded during the loading screen of the game. Once loaded, the data table is gone and no more things can be added. So, in-game configuration is not a good option.

But you can also consider pre-game configuration which I would prefer in your mod as a player. You can put the value in, for example, config.lua. Then, use this value to create recipes in data.lua. The data file is just a lua file anyway, you can still do some maths inside it. ;)
We will have to agree to disagree. :) To change the percentage by unzipping the mod, opening the config.lua and editing it was in my opinion too much to expect a player to do. Allowing them to change percentages using the in-game Mods menu is a better way for a normal player.

And of course, the 'triggers' are optional. I didn't want to force people to use a trigger.

Locked

Return to “Mods”