A beginners guide to CS 1.6 mapping

Part 2: Details

If you have read the first part of this series of two mapping tutorials (you can find it here), you should now know how to make a room with a player spawn and a light in it. Of course, you cannot really call this a “map”. What I’m going to teach you in this tutorial, is how you can add important details to your map. This tutorial includes: making textures fit properly, adding (transparent) water, (transparent) glass, ladders, doors and sky (with light_environment).


Adding (a) sliding or rotating door(s) to your map

Also I explain a lot in this part about fitting textures, and I give some useful tips about ‘Ignore Groups’ and ‘Texture Lock’!


A sliding door
I have already explained how to make a room in the first part of this tutorial, so I’m not going to do that again. To teach you how to create a door, let’s first make two rooms with an opening in between it. Keep in mind that the opening for the door should not be too big, neither too small. A good size for a door (opening) is 3x16 (3 blocks of 16 units) width, and 6x16 (6 blocks of 16 units) height. Mine looks like this (upper left part of the screenshot):




Now the only thing left to do is putting a door in it. We have two options here: We can create a rotating door, or a sliding door.

First I’ll show you how to create a sliding door. Create a brush (block) in the door opening. A good door in this case would be something like 0,5x16 thick (so that’s 8 units), or even 4 units. Depends on what kind of door you want. If you want to create for example a metal door, you want it to be thick, so then choose 8 units. For a wooden door, choose 4 units, that’s more realistic. You can also add a texture to your door. I showed you in the first part of this tutorial how to add textures to objects.

