Page 1 of 1

How to change maps with layouts.

Posted: Sun Oct 18, 2020 5:54 pm UTC
by Gireen
A layout defines the placement of buildings at the start of a map and there can be multiple different layouts for a single map witch can also be created by players ingame with the necessary admin rights.

With this method they can also be used to not only change building placement but also change parts of the map, like walls, unlock doors or display other elements depending on the layout. A practical use case would be to have a big map divided with walls to create smaller versions depending on the player count.

So to do this you need something that you want to enable. Like a wall. So create a brush and add

Code: Select all

"classname" "func_spawn"
"targetname" "wallThatIsSometimesThere"

func_spawn is a Toggleable wall/brush
targetname is the name with that you can toggle the wall

Now we need a room that is only accessible via noclip.
inside there you place a cube and add this values to it

Code: Select all

"classname": "sensor_buildable",
"target": "wallThatIsSometimesThere"
"wait": 100000,

I think you can see where this is going. When a building is placed in the area of the cube our wall will spawn into existence. For this Drills or Leches can be used.

To remove the drill after its done you can create a cube that fills the "control room" and add

Code: Select all

"classname" "func_spawn"
"targetname" "cleanup"

And finally we need 3 entitys

Code: Select all


Code: Select all


Code: Select all


This will destroy the drill after mapstart and makes it possible to place new ones if a new layout is created.

For convenience the control room can have markings on the floor to know where a drill must be placed to have witch effect.
Normal buttons can also be added to trigger walls manually.

Things to keep in mind:
On this objects cant be build or wallwalked.
Bots can have problems depending on the objects like doors that don't open or destructible elements.
func_spawn will work for bots (when this was added) but only if the walls do not SPAWN_ENABLED

Re: How to change maps with layouts.

Posted: Mon Oct 19, 2020 4:47 am UTC
by killing time
Neat. So one could consider closing off some areas via layouts to adjust maps for a smaller number of players. IIRC the map rotation config allows logic based on the number of players, which would work well together.

Also we can create the master map with control zones for all possible structural elements, rendering all other maps obsolete :advmarauder: