Safe to run: __quality__.data-updates ?

Place to get help with not working mods / modding interface.
0n0w1c
Inserter
Inserter
Posts: 29
Joined: Sat Sep 09, 2023 1:43 pm
Contact:

Safe to run: __quality__.data-updates ?

Post by 0n0w1c »

Is running __quality__.data-updates from data-updates.lua supposed to be safe?

When I call it, it changes the recycling recipe for nutrients from spoilage to biter eggs.
To me, this is an unexpected result. I am not sure if it is a bug or I should not be calling it.
0n0w1c
Inserter
Inserter
Posts: 29
Joined: Sat Sep 09, 2023 1:43 pm
Contact:

Re: Safe to run: __quality__.data-updates ?

Post by 0n0w1c »

Code: Select all

    local recipe = data.raw.recipe[recipe_name]
    
    if mods["quality"] then
        local recycling = require("__quality__/prototypes/recycling")

        recycling.generate_recycling_recipe(recipe)
        recipe.auto_recycle = nil
    end
Maybe the proper way is to (re)-generate a specific recycling recipe?
robot256
Smart Inserter
Smart Inserter
Posts: 1076
Joined: Sun Mar 17, 2019 1:52 am
Contact:

Re: Safe to run: __quality__.data-updates ?

Post by robot256 »

No you're not supposed to call entire Lua files like that. In the data phase, all mods share the same Lua instance so all the functions defined already in Quality are available to you.

Instead, call the function that Quality defines and pass it the name of specific items you want to add recycling recipes for. Or at least read the files in the Quality mod and see what makes sense to call/borrow.
Post Reply

Return to “Modding help”