Page 1 of 1

Procedural prototype name migrations

Posted: Thu Aug 27, 2026 5:30 pm
by Malidictus
In updating Alchemistry, I ran into the issue of having to update the prototype names of procedurally-generated recipes. The recipe list is generated from resources potentially added by other, unknown mods. As such, it's physically impossible to know the full list of recipes (and recipe prototype names) which would need to be renamed. That information only becomes available during the data-updates stage, where those recipes are generated. JSON migration requires exact recipe names, so that's not a viable method. Lua migration does not allow renaming prototypes. I'd like to request a feature which does this, and I have a couple of possible options:
  • 1. Regular expressions inside the JSON file, with the ability to retain part of the match. Let's say for instance I want to rename all "advanced generation" recipes, with a command like this: ["advanced-%1-generation", "alchemistry-advanced-%1-generation"]. That way, I don't need to know every single recipe which was generated, I only need to know the naming convention, which is consistent and under my direct control.
  • 2. A Lua helper function which finds every place a prototype is used, which can be fed a new prototype name. This way, I don't need to worry if a recipe has been set in a machine, in the ghost of a machine, in a blueprint, or in some exotic structure that a mod has defined. This would allow me to walk the list of prototypes, match by regular expression, and change accordingly.
I'm told that something like this was available at some point, but removed for compelling reasons. As such, I understand that this may not be a reasonable request. However, it doesn't hurt to try.

Re: Procedural prototype name migrations

Posted: Thu Aug 27, 2026 6:06 pm
by Thremtopod