Sulfur Production from Oils


Changes which fluids sulfur production uses and balances the efficiency of them towards heavy oil. Concept is to move uses of the oil byproduct fluids around so the system is less demanding on petroleum gas and gives outlets for everything else.

Content
2 years ago
0.17 - 1.1
670
Fluids Manufacturing

g [Done] Bug

4 years ago
(updated 4 years ago)

You've got a bug when not using Pre0-17-60Oil because your settings.lua only makes the setting when using that mod but recipes.lua looks for the setting regardless.

If your thinking was that the setting would be false when one doesn't use the oil mod, the problem is that settings.startup[].value tries to index something called "value" from a nil object in this case. You could just change this to "if settings.startup[blah] and settings.startup[blah].value then"

4 years ago

I thought I did.... Can you give me the exact file and line number that throws the error?

4 years ago
(updated 4 years ago)

well of course there's just one the setting, and then it's line 12 in recipes.lua. Although, now that I looked, ignore my original suggestion! Because I want to enable light oil while also keeping the PG sulfur. I see what you're going for here now that I've looked over all of the if statements, but I'd like to be able to turn on heavy and light sulfur without affecting the vanilla recipes at all.

4 years ago
(updated 4 years ago)

Oh, and the error is just "attempt to index field 'sulfurblahblah-enablealtrecipes' ( a nil value)"

4 years ago
(updated 4 years ago)

Ok, I’ll try to get that fixed tonight. I’m going with the family on collage tours the next few days so won’t have time after.

Yeah, what I was trying to go for was when used without the other mod, all 3 recipes were made available and no option to disable (as BOP now only puts out pg, there’s no sense in disabling it). With the Pre 0.17.60 Oil mod, by default, it should only have the heavy version with the option to enable light and vanilla.

So, are you looking for an option to toggle light and pg versions separately from each other?

4 years ago
(updated 4 years ago)

No need to add toggles for all of them just for me. It sounds like what you were going for is what I also want: for the mod to turn on sulfur recipes for light and heavy oil when it does not detect the other oil mod. But your code as written, I believe, will only turn on heavy oil sulfur when the other mod is not detected (and crashes because it tries to find a setting that only exists when the other mod is present). So it sounds like if you solve it for what your original purpose was, this is also what I wanted.

If you changed line 12 to say "if not settings.startup[blah] or settings.startup[blah].value then", if should activate the light oil recipe either when the other oil mod is not present or the other mod is present (since this means the setting exists) and the setting is on, while also preventing the code from trying to index a value through a table that doesn't exist.

4 years ago

Yup, screwed that up. lol Should be fixed now!

New response