In Lua, when you write a table like this:
M.QUALITY_COLORS = {
normal = "white",
normal-plus = "white", -- this breaks it
}
Treated as math: normal - plus
Which obviously makes no sense in this context — it's not a valid key or variable. That’s why it throws a syntax error near =.
In Lua, if a table key contains characters that are not valid in identifiers (like -), you must use both:
Quotes (to make it a string)
Square brackets (to treat it as a key expression)
Proper table
M.QUALITY_COLORS = {
["normal-plus"] = "white",
["uncommon-plus"] = "green",
["rare-plus"] = "blue",
[ "epic-plus"] = "purple",
["legendary-plus"] = "orange",
}
This feature isn’t very beginner-friendly — it’s more suited for advanced users.
I also totally forgot to mention that you need to assign the qualities in data.lua as well.
The whole system is kind of aimed at people who already know how to mod Factorio.
Replace this line in data.lua
local qualities = { "uncommon", "rare", "epic", "legendary","prismatic", "mythic" } with
local qualities = { "uncommon", "rare", "epic", "legendary", "prismatic", "mythic", "normal-plus", "uncommon-plus", "epic-plus", "legendary-plus" }
and then you need to add proper .png files to graphics/quality.
Also, the .png file names need to match the full quality name exactly, like:
quality-normal-plus.png
quality-uncommon-plus.png
quality-epic-plus.png
and so on.
Make sure the file names match exactly — that’s how the system knows which icon to load.
If you still get errors, I’ll help you out, just let me know.
Good luck with modding!
PS: I checked out the Quality Plus mod. It doesn’t have its own .PNG icons but uses layered icons, which my logic doesn’t support. Also, if you add too many qualities, my GUI breaks. I’m working on a solution and will probably have it done by the weekend, so hang tight!