How to change maps with layouts.

Ask questions about mapping in general, and show off your in-progress work.
Post Reply
User avatar
Gireen
Graphic Designer
Posts: 295
Joined: Wed Mar 07, 2012 1:26 pm UTC
Clan: [DoH]
Location: Germany
Contact:

How to change maps with layouts.

Post 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

"classname":"sensor_start",
"target":"delayCleanup"

Code: Select all

"classname":"ctrl_relay",
"targetname":"delayCleanup",
"onAct":"cleanup","wait":1

Code: Select all

"classname":"ctrl_relay",
"targetname":"delayCleanup",
"onAct":"cleanup","wait":2

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

fear ma engrish :granger:

User avatar
killing time
Programmer
Posts: 162
Joined: Wed Jul 04, 2012 7:55 am UTC

Re: How to change maps with layouts.

Post 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:

Post Reply