curiosity wrote: Wed Jan 01, 2025 3:25 pm
It will, if you set it to false.
...Oh, it's supposed to be a function. This is why it needs to be documented.
For anyone confused by what's going on
auto_recycle is a field on recipe prototypes, it should be false, true, or nil (the last two are the same as not setting it)
can_recycle is the
paramater to the generate_recycling_recipe function, it should be a function that returns true, false, or nil, or itself be nil (the last is the same as ommitting it).
Neither auto_recycle nor
can_recycle should be a function
There are two ways to call the generate_recycling_recipe function:
Code: Select all
local recycling = require("__quality__.prototypes.recycling")
recycling.generate_recycling_recipe(recipe)
recycling.generate_recycling_recipe(recipe, function(r)
...
end)
The first call will not generate a recycling recipe if either auto_recycle is false (and not nil),
or, one of the built in exclusions apply.
The second call will generate a recycling recipe if the given function returns true, of some other non-false/nil value (the r parameter will always equal the given recipe, so I don't know why it doesn't just let you pass a boolean).
(Except that neither will generate a recipe if the recipe does not hace exactly one non-fluid output, or if the recipe has no non-fluid ingredients).
Note that auto_recycle is only read by the lua code in the quality mod, so if you don't call generate_recycling_recipe or it isn't called automatically, the game will completely ignore it. Also can_recycle is never actually passed by the games lua code, so I think it's just their for modders or something they forgot to delete.