Team Fortress 2/Your First Map: Difference between revisions
mNo edit summary |
(Expansion) |
||
Line 4: | Line 4: | ||
{{TF2 topicon}}{{source topicon}}[[Category:Hammer]][[Category:Level Design]][[Category:Team Fortress 2|Your first map]] | {{TF2 topicon}}{{source topicon}}[[Category:Hammer]][[Category:Level Design]][[Category:Team Fortress 2|Your first map]] | ||
<!--I quoted a lot from "Level Design Introduction/Your First Level (Portal 2)".--> | <!--I quoted a lot from "Level Design Introduction/Your First Level (Portal 2)".--> | ||
In {{tf2|4}}, players can play lot of community maps, such as jump, dodgeball, MGE, trading maps, training maps, etc. Even if you are just vaguely trying to do map making, there will be a type of map you want to make. This article will cover common needs across various maps. Anyone running | In {{tf2|4}}, players can play lot of community maps, such as jump, dodgeball, MGE, trading maps, training maps, etc. Even if you are just vaguely trying to do map making, there will be a type of map you want to make. This article will cover common needs across various maps. Anyone running {{Hammer|2}} for the first time is the intended audience for this article. Whether you use Hammer or {{Hammer++|2}}, either is fine. | ||
== Getting started == | == Getting started == | ||
Hammer editor is built in TF2. Refer to [[Getting Started]] for running | The Hammer editor is built in TF2. Refer to [[Getting Started]] for running Source's level editor. | ||
== Create main stage and applying a skybox == | == Create main stage and applying a skybox == | ||
=== Make | === Make a cube === | ||
[[File:l4d_hammer_brush_01.jpg|thumb|right|300px|caption|Drawing a brush.]] | [[File:l4d_hammer_brush_01.jpg|thumb|right|300px|caption|Drawing a brush.]] | ||
Before dealing with this topic, We need to think about what a sky is in the Source engine. Many Source engine game users imagine a world is a flat platform and there is an open space above it. However, | Before dealing with this topic, We need to think about what a sky is in the Source engine. Many Source engine game users imagine a world is a flat platform and there is an open space above it. However, Source engine maps are actually in a box! When players see a wallpaper with a picture of the sky on it, they think it's the sky. Now let's implement this. Let's create a cube-shaped world. | ||
# | # Press {{key|Shift}}+{{key|B}} or select the [[File:Hammer block.png]] "Block tool" in the left tool bar. | ||
# Left-click and drag in the '''Top''' 2D view in a movement that is ''Right'' and ''Downward'' as shown below. | # Left-click and drag in the '''Top''' 2D view in a movement that is ''Right'' and ''Downward'' as shown below. | ||
# You should see a dotted outline of a rectangle or square as you drag. | # You should see a dotted outline of a rectangle or square as you drag. | ||
Line 31: | Line 31: | ||
# To go back to selection mode, click on the [[File:Hammer select.png]] '''Selection tool''' icon on the '''Tool''' bar or press the {{key|Esc}} key. | # To go back to selection mode, click on the [[File:Hammer select.png]] '''Selection tool''' icon on the '''Tool''' bar or press the {{key|Esc}} key. | ||
# Right-click the "x" in the center of the square to select it. Left click, then choose '''Make Hollow'''. Set the thickness to 16. | # Right-click the "x" in the center of the square to select it. Left-click, then choose '''Make Hollow'''. Set the thickness to 16. | ||
A new cube is created inside the cube. | A new cube is created inside the cube. | ||
{{note|There is no need to blindly use '''make hollow'''. You can also build the walls, floor, and ceiling one by one using '''Block Tool'''.}} | {{note|There is no need to blindly use '''make hollow'''. You can also build the walls, floor, and ceiling one by one using the '''Block Tool'''.}} | ||
{{clr}} | {{clr}} | ||
=== Navigating in the 3D Camera viewport === | === Navigating in the 3D Camera viewport === | ||
Moving around in 3D is a bit different from the 2D viewports: | Moving around in 3D is a bit different from the 2D viewports: | ||
Line 46: | Line 45: | ||
* Hold down {{key|Space}} and right-click and drag to move '''up/down''' and '''left/right'''. | * Hold down {{key|Space}} and right-click and drag to move '''up/down''' and '''left/right'''. | ||
* Hold down {{key|Space}} and both right and left-click and drag to move '''forward''' and '''backward'''. | * Hold down {{key|Space}} and both right and left-click and drag to move '''forward''' and '''backward'''. | ||
* You can also use {{key|W}} | * You can also use the {{key|W}}{{key|A}}{{key|S}}{{key|D}} keys to move '''forward''', '''backward''', '''strafe left''' and '''strafe right''' respectively. | ||
* The {{key|Z}} key toggles on and off "mouse look" mode. Move your mouse cursor over the 3D Camera viewport and press the {{key|Z}} key. You can now move your mouse around as if mouse look was on in the game. | * The {{key|Z}} key toggles on and off "mouse look" mode. Move your mouse cursor over the 3D Camera viewport and press the {{key|Z}} key. You can now move your mouse around as if mouse look was on in the game. | ||
{{note|The {{key|W}} {{key|A}} {{key|S}} {{key|D}} keys can be used in combination with the {{key|Space}} navigation}} | {{note|The {{key|W}}{{key|A}}{{key|S}}{{key|D}} keys can be used in combination with the {{key|Space}} navigation}} | ||
{{clr}} | {{clr}} | ||
Line 64: | Line 62: | ||
# Select Toggle Texture application with {{key|Shift}}+{{key|A}} | # Select Toggle Texture application with {{key|Shift}}+{{key|A}} | ||
# Select face of the cube inside. | # Select face of the cube inside. | ||
# In face edit sheet, click | # In the face edit sheet, click '''Browse...'''. | ||
Line 75: | Line 73: | ||
== Make starting locate == | == Make starting locate == | ||
Now let's go into the game. Source games require an entity to spawn players. | |||
# Select the [[File:Hammer entity.png]] '''Entity Tool''' by hitting {{key|Shift}}+{{key|E}} or selecting on the '''Tool''' Bar. | |||
# Select the [[File:Hammer entity.png]] '''Entity Tool''' | |||
# Stand it on center of square. | # Stand it on center of square. | ||
Line 92: | Line 89: | ||
=== Going back to the main topic === | === Going back to the main topic === | ||
Select the entity by using the Selection Tool. | |||
Select the entity using | |||
{{note|Entities also have an '''x''' slightly below their waist. Click there to select it.}} | {{note|Entities also have an '''x''' slightly below their waist. Click there to select it.}} | ||
[[File:Hammer obj properties.png|500px|caption|select {{code|info_player_teamspawn}}]]{{clr}} | [[File:Hammer obj properties.png|500px|caption|select {{code|info_player_teamspawn}}]]{{clr}} | ||
Now it's time to set | Now it's time to set its properties. | ||
Press {{key|Alt}}+{{key|Enter}}, or right-click and enter '''Properties'''. | |||
Change | Change the entity name to {{code|info_player_teamspawn}}. | ||
== Compile and Run == | == Compile and Run == | ||
When everything is ready and finalized, press F9 to compile. | When everything is ready and finalized, press F9 to compile. | ||
If you want to try your map , move | If you want to try your map, move the BSP file to {{code|[your Steam Directory]\steamapps\common\Team Fortress 2\tf\maps}} | ||
Then in | Then in the TF2 client, click on "Create Server" and search for your map to start. Make sure Steam Networking is disabled if you want to stop players from joining your server! | ||
[[File:Skybox demostrare1.jpg|700px]] | [[File:Skybox demostrare1.jpg|700px]] | ||
As you can see, | As you can see, we did well. | ||
{{navbar2|Team Fortress 2/Your First Map|Your First Map|Team Fortress 2 Maping tutorial|Team Fortress 2 Maping|Team Fortress 2/Building Respawn Room|Building Respawn Room}} | {{navbar2|Team Fortress 2/Your First Map|Your First Map|Team Fortress 2 Maping tutorial|Team Fortress 2 Maping|Team Fortress 2/Building Respawn Room|Building Respawn Room}} |
Revision as of 01:40, 26 May 2025


