Page 1 of 1

[2.0] LuaRecipe missing quality

Posted: Wed Oct 30, 2024 6:41 am
by sirhc
I've spent some time looking over the documentation, the forum and running commands but I can't seem to work out the quality of an assembly machine's recipe.

I'm aware result_quality will tell me the expected quality of a resource being created, but it feels like .get_recipe() is missing .quality in the LuaRecipe class.

Is anyone able to provide guidance?

Re: [2.0] LuaRecipe missing quality

Posted: Mon Nov 04, 2024 12:49 pm
by LCStark
`LuaEntity` defines `get_recipe()` as `get_recipe() → LuaRecipe?, LuaQualityPrototype?`, so it returns two values separately - the recipe and the quality. Something like this should be what you're looking for:

Code: Select all

local assembler = [...]
[...]
local recipe, quality = assembler.get_recipe()

Re: [2.0] LuaRecipe missing quality

Posted: Thu Nov 07, 2024 6:01 am
by sirhc
Nearly 2 weeks of trying to fix this issue, and it was solely because I didn't understand lua behaviour.

I greatly appreciate your kind and well-put-together response.