Add EntityPrototype properties for more control of upgrade planner
Posted: Fri Mar 06, 2026 11:13 pm
My mod Rigor Module, in order to implement a new module effect, needs to create a bunch of hidden copies of entity prototypes. Crafting-machine entities get "hot-swapped" at runtime with their hidden "rigor" versions, depending on the rigor modules they do or don't have inserted. This works almost perfectly, but the only feature that doesn't have a good way of handling this is the upgrade planner.
I think this requires two properties, one for specifying an entity's matching "upgrade from" filter, and one for hiding entities from the UI.
EntityPrototype::deconstruction_alternative is very useful in that it lets you collapse multiple entities into a single filter in the deconstruction planner (and this works seamlessly with the hidden "rigor" entities). I think a version of this property would work well for "upgrade from"; i.e., something like EntityPrototype::upgrade_from_alternative. It would likely need to be limited to entities meeting both the criteria for EntityPrototype::deconstruction_alternative EntityPrototype::next_upgrade. Similar to how "deconstruction_alternative" encompasses multiple entity prototypes.
For handling the UI clutter, I think some version of EntityPrototype::hidden_in_upgrade_planner would be enough. Just a way for these entities not to clutter the interface.
I think this requires two properties, one for specifying an entity's matching "upgrade from" filter, and one for hiding entities from the UI.
EntityPrototype::deconstruction_alternative is very useful in that it lets you collapse multiple entities into a single filter in the deconstruction planner (and this works seamlessly with the hidden "rigor" entities). I think a version of this property would work well for "upgrade from"; i.e., something like EntityPrototype::upgrade_from_alternative. It would likely need to be limited to entities meeting both the criteria for EntityPrototype::deconstruction_alternative EntityPrototype::next_upgrade. Similar to how "deconstruction_alternative" encompasses multiple entity prototypes.
For handling the UI clutter, I think some version of EntityPrototype::hidden_in_upgrade_planner would be enough. Just a way for these entities not to clutter the interface.