disable building certain buildings?

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
Post Reply
lawnknome
Manual Inserter
Manual Inserter
Posts: 1
Joined: Sat Sep 18, 2021 11:16 pm
Contact:

disable building certain buildings?

Post by lawnknome »

hello i have a question and i dont know if its possible but i would like to find out. i want to disable the ability to build a certain building, is there a way to make some buildings restricted? if so how do i do it? thank you

User avatar
Silari
Filter Inserter
Filter Inserter
Posts: 490
Joined: Sat Jan 27, 2018 10:04 pm
Contact:

Re: disable building certain buildings?

Post by Silari »

You can't do it with permissions AFAIK but you could do it via a mod (by disabling the recipe to make the building and removing it from any technology) or a scenario (by disabling the recipe any time a force completes a research).

Slightly more complicated if it's a building that's still needed otherwise (to make something else). It's also possible for a mod/scenario to catch the build event for the building you don't want and then destroy the building. Sometimes doesn't get everything though if playing with instant build mods or such.

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: disable building certain buildings?

Post by eradicator »

Silari wrote:
Sun Sep 19, 2021 12:58 am
Slightly more complicated if it's a building that's still needed otherwise (to make something else). It's also possible for a mod/scenario to catch the build event for the building you don't want and then destroy the building.
It would be far easier to remove the items_to_place_this relationship between item and entity. I.e. by setting the item prototype place_result to nil. This wouldn't effect recipes, items or existing buildings. It would only prevent building new ones. Drawback is that it's not controllable per-player.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

Post Reply

Return to “Gameplay Help”