entity_limitation and entity_limitation_blacklist for module prototypes

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Post Reply
braxbro
Burner Inserter
Burner Inserter
Posts: 12
Joined: Sun Jan 01, 2023 2:54 am
Contact:

entity_limitation and entity_limitation_blacklist for module prototypes

Post by braxbro »

Having the ability to forbid specific modules from being used in certain entities and for specific recipes would be an immensely powerful feature for more intuitively and granularly controlling module use for various use cases, such as progression gating (tier X machine caps out at Y module) or theming. (drill accepts drill tip-themed modules)

Currently those 'restricted' modules would be accessible without manually restricting them via Lua code (which wouldn't show proper module restrictions when the module slots are hovered over) or using hacky tricks like crafting category restrictions and duplicate recipes for different tiers of machines. (which would show proper module restrictions, but is less than ideal and would lead to notable bloating of the recipe list, affecting popular mods like Helmod or Factory Planner)

A simple list of allowed/denied entities for each module would significantly streamline this and make these use cases easier for both players and modders alike.

Rseding91
Factorio Staff
Factorio Staff
Posts: 13240
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: entity_limitation and entity_limitation_blacklist for module prototypes

Post by Rseding91 »

One issue with this is how to convey to the player what the limits are in a given module. The distinction of what recipes accept what module effects is already confusing.

Additionally; how would these effects work when it comes to beacons? Beacons do not track where the beacon effect came from. They simply sum all effects in the module inventory and apply them to the machines found.
If you want to get ahold of me I'm almost always on Discord.

curiosity
Filter Inserter
Filter Inserter
Posts: 343
Joined: Wed Sep 11, 2019 4:13 pm
Contact:

Re: entity_limitation and entity_limitation_blacklist for module prototypes

Post by curiosity »

Duplicate of viewtopic.php?f=28&t=72130 (in spirit).
Rseding91 wrote:
Thu May 25, 2023 9:21 am
One issue with this is how to convey to the player what the limits are in a given module. The distinction of what recipes accept what module effects is already confusing.
Leave it to the mod author. That's what base game does already with productivity modules, structuring the recipe groups just so and telling in text which group is eligible. For once, the attitude "not used in base game, don't care" is actually justified.
The player will also see in the module slot tooltip which modules are applicable.
Rseding91 wrote:
Thu May 25, 2023 9:21 am
Additionally; how would these effects work when it comes to beacons? Beacons do not track where the beacon effect came from. They simply sum all effects in the module inventory and apply them to the machines found.
This is wrong. Allow productivity effect in beacons and you will see that the recipe limitation is preserved.

Rseding91
Factorio Staff
Factorio Staff
Posts: 13240
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: entity_limitation and entity_limitation_blacklist for module prototypes

Post by Rseding91 »

I didn’t explain well; beacons collect the total effect of the modules in their inventory and store that. Every time something is built in range of the beacon the combined effect is applied to the machine and the machine decides if it will exclude a given effect. When that apply happens the logic has no idea what effect came from what module if any.
If you want to get ahold of me I'm almost always on Discord.

curiosity
Filter Inserter
Filter Inserter
Posts: 343
Joined: Wed Sep 11, 2019 4:13 pm
Contact:

Re: entity_limitation and entity_limitation_blacklist for module prototypes

Post by curiosity »

Then why limitations work from inside beacons?

Rseding91
Factorio Staff
Factorio Staff
Posts: 13240
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: entity_limitation and entity_limitation_blacklist for module prototypes

Post by Rseding91 »

I went to look over the code again and it seems I was simply wrong. It does go over the beacon(s) inventories each time.
If you want to get ahold of me I'm almost always on Discord.

Nidan
Fast Inserter
Fast Inserter
Posts: 238
Joined: Sat Nov 21, 2015 1:40 am
Contact:

Re: entity_limitation and entity_limitation_blacklist for module prototypes

Post by Nidan »

Rseding91 wrote:
Thu May 25, 2023 9:21 am
One issue with this is how to convey to the player what the limits are in a given module. The distinction of what recipes accept what module effects is already confusing.
Hovering a machine's module slots gives a tooltip listing the accepted modules, including restrictions from the current recipe, so there's one place giving a definite answer. You could add the same tooltip into the recipe/machine tooltip to show what's generally accepted for/in that particular recipe/machine, but I fear that would clutter those tooltips too much.

braxbro
Burner Inserter
Burner Inserter
Posts: 12
Joined: Sun Jan 01, 2023 2:54 am
Contact:

Re: entity_limitation and entity_limitation_blacklist for module prototypes

Post by braxbro »

Nidan wrote:
Fri May 26, 2023 11:08 am
Rseding91 wrote:
Thu May 25, 2023 9:21 am
One issue with this is how to convey to the player what the limits are in a given module. The distinction of what recipes accept what module effects is already confusing.
Hovering a machine's module slots gives a tooltip listing the accepted modules, including restrictions from the current recipe, so there's one place giving a definite answer. You could add the same tooltip into the recipe/machine tooltip to show what's generally accepted for/in that particular recipe/machine, but I fear that would clutter those tooltips too much.
I’d say just leave it to the mod to make tooltips outside of the machine's module slots for it, or possibly make it part of the module tooltip, below the module stats?

User avatar
KiwiHawk
Filter Inserter
Filter Inserter
Posts: 262
Joined: Thu Jul 05, 2018 9:48 am
Contact:

Re: entity_limitation and entity_limitation_blacklist for module prototypes

Post by KiwiHawk »

+1 for this! Would love to have it for Angel's mods. It would remove the need for some of the control stage scripting we currently have.

It would make it more clear where our special modules can be used. Currently they show up in the module slot tooltip on miners and labs. It's only when you try insert it that we intercept and disallow it. There's also no way for planner mods (Helmod etc) to know what control stage scripts are preventing.
Dev for Bob's mods, Angel's mods, Helmod, Sea Block, Circuit Processing, Science Cost Tweaker.

Buy me a coffee

Post Reply

Return to “Modding interface requests”