Page 1 of 1

Exclude a module category from default

Posted: Sat May 03, 2025 2:19 am
by KiwiHawk
It feels like allowed_module_categories works backwards to how it ideally should. I'm creating a new module category that I only want used on particular machines. To make this work, I need to set allowed_module_categories on every other machine! As by default, machines can accept every category.

Could a new property be added to ModuleCategory? Something like include_in_default that defaults to true.

The current design makes mod compatibility very difficult when you have multiple mods enabled that add new recipe categories.

Example:
In Angel's, we have Bio Yield Modules. A special type of module that should only be allowed in farms.
Currently in data-updates I have to make a list of all module categories that exist, excluding my new category. Then loop through every beacon, crafting machine, lab, and mining drill and set allowed_module_categories if hasn't already been set.

With my proposed solution, I would no longer need to modify entities other than Angel's farms. I just need to set include_in_default = false on my new module category.

Re: Exclude a module category from default

Posted: Sat May 03, 2025 9:39 am
by curiosity
That's how every such property behaves. Masks, categories, whatever else. Some avoid this problem by being mandatory, others have a utility constant default_X_by_type or just a fixed default value. I think it's better if this problem is solved in one of these ways instead of introducing a completely new behavior, for consistency's sake and to avoid feature creep.