How-to: Making Your First Map

watch_me_diewatch_me_die Join Date: 2002-11-10 Member: 8107Members
<div class="IPBDescription">Tool explanations, box with a light. :]</div> <i><span style='color:#FFFFFF'>(This is originally from natural-selection.co.nz, which is now down, but I thought some people might find it helpful <!--emo&:)--><img src='http://www.unknownworlds.com/forums/html//emoticons/smile.gif' border='0' style='vertical-align:middle' alt='smile.gif' /><!--endemo-->)</span></i>

This guide is designed to show you how to use Hammer to create your first map, it assumes you have already set up Hammer and have it working. The various Hammer tools will be explained and the end result is the simplest map you can make.

<u><span style='font-size:12pt;line-height:100%'><b>Part One: The Views</b></span></u>

Start up Hammer, and create a new map by clicking on <b>File->New</b> or by pushing <b>ctrl-N</b>.

<img src='http://merkury.orcon.net.nz/nsmapping/first/room1small.gif' border='0' alt='user posted image' />

You will have a window with 4 "panes" inside it. The top left one is the 3D view pane, or a perspective view. In this you can see how your map looks at the moment. The other 3 panes are all 2D views. They show you the objects in your map from different angles - namely top, front and right. These are called "orthographic" views.

<img src='http://merkury.orcon.net.nz/nsmapping/first/cubexyz.gif' border='0' alt='user posted image' />

This image shows the three axes of 3D space. The X & Y axes are what you see when you look straight down at an object and describe its position on the horizontal plane. The Z axis describes the object's position in vertical terms. By combining the X, Y and Z axes, any point in space can be recorded.
In Hammer, the Top view shows X & Y axes, the Front view shows Y & Z axes and the Side view shows X & Z axes.

<u><span style='font-size:12pt;line-height:100%'><b>Part Two: The Brush Tool</b></span></u>

Brushes are the solid objects (and also volumetric entities) that make up the world that the game exists in. In order to make a map you will be creating everything out of brushes so this is probably the most important tool in Hammer.
To use it, click on the Brush Tool icon on the left-hand sidebar, or push <b>shift-b</b>.

<img src='http://merkury.orcon.net.nz/nsmapping/first/blocktool.gif' border='0' alt='user posted image' />

Now, to create a brush, click and drag in the Top view pane until you have a block that measures about 512*512 units. You can see how big an object is by looking at the status bar at the bottom of the screen. It is the third box along and will have 2 numbers in it such as 512 x 512. When you release the mouse button it will show the dimensions of the selected object. Once you have made the block, you should have something looking like this:

<img src='http://merkury.orcon.net.nz/nsmapping/first/block.gif' border='0' alt='user posted image' />

In any of the view panes you can now click and drag the resize handles to change the dimensions of the block. In either the front or side view window, adjust the thickness to 16 units. Now, hit <b>enter</b> to create the brush. Voil?, you have created your first brush!

<u><span style='font-size:12pt;line-height:100%'><b>Part Three: The 3D View Pane</b></span></u>

Now, you are going to want to see what your brush looks like. Click on the small menu at the top right of the 3d View Pane that says "camera" and select "3d Textured". Next, click on the Camera Tool button, or push <b>shift-c</b>.

<img src='http://merkury.orcon.net.nz/nsmapping/first/cameratool.gif' border='0' alt='user posted image' />

With the Camera Tool selected, click and hold the mouse in the 3D View Pane and move it around until you can see the block you have created. Release the mouse button and the camera will stay where it is.
To move the camera around, click and hold the mouse in the 3D View Pane and push the W (move forward), A (move left), S (move backward), and D (move right) buttons, just like in Half-Life. Move the camera around for a little while and admire your work. <!--emo&:)--><img src='http://www.unknownworlds.com/forums/html//emoticons/smile.gif' border='0' style='vertical-align:middle' alt='smile.gif' /><!--endemo-->

You can also select your object by using the selection tool in the 3D View Pane. Click on the Selection Tool button or push <b>shift-s</b>.

<img src='http://merkury.orcon.net.nz/nsmapping/first/selectiontool.gif' border='0' alt='user posted image' />

Now click on your brush in the 3D pane, and it will turn red. Now push <b>Delete</b> to delete it. But don't worry, we can bring it back by using the undo function. Click <b>Edit->Undo</b> or push <b>ctrl-z</b>. Clicking anywhere not on the brush will deselect it.

<u><span style='font-size:12pt;line-height:100%'><b>Part Four: Texturing</b></span></u>

You will have noticed that your brush looks like a bit of a mess. We're going to change that now by applying a texture to the brush. Click on the Texture Application Tool, or push <b>shift-a</b>.

<img src='http://merkury.orcon.net.nz/nsmapping/first/texturetool.gif' border='0' alt='user posted image' />

