I'm currently working on a mod where I need to get a list of all of the qualities in the game. This should account for all the qualities added in the qualities mod/expansion and/or any that are from some random mod.
I looked into using data.raw["quality"][?] but I'm not really sure what would even go in the second part of that dictionary definition. Based on what I've seen in the documentation (https://lua-api.factorio.com/latest/types/Data.html) that's just going to end up specifying a specific quality/item/etc... and that's not quite what I want. I want an agnostic generic list of qualities without having to know specifically what's included.
Any and all help is appreciated!
What is the proper way to get a list of all qualities?
Re: What is the proper way to get a list of all qualities?
data.raw["quality"] has all the qualities. Thats what you need
Re: What is the proper way to get a list of all qualities?
It seems I've forgotten a few things in my question. Mostly that data.raw cannot be accessed in the control stage. So, I need a way to obtain a list of all of the qualities that is accessible in the control stage. Not for modification purposes, but so I can create an appropriate reference list for some logic I need for my mod.
Re: What is the proper way to get a list of all qualities?
prototypes.quality is what you want I think, it is a map from the name (string) to the LuaQualityPrototype.
https://lua-api.factorio.com/latest/cla ... otype.html
https://lua-api.factorio.com/latest/cla ... otype.html
Re: What is the proper way to get a list of all qualities?
Awesome! That was exactly what I needed.