Hint: To make a door 4 units thick, press the “[“ key until your “Snap: On Grid” is 4 units. Now every square in your grid represents 4 units.
Hint 2: To find a proper texture, type “door” in the search field after you press the ‘Browse’ button in your textures window.


Mine looks like this (upper right part of the screenshot):




So you’re wondering how I made the texture fit like this. First, select your door. Then, toggle texturing on by clicking on the ‘Texture Tool’ (colored cube in the bar on the left of your screen). Then, if your door doesn’t already have a texture on it, find a proper texture for your door. To do this, click ‘Browse’, and type “door” in the search bar in the bottom of the window. I chose the texture called “LAB1_DOOR7”. Double click it and then click ‘Apply’ in the texture window.

Your texture does not fit very well right now. To make it fit, left click on the surface of the door that you want to fit your texture on. The front and the back of the door should look exactly the same, so I selected them both by first left clicking on the front of the door, and then holding down the [ctrl] key and left clicking the back side of the door. Now click the ‘Fit’ button in your texture window. Notice that your texture now perfectly fits the front and back side of your door.
Though, there is one more side if your door that you will see: one of the sides, when the door slides open. To make the texture on this part of the door fit, first select the part of the door that you have already fitted a texture on (either the front or the back), by left clicking it. Then, move your camera inside the wall, and right click on the side of your door. Notice that the surface you have just clicked on (the side of the door) has gotten the exact same texture properties as the selected surface (the front or the back side of the door). Still, it does not look very good.
Select the side of the door, and press the ‘C’ button in your texture window. This centers (c=center) your texture. Now it looks ok. Do the same thing to the other side of your door.

Hint: Experiment a bit with fitting textures, it will help you in the future!
Hint 2: Don’t scale your X and Y values too low or too high, for it can cause lag and fps drops when you do! Best is not to go below 0,2 and not over 5.


Your door should now look like this (bottom left part of the screenshot):




The only thing that’s left to do is transform this brush into a door entity. Toggle texturing off. Then, in either your top right, bottom left or bottom right window (the ones with the grid), select your door, right click it and click ‘Tie to Entity’.

Hint: You can also select your door in the camera window, and then right click it in one of the other windows.

If you have followed the first part of my tutorial, a window should now pop up. It should say: “Class:” “func_wall”. We do not want this entity to be a wall though, so in the drop down menu that appears when you click the arrow right of “func_wall”, click “func_door”. We are now going to set some attributes of the door.

In the “attributes” list, click “Speed”. This is the movement speed of the door when it opens. 100 is this attribute’s standard value. That’s pretty fast, so let’s change it to 50.
The next attribute is “Move Sound”. Click it, and select one of the sounds in the drop down menu to the right (doesn’t matter which, experiment a bit with this). I’ve selected the “Power Hydraulic” sound.
The next attribute is “Stop Sound”. Like before, select a sound in the drop down menu to the right. I selected “Chunk”.
“Delay before close” is the time it takes before your door closes after it has been opened, in seconds. 3 is a good value.
Next is “Damage inflicted when blocked”. If you want players to get damage when they block your door, fill in a value here (for example value 50 means you lose 50 hp when you block the door). I suggest you don’t, though, as it can sometimes ruin the gameplay of your map.

The last thing to set here is the “Angle”. You can find this value in the most upper right field, with a clock-like image next to it. The white line indicates in which way your door will open. Value 0 (in degrees) gives a white line pointing east. This means that your door will open to the east (look at the top view, for me that’s the top right window). You can fill in values from 0 to 360 degrees. Our wall, or at least mine, goes from east to west (horizontal on the top view). This means my door can either open to the east or west. I don’t really mind to which side it opens, so I choose west. To make my door open to the west, I have to change my angle to 180. Notice that the white line changes direction when you fill in a different angle.

Hint: For an Angle & Pitch example view this screenshot (bottom right part of the screenshot).

View this screenshot (bottom right part of the screenshot):




We’re done. Close the window. If you’d like to test it, add a light and a player spawn to your map, and run it.


A rotating door
To create a rotating door, we will need pretty much the same stuff as for a sliding door, so we’re just going to take the sliding door, and transform it into a rotating door. How? Create a brush in the side of the door (it may sound hard, but if you don’t understand, just watch the screenshot below). This brush could be any size, as long as it’s not bigger than the door. Besides that, from the top view it has to be a perfect square. Keep in mind that this is going to be the rotation point of the door. I always make a brush that is the same height as the door, but a bit smaller, and a perfect square from the top view. When you’re done, give this brush the “origin” texture (search for textures named “origin”). Mine looks like this (upper left and right part of the screenshot):




Now, select both the door and the “origin-brush” (the brush you’ve just created). Right click your selection on either your top right, bottom left, or bottom right window, and select ‘Tie to Entity’. In the window that pops up, press ‘No’ to create a new entity. Transform this entity into a “func_door_rotating” by either typing this in the “Class:” field, or pressing the arrow next to the “Class:” field and selecting “func_door_rotating”.

Hint: It may be hard to select both the door and the origin-brush, as they (at least mine are) are the same size and are on the same place in your map. You can either try to click them from your camera-view window (if you can’t select them after 10 clicks or something, try a different camera angle), or to click them in one of the other windows.

Now, we will have to fill in some attribute values. These will be pretty much the same as in our former func_door.

“Speed”. This is again the movement speed of the door when it opens. Let’s change it to 50.
The next attribute is again “Move Sound”. Click it, and select one of the sounds in the drop down menu to the right (doesn’t matter which, experiment a bit with this). I’ve selected the “Squeaky 1” sound.
“Stop Sound”. Like before, select a sound in the drop down menu to the right. I have selected “None”, because I want this door to be a squeaky wooden door, and I haven’t found a nice stop sound for it (yet).
“Delay before close” is the time it takes before your door closes after it has been opened, in seconds. Let’s keep this 3.
“Damage inflicted when blocked”. If you want players to get damage when they block your door, fill in a value here (for example value 50 means you lose 50 hp when you block the door). I suggest you don’t, though, as it can sometimes ruin the gameplay of your map.
We don’t have to fill in the “Angle” attribute here, as the origin-brush already defines to which side the door will open.

If you’d like, you can give you door another texture, as a rotating metal door is perhaps not so realistic. I gave mine the "FIFTIES_DR1K" texture (search for textures called "fifties"). But how did I do that? If you try to select only your door now, you’re selecting both your door and your origin-brush! And the origin-brush needs to have to origin texture, or the door won’t rotate properly.

There’s a trick for this. In the top of your screen, click the ‘ig’ button. This means ‘Ignore Group’, and when you toggle this on, you can select only single brushes with one single mouse click. Note: If you want to change the properties of an entity, you will have to toggle this off, though, as with ‘ig’ on, Hammer will ignore entities!

View this screenshot (bottom left part of the screenshot):




Hmm, my texture does fit properly, but you can see that the doorknob is on the wrong side of the door! The door will now rotate at the side of the doorknob. We’re going to have to change this. To do this, toggle on both ‘ig’ (Ignore Group, in the top of your screen) and ‘tl’ (Texture Lock, also in the top of your screen). I just explained what Ignore Group does. By toggling Texture Lock on, you can now drag your brushes anywhere, without having your textures moved.


Now, select your door (without the origin brush). In your top view (probably the top right window), click your door once more. Notice that before you clicked it, there were little white squares around your selection, that you could use to scale your door. Now, however, they have transformed into little white circles! (Note: Click it another two times to get back to the little white squares). With this toggled on, you are able to rotate your door! To make it rotate a perfect 180 degrees, hold down the [shift] key, then left click one of the circles, hold both the [shift] key and your left mouse button, and rotate your door 180 degrees. When you’re done, first release your mouse button, and then your [shift] key. If you did everything ok, it should now look like this (bottom right part of the screenshot):




That’s all! Create a player spawn and a light and run your map if you want to test it.


Adding (transparent) glass to your map
From here, I’m going to presume that you have read the first part of this tutorial, as well as the first part of the collection of these tutorials. First, make a room with a wall with a hole to put a window in. Mine looks like this (upper left part of the screenshot, I’m continuing on the map I created in the first part of this tutorial, so that’s why you also see a door in it):




Create a brush in this hole. A realistic window is 2-4 units thick. Mine’s 2 units thick. To find a proper texture, search for a texture named “glass”.

My window now looks like this (upper right part of the screenshot):




Now, select the window and Tie it to Entity (right click and click ‘Tie to Entity’). Make this entity a “func_breakable”.

We’re now going to set the attributes of the breakable.
The first is “strength”. This is the strength of the window in hp’s. The standard value is 1 hp. Let’s leave it like this, because windows are meant to break fast .
“Material Type”. Set this to “glass”, as your window is made of glass.
“Gibs Direction”. You can either set this to “Random”, or “Relative to attack”. I choose “Random” for my window.
“Render Mode”. Set this to texture, as only the texture of your window should be transparent. Use “texture” for water and glass, or other brushes that should be completely transparent.
“FX Amount”. The standard value is here is 255 – completely visible. 1 would be “almost completely transparent”. Let’s set it to 100, to make a common transparent window.

View this screenshot (bottom left part of it):




Close the window. We’re now done! Add a player spawn and a light to your map and run it if you want to test it.


Adding (transparent) water to your map
I’m continuing to work with the map in which I created the door and the window. To this map, add a small “pool”. Mine looks like this (upper left part of the screenshot):




Inside this "pool", create a brush that exactly fits in, but does not touch the top of the walls of your “pool”. Add a water texture to this brush (search for textures named “water”). Mine looks like this (upper right part of the screenshot):




Now, select the brush with the water texture, and tie it to entity. Transform it into a “func_water”.

The attributes list:
“Render Mode”. Set this to “texture”, as we want the whole brush to be transparent.
“Render FX”. Set this to somewhere between 100-200, depending on how transparent you want the water to be (100 is very transparent, 200 is just a bit transparent).
“Wave Height”. You can set this to something between 0 and 5, where 0 is no waves at all and 5 is big waves. We’re not in the middle of the sea though, so I’m setting it to 0.

View this screenshot (the bottom left part of it):




Well, that was it! And yes, it’s that easy! Create a spawn and light and run your map if you want to test it.


Adding a ladder to your map
I will again continue working with the map that I’ve made in the first part of this tutorial. Create a brush to one of the sides of the pool, and keep in mind that this is going to be a ladder. Ladders are usually between 2 and 4 units thick, and 2x16 wide. Add a ladder texture to the brush (by searching for textures named “ladder”). Mine looks like this (upper left part of the screenshot):

Hint: If you use the ‘Fit’ button on surfaces that are really long but not very wide, it will look ugly. So if for example have a long but small ladder, you can use the ‘Fit’ button to determine the perfect ‘X-scale’ for your texture, and then set the ‘Y-scale’ back to one so that it looks good and won’t cause any lags or errors. But, as I said before, you’ll have to experiment with fitting textures yourself to figure out how it really works.




Now, tie it to entity and transform it into a “func_wall” (if it’s not already a func_wall). We’re creating a func_wall here, because the ladder-entity is a different entity, that we will place on top of the func_wall entity. This is because the ladder-entity is invisible, and we don’t want an invisible ladder.

The attributes that we have to set:
“Render Mode”. Set this to solid. Notice that the ladder texture (of which the name stars with a “{“, meaning parts of it are invisible if this attribute is set properly!) has some blue parts. If you set Render Mode to solid, these parts will become invisible in-game.
“FX Amount”. Keep this 255.

Now, select your ladder brush. Hold down the [shift] key and drag the brush to another place to copy it there (note: it will be copied with all existing attributes, so it will be a func_wall entity!). Then place it against the ladder, and give it the texture called “aatrigger” (search for textures called “aatrigger”), the Half-Life texture for invisible entities like ladders. Finally, scale your entity down so that it becomes 1 unit thick.

It should now look like this (bottom left part of the screenshot):





Select the new brush, and tie it to Entity. In the window that should pop up, press ‘No’. Transform this entity into a func_ladder, and then close the window, as this entity does not have any attributes that need to be set.

View this screenshot (bottom right part of the screenshot):





You’re now done! Add a light and a spawn point and run the map if you want to test it.


Adding sky and a light_environment to your map
This is probably the easiest part of this tutorial. Select the roof of your room, and give it the texture called “sky” (search for textures called “sky”).

Hint: As this is the final part of this tutorial, you could also add a floor texture to your floor. To do this, search for textures called “floor” or “flr”, or select one you like in the complete list.
Hint 2: Keep in mind that your sky is solid. That means that you cannot jump, walk or fall through it.


It should now look like this (upper left part of the screenshot):





To set the texture of the sky, press ‘Map’ in the menu in the top of your screen, and then click ‘Map Properties’. Look for the attribute called “environment map (cl_skyname)”. In this field, fill in one of the following names to change the appearance of your sky (leave it blank for the standard value: 2desert).

2desert, Alien1, Alien2, Alien3, Black, City, Cliff, Desert, Dusk, Morning, Neb1, Neb2b, Neb6, Neb7, Night, Space, Xen10, Xen8, Xen91

Finally, you can add sunlight to your map. This is light that comes out of the sky, and reaches every place, not blocked by walls (so if there is a brush between the brush with the “sky” texture and the ground, it will not reach the ground, and there will be a shadow), in your map. To do this, click the ‘Entity tool’ (the gray peon) in the bar on the left side of your screen, and in the dropdown menu that has now appeared on the right side of your screen, select “light_environment”. Place it anywhere in your map, inside your walls and sky!

Let’s set the attributes for this light_environment entity.
“Brightness”. In the first part of this series of two tutorials I explained what this was. I’m setting it to 100.
“Pitch”. This determines in what angle the light comes down from the sky. -90 degrees is completely vertical. Set this to any value between -1 and -90 (most common is anywhere between -40 and -90). I’m setting mine to -70.
“Angle”. You can find this attribute in the upper right corner of the window. This determines what angle the light comes from. Imagine a big clock over the top view of your map. Setting the value to 0 would make the light come from the west (the white stripe is now pointing to the east, or to the 3 on the imaginary clock. 90 would be light coming from the south, as the white stripe is pointing to the north, or the 12 on the imaginary clock). I’m setting mine to 270 (the standard value, light coming from the north).

Hint: For an Angle & Pitch example view this screenshot (bottom right part of the screenshot).

Close the window. It should now look like this (upper right part of the screenshot):




That’s all! You’re done! Add a spawn point to your map and run it if you want to test it.

I hope you have learned from this tutorial. If you liked it or have any questions or suggestions, please leave a comment. Good luck with your future maps!

- Minitauros