In Team Fortress 2, players can play lot of community maps, such as jump, dodgeball, MGE, trading maps, training maps, etc. Even if you are just vaguely trying to do map making, there will be a type of map you want to make. This article will cover common needs across various maps. Anyone running
Hammer for the first time is the intended audience for this article. Whether you use Hammer or
Hammer++, either is fine.
Getting started
The Hammer editor is built in TF2. Refer to Getting Started for running Source's level editor.
Create main stage and applying a skybox
Make a cube
Before dealing with this topic, We need to think about what a sky is in the Source engine. Many Source engine game users imagine a world is a flat platform and there is an open space above it. However, Source engine maps are actually in a box! When players see a wallpaper with a picture of the sky on it, they think it's the sky. Now let's implement this. Let's create a cube-shaped world.
- Press ⇧ Shift+B or select the
"Block tool" in the left tool bar.
- Left-click and drag in the Top 2D view in a movement that is Right and Downward as shown below.
- You should see a dotted outline of a rectangle or square as you drag.
- Create a square 512x512 units and let go of the left-mouse button. Please make the 512x512 square visible not only at Top but also at Right and Downward.
- Press ↵ Enter on your keyboard to create this brush that you've just drawn.

Dig It!
Now it's time to dig inside.
- To go back to selection mode, click on the
Selection tool icon on the Tool bar or press the Esc key.
- Right-click the "x" in the center of the square to select it. Left-click, then choose Make Hollow. Set the thickness to 16.
A new cube is created inside the cube.

