Page 1 of 1
Designate allowed building area
Posted: Fri Mar 14, 2025 10:52 pm
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!
Re: Designate allowed building area
Posted: Sat Mar 15, 2025 3:01 am
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.
Re: Designate allowed building area
Posted: Sat Mar 15, 2025 5:35 pm
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?
Re: Designate allowed building area
Posted: Sat Mar 15, 2025 9:20 pm
by Natha
You can draw a color tint on this certain area using rendering
Re: Designate allowed building area
Posted: Sat Mar 15, 2025 10:06 pm
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.
Re: Designate allowed building area
Posted: Sun Mar 16, 2025 5:49 pm
by adam_bise
That'll work. Thanks for the info!