Hammer Basics: Part 3 - Spawn Room and Displacement

Hello again, and welcome back to my Hammer Basics tutorials. Hopefully, since you're here, I haven't bored you out of your skull and you're, at least partially, enjoying yourself.

Today we're going to learn how to make a proper spawn room for TF2, how to use skyboxes, and displacement.
First, spawn rooms; if you're not mapping for TF2, ignore this section and go down to skyboxes.

I'm sure you know how spawn rooms are suppose to work, even if you don't know exactly what they do. Because of this, you know when someone hasn't made a spawn room correctly, and it's incredibly annoying.
Spawn rooms are made up of a few elements. The most important one is the brush-based entity func_respawnroom. Brush-based entities are things like triggers, or func_doors. Point based entities are the filter_activator_tfteam we used last time. The difference is that point-based entities are made with the entity tool (Shift-E) and brush-based entities are made from brushes using CTRL-T, or toEntity.
As I was saying, the func_respawnroom is the most important. It allows you to switch classes without dying, along with preventing engineers from building buildings in it.

So, let's make one. I'm assuming you've been following the tutorials up to this point, so you already have our basic room with a door.

Select the trigger texture (texture browser, 'trigger') and draw a trigger like so.

Make sure that you're covering all the areas that you want people to be able to switch classes in. If there's somewhere that you want engineers to be able to build in, make sure that it isn't there.
Now, convert it to an entity (CTRL-T) and change the name to func_respawnroom. Set the Team variable. Obviously, if you're not on the specific team it won't let you change classes.
Hit Apply, then cancel. There you go, you can now change classes in the room without dying.
Next is the resupply cabinets. Place a point-based entity (Shift-E) that is a prop_dynamic. Prop_anythings are how you place models in a map. There are prop_statics, they are static, obviously. Prop_dynamics have animations that they can play. Prop_physics have physics applied. These are tricky, I wouldn't recommend using them most of the time.
For now, place your prop_dynamic against a wall and open the properties.

Set the name to something, I'm using resupply_red_01. Now, find the World Model variable. Click Browse, you'll now see the model browser.

You'll have to wait a few seconds while it loads all the models, you'll see the numbers beside 'MDL File' stop moving when it's done. Then you can type a query into the text box above the 'Cancel' and 'OK' buttons. For now, we're going to use 'resupply'. Choose props_gameplay\resupply_locker.mdl.
Click Apply and you'll see your model appear in the view, although mine's backwards.

Rotating stuff is really easy, just click cancel and select your model. The hit CTRL-M, this is the transformation menu. You can move, scale, and rotate things by specific numbers here. I use it all the time, it's an awesome tool.

For now, type in 180 to the Z text box and hit enter. If your model was backwards, it'll now be facing the correct way.

Next, draw another brush like this.

Also, you can change the grid size with [ and ]. I never recommend turning off 'Snap to Grid.' It makes keeping everything aligned so much easier, and it helps prevent leaks.
Anyway, change this brush to an entity, func_regenerate.
Most of the variables are obvious, except for Associated Model. You want to enter the name of our resupply cabinet, in my case, resupply_red_01.
Hit Apply, and now you've got a resupply cabinet that will work exactly how they work normally. Which is to say it restores your health and ammo, and it will play the cabinet animation.

So, that's how to make a proper spawn room. Now for using a skybox.
A skybox is simply a 2D texture that's applied around the map to make it look like there is a sky. This is a 2D skybox, there are such things as 3D skyboxes, but I'm not going to get into that right now. Maybe later.

It's very simple to make a 2D skybox, but first we need to make somewhere for it. I'm going to move my roof back from the second room, like so.

Now, open the texture browser and type 'tools'. Find this one.

This is the 2D skybox texture. Now draw a new roof for the second room with this texture.

Now this room looks like it opens to the sky. The brush is solid, though, so you can't jump up past it.
That was pretty simple, now wasn't it? Hopefully, because next we're gonna do displacement editing, which is less simple.

Displacement editing is how you make realistic looking ground and stuff, it lets you edit specific vertices in a brush. Let's just do it, you'll understand when you do.

First, I'm going to make another room off of the second room so we have room to work. When you make the ground, select a grass texture. You don't have to, but it looks better.

Now you get to learn about a really useful tool. It's the Texture Application tool.

Click that and this will pop up, or something close to it.

If you have a brush selected, you'll also notice that your selected texture is now whatever you used on that brush. That's one of the things this tool does. It also lets you set specific sides of brushes to specific textures. It also lets you go displacement editing.
Click on the Displacement tab.

Now select the ground that you want to edit with the selection tool (Shift-S.) The texture application tool will close when you switch to the selection tool, that's fine. Just select the ground and reopen it.
Go back to the Displacement tab and click the 'Create' button. You'll see a new dialog that asks for a power. This is just how many vertices are going to be created, you can mess with this value if you want. I'm gonna leave it at 3.
Now you'll see this.

That means that the terrain is ready for editing. On the Displacement editor, click 'Paint Geometry'. You'll see this pop up.

Most of it is pretty self-explanatory. Now that it's open, try clicking around on your ground. Left click raises the terrain, right lowers it.

That is the power of the displacement tool. Feel free to mess around with the settings and the ground until you like how it looks.
A word of warning. Sometimes using displacement screws up the brush, so if you make some ground, close Hammer and reopen it, don't be surprised if it's been corrupted somehow. It doesn't happen often, but it does happen. Hammer is the biggest douche ever. Use it long enough and you'll know what I mean. Until then, don't worry about it.

That's it for this tutorial, I hope you enjoyed it. As usual, if you've got any questions, just post a comment and I'll do my best to answer them.



Video tutorial. This is the lat video that I made, so from here on out I'm going to be making up the tutorials.


Post a Comment