You will notice that your cursor has changed to a paint bucket. You can use this to select faces (sides of a 3D object) in the 3D view. Click on the top side of the brush and it will highlight red. With the face selected, click on the drop-down menu under "Current Texture" on the Texture Tool. Scroll down to a texture named "floor" (they're in alphabetical order). Click on it, then click the <b>Apply</b> button on the Texture Application popup.
In the 3D view window, the texture on the selected face will have changed to "floor". Hit <b>shift-a</b> to close the Texture Tool, and use the Camera Tool to get a closer look.

Now, use the Texture Tool to apply "floor" to all the sides of the brush. You can select all of an object's faces at once by holding down <b>shift</b> while you click on it with the texture tool, and you can select more than one face at once by holding down <b>control</b> while you select the subsequent faces.

<img src='http://merkury.orcon.net.nz/nsmapping/first/texturewindow.gif' border='0' alt='user posted image' />

As for the rest of the Texture Tool Window:<ul><li>Scale, Shift & Rotation: these affect how the texture looks on the face. Scale stretches the texture, shift moves the texture by unit amounts and rotation rotates the texture in degrees. </li><li>Justify: this will automatically change the Scale & Shift values depending on what button you push. <b>L</b> & <b>R</b> align the texture to the Left and Right sides of the face, <b>T</b> & <b>B</b> align it to the Top and Bottom of the face, <b>C</b> Centres the texture on the face, and <b>Fit</b> stretches and moves the texture to match the face. </li><li>Texture group: lets you specify to select textures from only one texture file. </li><li>Current Texture: displays the currently selected texture. </li><li>Hide mask: this hides the highlighting of the selected face, it toggles on or off. </li><li>Apply: applies the texture to the selected face. </li><li>Browse: displays all the textures in a window so you can browse through them. </li><li>Replace: allows you to replace all occurences of one texture in a map with another. </li><li>Mode: allows you to change the texture-application mode. <ul><li>Lift+Select: copies the properties of the face into the Texture Tool and selects the face. </li><li>Lift: copies the properties of the face into the Texture Tool without selecting the face. </li><li>Select: selects the face without copying its properties. </li><li>Apply (texture only): allows you to apply the current texture to any faces clicked upon. </li><li>Apply (texture + values): will apply the current properties and texture to any faces clicked upon. </li><li>Align to View: "This is like projecting a texture from the camera face, as if you were a slide projector and the texture is a slide. It's useful for painting a texture onto a cliff or other irregular things."</li></ul></li></ul>
<u><span style='font-size:12pt;line-height:100%'><b>Part Five: Your Turn</b></span></u>

Use what you have learnt so far to place four walls and a ceiling on top of the brush you have. Make the walls about 256 units high, and make sure you don't leave any gaps between any of the brushes. You should end up with something like this:

<a href='http://merkury.orcon.net.nz/nsmapping/first/room1.jpg' target='_blank'><img src='http://merkury.orcon.net.nz/nsmapping/first/room1small.gif' border='0' alt='user posted image' /></a>
<span style='font-size:9pt;line-height:100%'>(Click for a larger picture.)</span>

<u><span style='font-size:12pt;line-height:100%'><b>Part Six: Adding A Light</b></span></u>

We're going to want to be able to see in your map, so we need to add a light. Click on the Entity Tool, or push <b>shift-e</b>.

<img src='http://merkury.orcon.net.nz/nsmapping/first/entitytool.gif' border='0' alt='user posted image' />

Check that on the right-hand side of the screen it says "light" in the "Objects:" drop-down menu. If it doesn't, click on the menu and select "light" from the list.
With the entity tool selected, click in the middle of your room on the Top view, and then use the Side and Front views to position it in the middle of the room. Hit <b>enter</b> to create the light. In your 3D view, you should be able to see a light icon in the middle of the room.

Use the Selection Tool to click on it in either the 3D or 2D view, and hit <b>alt-enter</b> to bring up the entity properties popup. Ignore the rest of the values and click on the "Brightness" attribute.

<img src='http://merkury.orcon.net.nz/nsmapping/first/lightprops.gif' border='0' alt='user posted image' />

There are 4 values in the brightness attribute; the first three denote the colour of the light, and the last denotes it's brightness. You can pick a colour by using the <b>Pick Color</b> button, and put the brightness to around 380.

<u><span style='font-size:12pt;line-height:100%'><b>Part Seven: Player Spawns</b></span></u>

The last thing we need before we can compile the map is to add a place for the players to come into it. For this, we need to create an "info_player_start" entity somewhere in the room. Using the entity tool, change the drop-down menu under "Objects:" to read "info_player_start". Place it anywhere you like in the room, but don't put it too close to walls or the floor or players will become stuck when they enter the game. Hit <b>enter</b> to create it, and make sure the box doesn't overlap any brushes.

There are no properties to set for this entity, so we're done.

In order to get your map to show up in the NS maps list, you will also need to add an "info_mapinfo" entity, just leave the properties as default. (Make sure you place it inside the room, or you will get a "Leak".)

Save your map by clicking on <b>File->Save as...</b>, put it in the <u>Hammer\maps</u> directory and exit Hammer. (You don't need to export it as that will be done automatically by HLFix if you compile using Batch Compiler.)

<u><span style='font-size:12pt;line-height:100%'><b>Part Eight: Compiling Your Map</b></span></u>

Refer to the How-To: Use Batch Compiler thread for this last step <!--emo&:)--><img src='http://www.unknownworlds.com/forums/html//emoticons/smile.gif' border='0' style='vertical-align:middle' alt='smile.gif' /><!--endemo-->

Congratulations, you've completed your first map. <!--emo&::asrifle::--><img src='http://www.unknownworlds.com/forums/html//emoticons/asrifle.gif' border='0' style='vertical-align:middle' alt='asrifle.gif' /><!--endemo-->
Sign In or Register to comment.