Designate allowed building area

Place to get help with not working mods / modding interface.
adam_bise
Filter Inserter
Filter Inserter
Posts: 581
Joined: Fri Jun 08, 2018 10:42 pm
Contact:

Designate allowed building area

Post by adam_bise »

I would like to designate an area like coordinate x,y to coordinate a,b and then disallow building certain entities in that area. Is this possible?

Also, it is possible to allow building an assembler, but disallow setting certain recipes within the designated area?

The mod is for a scenario, if that helps.

Does anyone know how to do this?

Thanks!
eugenekay
Filter Inserter
Filter Inserter
Posts: 455
Joined: Tue May 15, 2018 2:14 am
Contact:

Re: Designate allowed building area

Post by eugenekay »

You can try setting-up a different LuaForce and Surface to achieve separate Tech trees & play areas. This would be great for a “Rocket Race” amongst multiple teams.

I don’t think there is an explicit way to dis/allow a given Force from building Entities on the same Surface, if they are able to reach it & have the materials available. But you can have separate Spawn Points per Force. If the Terrain can separate players for long enough (water works good; make sure to disable Landfill technology in your Scenario!) you can make a Team Combat map.

Good Luck! I always like seeing new Scenario mods; there aren’t very many compared to the amount of Recipe Tweaks etc.
adam_bise
Filter Inserter
Filter Inserter
Posts: 581
Joined: Fri Jun 08, 2018 10:42 pm
Contact:

Re: Designate allowed building area

Post by adam_bise »

OK I was afraid of this. So the next best thing would be to script the deletion of disallowed entities from a given area. To do this without pissing off the player would require the areas to be visible somehow.

Is this possible?
Natha
Filter Inserter
Filter Inserter
Posts: 259
Joined: Sun Mar 15, 2015 1:48 pm
Contact:

Re: Designate allowed building area

Post by Natha »

You can draw a color tint on this certain area using rendering
eugenekay
Filter Inserter
Filter Inserter
Posts: 455
Joined: Tue May 15, 2018 2:14 am
Contact:

Re: Designate allowed building area

Post by eugenekay »

adam_bise wrote: Sat Mar 15, 2025 5:35 pm OK I was afraid of this. So the next best thing would be to script the deletion of disallowed entities from a given area. To do this without pissing off the player would require the areas to be visible somehow.

Is this possible?
Sure is! To dis/allow entities you will need to use the Events API to listen for the various Entity changes, most importantly is probably on_entity_built; which even allows a Filter.

Depending upon the flavor of your scenario you can use Hazard Colored Concrete, Water, or Cliffs to draw a bounding box around the “Area” you have defined. A custom map generator or starting with a Lab/Grass terrain is probably easiest.
adam_bise
Filter Inserter
Filter Inserter
Posts: 581
Joined: Fri Jun 08, 2018 10:42 pm
Contact:

Re: Designate allowed building area

Post by adam_bise »

That'll work. Thanks for the info!
Post Reply

Return to “Modding help”