Exclude a module category from default

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
User avatar
KiwiHawk
Filter Inserter
Filter Inserter
Posts: 293
Joined: Thu Jul 05, 2018 9:48 am
Contact:

Exclude a module category from default

Post 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.
Dev for Bob's mods, Angel's mods, Sea Block, Circuit Processing, Science Cost Tweaker. Contributor to Helmod.

Buy me a coffee
curiosity
Filter Inserter
Filter Inserter
Posts: 637
Joined: Wed Sep 11, 2019 4:13 pm
Contact:

Re: Exclude a module category from default

Post 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.
Post Reply

Return to “Modding interface requests”