Schall Uranium Processing


Separate pure uranium-235 and pure uranium-238 items? Real-world nuclear industry do NOT work like that! This mod introduces more realistic uranium items of different grades and more realistic uranium enrichment processing. Recipes are kept simple, so even vanilla players will find this easy to master with. (Locale: English, Deutsch, 正體中文, 简体中文, Português Brasileiro, Русский)

Content
3 hours ago
0.17 - 2.0
8.12K
Manufacturing

b [Responded] Mod stop MOX fuel from Plutonium Energy working with Realistic Reactors (Bug from Realistic Reactors)

4 years ago
(updated 4 years ago)

As per my post on Plutonium Energy
https://mods.factorio.com/mod/PlutoniumEnergy/discussion/5eb744f3196b32000d5f343f

Steps to reproduce: Factor 0.18.22
1) Install Realistic Reactors, Plutonium Energy, and Schall Uranium Processing.
2) Place reactor from Realistic Reactors, notice you can't put MOX fuel into them.
Without Schall Uranium Processing, MOX fuel can be used in the reactors as intended.

4 years ago

First of all, I feel very surprised if my mod has anything to do with fuel categories with reactors. This mod does NOT have a single line about fuel categories.
This mod has quite short code (esp. compared to Realistic Reactors). You can spend like 5-10 minutes exploring this mod and find this out. It is merely adding uranium concentrate, LEU and some recipe changes. Really, I have not touched the fuel categories.

If you highlight those reactors and fuel cells and see the tooltips, you can see what mods have modified them. This mod is totally not involved!

The test results are a bit strange. So let me list them out.

Set A:
- Factorio 0.18.18
- SchallUraniumProcessing_0.18.1
- RealisticReactors_2.18.14
- PlutoniumEnergy_1.1.7

MOX fuel can be used in RR Nuclear Reactor and Nuclear Breeder Reactor.

Set B:
- Factorio 0.18.22
- SchallUraniumProcessing_0.18.1
- RealisticReactors_2.18.14
- PlutoniumEnergy_1.1.10

MOX fuel CANNOT be used in RR Nuclear Reactor and Nuclear Breeder Reactor.

After some thought, I guess it seems to be related to mod load order, where there RR has placed it fuel categories code in the wrong data phase.
RR 2.18.14 does the fuel category addition in entities.lua line 233:

table.insert(reactor_template.energy_source.fuel_categories,"PE-MOX")

However, it is loaded in data.lua phase. That means that fuel categories added later than that will be missed.
PE has an optional dependency on this mod (SUP), so loaded after RR if SUP is present.

Solution:
1/ Move the fuel categories addition line to data-updates.lua or data-final-fixes.lua. It should NOT be in data.lua phase in the first place!
2/ If not, then RR need to use optional dependencies on PE.

PS: Although I found out the bug and solution, I am the least related one among the three mods.

4 years ago

Further look into RR code about fuel categories. I found that apart from entities.lua (as mentioned above, data.lua phase), categories are inserted again in data-final-fixes.lua (but adds "thorium" and "deuterium" only).
So apart from prototype initial declaration, fuel categories are added in two different places. I wonder why it is coded in such a way.

I applied the simpler solution 2 (optional dependency on PE to RR info.json), it immediately works.
So I am sure that the bug comes from RR. Nothing related to PE nor SUP.
I am curious why you sent this bug report to both PE and SUP, but not RR?

4 years ago

Thanks for looking into this Schall. I barely have any experience with Factorio's modding systems, so I was assuming the relation was here since removing yours fixed the issue, but like you said, it made no sense since your mod doesn't modify fuels.

I'll give that fix a go, and I see that John from PE passed the issue on to RR.

Thanks again, and hope you have a great day!

3 years ago

Thanks for solution 2!

New response