Page 1 of 2
Request: Move recycling recipe generation to data-final-fixes
Posted: Wed Dec 18, 2024 10:43 am
by KiwiHawk
It is common for mods to to update recipe ingredients in data-updates stage (we do it to almost every recipe in Bob's & Angel's, depending on which mods / settings are enabled). However this is after the recycling recipes have been generated (as official mods run first). Moving the recycling recipe generation to data-final-fixes seems like the obvious solution. This would still leave the possibility of mods changing the recipes after in their own data-final-fixes.
Re: Request: Move recycling recipe generation to data-final-fixes
Posted: Wed Dec 18, 2024 10:44 am
by thesixthroc
+1
Re: Request: Move recycling recipe generation to data-final-fixes
Posted: Wed Dec 18, 2024 10:47 am
by Quezler
at the very least some better documentation about how to regenerate it from your own mod
Re: Request: Move recycling recipe generation to data-final-fixes
Posted: Wed Dec 18, 2024 11:08 am
by IsaacOscar
I agree, however you can just put:
Code: Select all
if mods["quality"] then require("__quality__.data-updates") end
In your own mods data-final-fixes (data, data-updates, or anywhere else after you've added or changed recipes)
Re: Request: Move recycling recipe generation to data-final-fixes
Posted: Wed Dec 18, 2024 11:59 am
by curiosity
IsaacOscar wrote: ↑Wed Dec 18, 2024 11:08 am
you can just put:
Code: Select all
require("__quality__.data-updates")
In your own mods data-final-fixes
Furthermore, you can put it in your data-updates even, after you change the recipes.
Re: Request: Move recycling recipe generation to data-final-fixes
Posted: Wed Dec 18, 2024 12:14 pm
by IsaacOscar
curiosity wrote: ↑Wed Dec 18, 2024 11:59 am
Furthermore, you can put it in your data-updates even, after you change the recipes.
Sure, I've updated my post to with more possibilities, and I added an 'if' check.
Re: Request: Move recycling recipe generation to data-final-fixes
Posted: Wed Dec 18, 2024 12:21 pm
by Rseding91
I do not believe we will be doing this. Next someone will ask for a final final fixes because they want to add recipes in final fixes and then have recycling recipes made.
And then a request to move it to final final final fixes.
Re: Request: Move recycling recipe generation to data-final-fixes
Posted: Wed Dec 18, 2024 12:33 pm
by IsaacOscar
Rseding91 wrote: ↑Wed Dec 18, 2024 12:21 pm
I do not believe we will be doing this. Next someone will ask for a final final fixes because they want to add recipes in final fixes and then have recycling recipes made.
And then a request to move it to final final final fixes.
Ok, creating more 'final fixes' is probably not a good idea, but 'data-final-fixes.lua' already exists.
Re: Request: Move recycling recipe generation to data-final-fixes
Posted: Wed Dec 18, 2024 12:41 pm
by curiosity
You know, turns out you can call the recycling recipe generator for specific items, just like __quality__/data-updates.lua itself does. What is this request even about then?
Re: Request: Move recycling recipe generation to data-final-fixes
Posted: Wed Dec 18, 2024 12:53 pm
by IsaacOscar
curiosity wrote: ↑Wed Dec 18, 2024 12:41 pm
You know, turns out you can call the recycling recipe generator for specific items, just like __quality__/data-updates.lua itself does. What is this request even about then?
Automating it! In particular, so modders don't need to know about the recycling generator, and players can get them automatically (unless they make recipe changes in data-final-fixes.lua, hence why they'd need a data-final-final-fixes)
In fact this behaviour even caused one not-a-bug report,
122635.
Re: Request: Move recycling recipe generation to data-final-fixes
Posted: Wed Dec 18, 2024 7:11 pm
by micromario
I agree with rseding here. It's convenient for mods to modify the recycling recipes in data updates instead of having to perform recycling modification in final fixes.
What's the reason that B+A recipes must be defined in data updates?
Re: Request: Move recycling recipe generation to data-final-fixes
Posted: Wed Dec 18, 2024 7:15 pm
by Khazul
Barrelling auto recipe generation should probably more there as well for the same reason.
Re: Request: Move recycling recipe generation to data-final-fixes
Posted: Wed Dec 18, 2024 8:13 pm
by lyvgbfh
Rseding91 wrote: ↑Wed Dec 18, 2024 12:21 pm
I do not believe we will be doing this. Next someone will ask for a final final fixes because they want to add recipes in final fixes and then have recycling recipes made.
And then a request to move it to final final final fixes.
I disagree with this line of reasoning; the requested change is in context of the issue being discussed. As the author states that Wube mods are given precedence in the load order, the
simplest suggestion is the one given. It could also be done by excluding recycling from the load-first logic and allowing the regular order to take place, or any number of other hacks that would being the desired result without moving recycling to final-fixes.
This is not to say that a hacky workaround is worth considering, but that in responding to a request it's worth addressing the whole. The interface request is much more about saying x behavior is undesirable than y fix is the One True Way to resolve it.
Re: Request: Move recycling recipe generation to data-final-fixes
Posted: Thu Dec 19, 2024 12:17 pm
by curiosity
micromario wrote: ↑Wed Dec 18, 2024 7:11 pm
It's convenient for mods to modify the recycling recipes in data updates instead of having to perform recycling modification in final fixes.
Why would a mod want to programmatically transform the recycling recipes while not specifically targeting them (and thus depending on Quality)?
Re: Request: Move recycling recipe generation to data-final-fixes
Posted: Thu Dec 19, 2024 12:23 pm
by IsaacOscar
curiosity wrote: ↑Thu Dec 19, 2024 12:17 pm
micromario wrote: ↑Wed Dec 18, 2024 7:11 pm
It's convenient for mods to modify the recycling recipes in data updates instead of having to perform recycling modification in final fixes.
Why would a mod want to programmatically transform the recycling recipes while not specifically targeting them (and thus depending on Quality)?
Whether or not you depend on quality won't make a difference: Wube mods are always loaded first,
Also you might only want an
optional dependency so people who haven't bought space age can still use your mod.
Re: Request: Move recycling recipe generation to data-final-fixes
Posted: Thu Dec 19, 2024 12:36 pm
by curiosity
IsaacOscar wrote: ↑Thu Dec 19, 2024 12:23 pm
Whether or not you depend on quality won't make a difference: Wube mods are always loaded first,
Also you might only want an
optional dependency so people who haven't bought space age can still use your mod.
Both points irrelevant to the case. While the second is an obvious nitpick (optional dependency
is dependency) and you are missing the point with the first, I'll tell you why the first argument is not valid in any context since it's raised in here so often: there is no way to specify loading before another mod. Any name hacks you might employ is exactly that: hacks. The load order outside of dependencies is unspecified and can't (read shouldn't) be relied on.
Re: Request: Move recycling recipe generation to data-final-fixes
Posted: Thu Dec 19, 2024 7:22 pm
by KiwiHawk
curiosity wrote: ↑Thu Dec 19, 2024 12:17 pm
Why would a mod want to programmatically transform the recycling recipes while not specifically targeting them (and thus depending on Quality)?
Real example:
Bob's and Angel's mods modify a LOT of recipes, swapping out ingredients. This happens in data-updates stage. Recycling recipes have already been generated so the recycling recipe would need to be modified too or regenerated.
1. Angel's Smelting adds items, techs and recipes for smelting Aluminum Plate (data).
2. At least one other mod tells Angel's Smelting that Aluminum Plate should be enabled (data).
3. Recycling recipes are generated (data-updates).
4. Recipes are modified, adding Aluminum Plate (data-updates).
5. Recycling recipes are modified, adding Aluminum Plate (data-updates).
I want 4. to happen before 3. so that 5. doesn't need to happen! And no, 4. can't happen in data stage as it needs to happen after 2.
Re: Request: Move recycling recipe generation to data-final-fixes
Posted: Thu Dec 19, 2024 7:54 pm
by curiosity
KiwiHawk wrote: ↑Thu Dec 19, 2024 7:22 pm
Real example:
Bob's and Angel's mods modify a LOT of recipes, swapping out ingredients. This happens in data-updates stage. Recycling recipes have already been generated so the recycling recipe would need to be modified too or regenerated.
1. Angel's Smelting adds items, techs and recipes for smelting Aluminum Plate (data).
2. At least one other mod tells Angel's Smelting that Aluminum Plate should be enabled (data).
3. Recycling recipes are generated (data-updates).
4. Recipes are modified, adding Aluminum Plate (data-updates).
5. Recycling recipes are modified, adding Aluminum Plate (data-updates).
I want 4. to happen before 3. so that 5. doesn't need to happen! And no, 4. can't happen in data stage as it needs to happen after 2.
Not a valid example. Not only you
are specifically targeting recycling recipes, but it's also something you want to avoid. Moving the recycling generation to data-final-fixes won't make this harder for you (look what I replied to!).
Re: Request: Move recycling recipe generation to data-final-fixes
Posted: Thu Dec 19, 2024 8:38 pm
by KiwiHawk
curiosity wrote: ↑Thu Dec 19, 2024 7:54 pm
Not a valid example. Not only you
are specifically targeting recycling recipes, but it's also something you want to avoid. Moving the recycling generation to data-final-fixes won't make this harder for you (look what I replied to!).
I realize that it's different to what you were replying to. However it's a valid example of why I would like this change. The purpose of this thread.
You're correct, moving recycling generation to data-final-fixes won't make things harder. It'll make things easier. That's the whole point!
Re: Request: Move recycling recipe generation to data-final-fixes
Posted: Thu Dec 19, 2024 9:51 pm
by curiosity
KiwiHawk wrote: ↑Thu Dec 19, 2024 8:38 pm
I realize that it's different to what you were replying to. However it's a valid example of why I would like this change. The purpose of this thread.
You're correct, moving recycling generation to data-final-fixes won't make things harder. It'll make things easier. That's the whole point!
If you wanted to reply to my earlier post, you should have done so directly instead of beating around the bush. Then I'd have told you that recycling does seem like something "final", i.e. what data-final-fixes is for. And if it really is common practice to finish defining your recipes in data-updates, then it should be moved.