Better Quality deprecated


Adds quality scaling to belt speed, drill/pumpjack mining speed, cargo/fluid wagon size, storage tank size, and locomotive speed/power usage, adds options for speed module quality penalty, quality module quality bonus, and adds a number of optional quality-related items and entities.

Tweaks
1 year, 1 month ago
2.0
4.07K
Transportation Logistics Trains Combat Armor Mining Fluids Logistic network Circuit network Manufacturing Power Storage

b [Resolved] Error on start up

1 year, 1 month ago

2.1.0:

Failed to load mods: better-quality/data-final-fixes.lua:48: attempt to perform arithmetic on field 'amount' (a nil value)
stack traceback:
better-quality/data-final-fixes.lua:48: in main chunk

1 year, 1 month ago
(updated 1 year, 1 month ago)

That's part of the function that auto-generates the bulk recycling recipes. Based on the error, it sounds like a malformed recycling recipe added by one of your mods. I'll add a nil check that should prevent the error from occurring.

1 year, 1 month ago

Submitted v2.1.1. Let me know if it fixes the issue.

1 year, 1 month ago
(updated 1 year, 1 month ago)

Resolved thank you :-) I have 400 mods so this helped a lot.

1 year, 1 month ago

Thanks for trying out my mod. Marking as resolved :)

1 year, 1 month ago
(updated 1 year, 1 month ago)

Is this the same error again or new fun? I disabled all the mods I have that mess with Recyling and still got this error?

Failed to load mods: better-quality/data-final-fixes.lua:59: attempt to index field '?' (a nil value)
stack traceback:
better-quality/data-final-fixes.lua:59: in main chunk

1 year, 1 month ago
(updated 1 year, 1 month ago)

It's not recycling mods that are the issue, any mod that adds any item that can be recycled will go through this code. I'm using a function that someone gave me to try to find an item's prototype but apparently it failed in this instance. New issue due to new code. Another day, another nil check.

1 year, 1 month ago

Submitted v2.1.5, let me know if it works.

1 year, 1 month ago

Yes, it now builds :-)

My unwanted Lua scripting advice if you are going have functions that will be dealing with unknown data sets, would be to use pcall and that way you can catch the errors and aim to have a handler function that'll sort out 99% of the chaos for you.

1 year, 1 month ago
(updated 1 year, 1 month ago)

Not unwanted at all! Looks like I removed it from the mod description by accident, but this mod is actually both my first time using Lua and my first time modding Factorio so I appreciate any help.

As for pcall, that seems interesting and I wasn't aware of that previously. It's basically errors as values like Go, but only when you want it.

1 year, 1 month ago

I've been using LUA for work for 5ish years, I wish I didn't have to. I've found if you do functional over OOP with LUA you have less pain, but that's a sample size of me so grain of salt

1 year, 1 month ago

I've been using LUA for work for 5ish years, I wish I didn't have to. I've found if you do functional over OOP with LUA you have less pain, but that's a sample size of me so grain of salt

Totally unrelated to the mod (sorry author!) but i'm curious what "functional over OOP with LUA" means, coming from a background of working with OOP based languages

1 year, 1 month ago
(updated 1 year, 1 month ago)

A Functional method/function;
- just does *one specific thing.
- it is stateless & deterministic
- it don't mess with other stuff (no coupling :-)) .
- it can be assigned to variables, passed as arguments, and returned from other functions.

so in this case you'd have a protected call function call others

If you are using more than 3 indents you're not functional (exaggerating but I've used this to help juniors)

1 year, 1 month ago

still getting the nil check error at game start up with version 2.1.5 [same error as #5 here] => 680884ff6436488ec8dadf56?quote=5

1 year, 1 month ago

Let me know if the new update helps.

1 year, 1 month ago

unfortunately it didn't. just tried it

1 year, 1 month ago

Are you sure the error is exactly the same? Same line number and everything?

1 year, 1 month ago

no, Failed to load mods: better-quality/data-final-fixes.lua:56: attempt to index field '?' (a nil value)
stack traceback:
better-quality/data-final-fixes.lua:56: in main chunk

1 year, 1 month ago

sorry about that misread/dyslexic-ed the 59/56

1 year, 1 month ago

That means that one of your mods added a recycling recipe that somehow has no ingredients which I... I don't even know anymore. A smarter version of me would have stopped making assumptions in my code a long time ago, but better late than never.

1 year, 1 month ago
(updated 1 year, 1 month ago)

ok. weird. probably disable it then. bug's in that one probably

1 year, 1 month ago

as for your code, well, pretty sure you're doing the best you can :) . have a suspicion which one, but unsure. will update

1 year, 1 month ago
(updated 1 year, 1 month ago)

as for your code, well, pretty sure you're doing the best you can :) . have a suspicion which one, but unsure. will update.

edit: ok, it loaded. disabled a few after disabling the suspected one didn't. more testing

edit 2: enabled the suspect, and confirmed, it's not it. running on latest experimental, FYI. was running stable before with identical error msgs

edit 3: found the exact mod, lagless promethium, https://mods.factorio.com/mod/lagless_promethium . crashed with that weird ? nil check.

1 year, 1 month ago
(updated 1 year, 1 month ago)

I was unable to reproduce the error with Lagless Promethium installed myself, but hopefully the latest update fixes the issue regardless.

1 year, 1 month ago

it did, TY so much

New response