Moving around in 3D is a bit different from the 2D viewports:
- Hold down Space and left-click and drag to rotate the camera.
- Hold down Space and right-click and drag to move up/down and left/right.
- Hold down Space and both right and left-click and drag to move forward and backward.
- You can also use the WASD keys to move forward, backward, strafe left and strafe right respectively.
- The Z key toggles on and off "mouse look" mode. Move your mouse cursor over the 3D Camera viewport and press the Z key. You can now move your mouse around as if mouse look was on in the game.

Apply Skybox
Now we will put on the skybox.
- Move the camera view into the cube.
- Select Toggle Texture application with ⇧ Shift+A
- Select face of the cube inside.
- In the face edit sheet, click Browse....
Search tools/toolsskybox. You can find it more easily by typing tools in the filter field.
Once you have selected the skybox, apply it to the surface you want to apply it to. Using current texture will make your work easier.
The side to which toolsskybox is applied becomes the sky.
Make starting locate
Now let's go into the game. Source games require an entity to spawn players.
- Select the
Entity Tool by hitting ⇧ Shift+E or selecting on the Tool Bar.
- Stand it on center of square.
The grid
A grid is displayed in all the 2D views. By default, all objects snap to the grid. Although you can turn this off, it is considered good practice to leave it on because it prevents leaks and other errors in your map.
The default grid size is 64 units, which means that each line is 64 units apart. The current size of the grid is displayed in the status bar at the bottom of the Hammer window.
- Clicking the Smaller Grid icon
will make the grid half as big, for finer adjustments. You can also decrease the grid size with the [ key
- Clicking the Larger Grid icon
will make the grid twice as big, for larger adjustments. You can also increase the grid size with the ] key.
To bring the grid size down to 16 units, press the [ key twice. Look at the Status bar at the bottom right of the Hammer window and make sure it reads Grid: 16. If it doesn't, press [ or ] until is does.
Going back to the main topic
Select the entity by using the Selection Tool.

Now it's time to set its properties.
Press Alt+↵ Enter, or right-click and enter Properties.
Change the entity name to info_player_teamspawn.
Compile and Run
When everything is ready and finalized, press F9 to compile. If you want to try your map, move the BSP file to [your Steam Directory]\steamapps\common\Team Fortress 2\tf\maps
Then in the TF2 client, click on "Create Server" and search for your map to start. Make sure Steam Networking is disabled if you want to stop players from joining your server!
As you can see, we did well.