siosios
03-14-2009, 06:37 PM
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 (http://www.fpsbanana.com/tuts/7287)), 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):
http://image.fpsbanana.com/ss/tuts/6172.jpg (http://image.fpsbanana.com/ss/tuts/6172.jpg)
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):
http://image.fpsbanana.com/ss/tuts/6172.jpg (http://image.fpsbanana.com/ss/tuts/6172.jpg)
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):
http://image.fpsbanana.com/ss/tuts/6172.jpg (http://image.fpsbanana.com/ss/tuts/6172.jpg)
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):
http://image.fpsbanana.com/ss/tuts/6172.jpg (http://image.fpsbanana.com/ss/tuts/6172.jpg)
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):
http://image.fpsbanana.com/ss/tuts/6184.jpg (http://image.fpsbanana.com/ss/tuts/6184.jpg)
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):
http://image.fpsbanana.com/ss/tuts/6184.jpg (http://image.fpsbanana.com/ss/tuts/6184.jpg)
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):
http://image.fpsbanana.com/ss/tuts/6184.jpg (http://image.fpsbanana.com/ss/tuts/6184.jpg)
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):
http://image.fpsbanana.com/ss/tuts/6173.jpg (http://image.fpsbanana.com/ss/tuts/6173.jpg)
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):
http://image.fpsbanana.com/ss/tuts/6173.jpg (http://image.fpsbanana.com/ss/tuts/6173.jpg)
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):
http://image.fpsbanana.com/ss/tuts/6173.jpg (http://image.fpsbanana.com/ss/tuts/6173.jpg)
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):
http://image.fpsbanana.com/ss/tuts/6171.jpg (http://image.fpsbanana.com/ss/tuts/6171.jpg)
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):
http://image.fpsbanana.com/ss/tuts/6171.jpg (http://image.fpsbanana.com/ss/tuts/6171.jpg)
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):
http://image.fpsbanana.com/ss/tuts/6171.jpg (http://image.fpsbanana.com/ss/tuts/6171.jpg)
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.
http://image.fpsbanana.com/ss/tuts/6174.jpg (http://image.fpsbanana.com/ss/tuts/6174.jpg)
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):
http://image.fpsbanana.com/ss/tuts/6174.jpg (http://image.fpsbanana.com/ss/tuts/6174.jpg)
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):
http://image.fpsbanana.com/ss/tuts/6174.jpg (http://image.fpsbanana.com/ss/tuts/6174.jpg)
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):
http://image.fpsbanana.com/ss/tuts/6175.jpg (http://image.fpsbanana.com/ss/tuts/6175.jpg)
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):
http://image.fpsbanana.com/ss/tuts/6175.jpg (http://image.fpsbanana.com/ss/tuts/6175.jpg)
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
Part 2: Details
If you have read the first part of this series of two mapping tutorials (you can find it here (http://www.fpsbanana.com/tuts/7287)), 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):
http://image.fpsbanana.com/ss/tuts/6172.jpg (http://image.fpsbanana.com/ss/tuts/6172.jpg)
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):
http://image.fpsbanana.com/ss/tuts/6172.jpg (http://image.fpsbanana.com/ss/tuts/6172.jpg)
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):
http://image.fpsbanana.com/ss/tuts/6172.jpg (http://image.fpsbanana.com/ss/tuts/6172.jpg)
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):
http://image.fpsbanana.com/ss/tuts/6172.jpg (http://image.fpsbanana.com/ss/tuts/6172.jpg)
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):
http://image.fpsbanana.com/ss/tuts/6184.jpg (http://image.fpsbanana.com/ss/tuts/6184.jpg)
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):
http://image.fpsbanana.com/ss/tuts/6184.jpg (http://image.fpsbanana.com/ss/tuts/6184.jpg)
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):
http://image.fpsbanana.com/ss/tuts/6184.jpg (http://image.fpsbanana.com/ss/tuts/6184.jpg)
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):
http://image.fpsbanana.com/ss/tuts/6173.jpg (http://image.fpsbanana.com/ss/tuts/6173.jpg)
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):
http://image.fpsbanana.com/ss/tuts/6173.jpg (http://image.fpsbanana.com/ss/tuts/6173.jpg)
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):
http://image.fpsbanana.com/ss/tuts/6173.jpg (http://image.fpsbanana.com/ss/tuts/6173.jpg)
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):
http://image.fpsbanana.com/ss/tuts/6171.jpg (http://image.fpsbanana.com/ss/tuts/6171.jpg)
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):
http://image.fpsbanana.com/ss/tuts/6171.jpg (http://image.fpsbanana.com/ss/tuts/6171.jpg)
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):
http://image.fpsbanana.com/ss/tuts/6171.jpg (http://image.fpsbanana.com/ss/tuts/6171.jpg)
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.
http://image.fpsbanana.com/ss/tuts/6174.jpg (http://image.fpsbanana.com/ss/tuts/6174.jpg)
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):
http://image.fpsbanana.com/ss/tuts/6174.jpg (http://image.fpsbanana.com/ss/tuts/6174.jpg)
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):
http://image.fpsbanana.com/ss/tuts/6174.jpg (http://image.fpsbanana.com/ss/tuts/6174.jpg)
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):
http://image.fpsbanana.com/ss/tuts/6175.jpg (http://image.fpsbanana.com/ss/tuts/6175.jpg)
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):
http://image.fpsbanana.com/ss/tuts/6175.jpg (http://image.fpsbanana.com/ss/tuts/6175.jpg)
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