Cleanup is going to take awhile, so the site is back up but editing has been disabled.
Spawn swapping (css)
From HalfLife 2 Knowledge Base
by lgCHICKEN The terrorists and counter-terrorists will swap spawn point with each other every round. (much like the old, l33tsk33t map for 1.6)
This is done by spawning them in a hidden part of the map and then choosing which spawn to send them to.
Contents |
The ingredients
The boxes that the players spawn in need these things:
- a func_brush (used to stop players falling into the wrong teleport)
- 2 trigger_teleports (one to each possible spawn)
- a logic_auto (to switch teleports on and off)
The hidden boxes
Make two hollow boxes, textured with nodraw. The inner dimensions should be the size of the player, but with more room underneith. a good numbers to use are: 96x96x128 Put 2 player spawns in these boxes; one ct and one t. have their heads at the top, and the gap below them.
The brushes
Make two func_brushes, one under the t and one under the ct name them:
- spawning_block_t
- spawning_block_ct
Tell 'spawning_block_ct' to start disabled (and not spawning_block_t)
The teleports
you need 4 teleports. they will go inside the boxes, but work on them outside for now. Name them like so:
- spawning_ct1_&i
- spawning_ct2_&i
- spawning_t1_&i
- spawning_t2_&i
(the _&i part is important, it will help make the prefab)
Make both 'spawning_t1_&i' and 'spawning_ct1_&i' start disabled
Give 'spawning_ct2_&i' the output values: OnStartTouch>spawning_block_ct>enable>1 second OnStartTouch>spawning_block_t>disable>1 second
and give 'spawning_t2_&i' the output values: OnStartTouch>spawning_block_t>enable>1 second OnStartTouch>spawning_block_ct>disable>1 second
The destinations
The teleports: 'spawning_t1_&i' and 'spawning_ct1_&i' should teleport to a destination called spawn_1_&i The teleports: 'spawning_t2_&i' and 'spawning_ct2_&i' should teleport to a destination called spawn_2_&i
Logic_auto
OnStartTouch>spawning_t1_&i>enable>1 second OnStartTouch>spawning_ct1_&i>enable>1 second OnStartTouch>spawning_t2_&i>disable>1 second OnStartTouch>spawning_ct2_&i>disable>1 second
Building the box
Now you must put all of these parts together. One box should have: a terrorist spawn. under that: the func_brush named 'spawning_block_t' under that: spawning_t1_&i spawning_t2_&i (these two may overlap each other)
The other box should have: a counter-terrorist spawn. under that: the func_brush named 'spawning_block_ct' under that: spawning_ct1_&i spawning_ct2_&i (these two may overlap each other)
Explination
now, the ct will fall onto the active teleport, number 2, and spawn onto point 2. as they teleport they will trigger the terrorist to fall (by disabling the brush, 1 second later) by then, teleport 2s have been turned and they are teleported by number 1
On the next round, the terrorists are the ones to fall (since the func_brush doesn't reset per round) they therefore trigger the cts to fall one second later, when the other teleport is active.
Using as a prefab
since you put _&i after the names that needed it, you can insert as many of these spawn points as you like, without them interfering with each other.
save this file in: sourcesdk\bin\prefabs\ in a new file, go to make a new brush in hammer, but select 'prefabs' (from where you normally select block, arch ect) you should see this new file listed in the prefabs section (you may have to reload hammer)
click on 'insert orignal prefab' now, all of the _&i s have turned into _1 insert and second one and they will all be _2
you can therefore insert 16 pairs (32 spawns) without having to set the relationships for each pair.
Finishing up
to finish, hide the spawn boxes under the map, out of the way. move all of the teleports named 'spawn_1_?' to the first spawn and all of the teleports named 'spawn_2_?' to the second.
I also coated the inside of my boxes in black, so that the time people spend in them is unnoticeable. I also was able to shrink the sizes and time delay in the boxes, this means that both teams spawn within 0.3 of a second.
two limitations of this system: there must be a minimum of 2 people for it to work there must also be no late comers.
if a late comer missed the start of the round they will not spawn to the correct place I therefore make a trigger_hurt, to kill anyone that was stuck in the spawns (it came of after about 5 seconds)

