[Scripting Assistance] Help referencing procedurally generated recipe name
Posted: Mon Jan 16, 2023 3:05 am
Heyo. Modding noob returning to development, and I'm having issues referencing a specific recipe function as I'm unsure what to call given it's dynamically generated. For a bit of further reference, this is the recipe I'm trying to reference, part of the mod Beekeeping in recipes.lua:
I'm wanting to edit the ingredients field, but without being able to reference the name of the dynamic recipe, I haven't been successful in doing so. With past assistance on another patch for the Beekeeping mod, I was informed of the technology.name:sub() method, but given this is both a recipe and has the only set-in-stone bit of text in the middle, using this to target the resulting recipes with 'larva' in them has stumped me.
Is there a way to specify looking for text regardless of placement in the resulting recipe name? Or another method to reference it?
Code: Select all
prototypes[#prototypes + 1] = {
type = 'recipe',
name = species.name .. '-larva-' .. i,
energy_required = 2,
ingredients = {{type = 'item', name = species.name .. '-queen-' .. i, amount = 1}},
results = results,
main_product = species.name .. '-larva',
category = 'larva-hatching',
enabled = false,
hidden = true
}
Is there a way to specify looking for text regardless of placement in the resulting recipe name? Or another method to reference it?