S&box Wiki

Revision Difference

Creating_your_first_gm_flatgrass#529752

<cat>Dev.Map</cat> <title>Creating your first gm_flatgrass</title> The purpose of this guide is to jump into Hammer and start creating something, in this case, we will be recreating **`gm_flatgrass`** step-by-step. ⤶ If you want to learn everything about Hammer and its tools before making a map then you can [use this guide](https://docs.google.com/document/d/17aFk2Z-C1G2ZYcQRxKx-fEK3m4h0jSw9nqGjC9T1Bx4) instead, it's also useful to cover any gaps you may find yourself into while building your own **`gm_flatgrass`**. ([Here's a quick video](https://www.youtube.com/watch?v=xDq2b_iOcZM) to get you started if you don't have the time to do either) ⤶ For more documentation and tutorials on Source 2 mapping, refer to the [Mapping Resources Page](https://wiki.facepunch.com/sbox/Mapping_Resources). *`Note: This guide uses the version of Hammer that is included in Half-Life: Alyx`* # Knowing your tools **'File' > 'New'** ( <key>CTRL</key> + <key>N</key> ) to open a new map and then **'File' > 'Save'** ( <key>CTRL</key> + <key>S</key> ) to save as *gm_flatgrass*. ## Selection Modes <upload src="314/8d90a75e4575d36.png" size="43404" name="image.png" /> From left to right we will be using the following modes: **Edges** ( <key>2</key> ), **Faces** ( <key>3</key> ), **Objects** ( <key>5</key> ) <upload src="314/8d90a7fff4f08da.gif" size="820392" name="CubeExample.gif" /> These three selection modes are the bare minimum to create this map, you can switch between them by pressing the number keys that represent their position. After picking the **Selection Mode**, you may also choose which **Tool** to interact with. ## Tools You can find tools on the left side, in this guide we will use the following: <upload src="314/8d90a83c8940111.png" size="29948" name="Tools.png" /> ## All of the rest Crash course on everything else we will be using on this guide and a short description. I suggest you look at [this video tutorial](https://www.youtube.com/watch?v=HrfsfgYpYN0) to help with the layout. <upload src="314/8d90a86169ab3d9.png" size="359908" name="Remaining Stuff.png" /> * **Object Editing**: Depending on the **Tool** and your **Selection Mode**, this section will have different options to interact and modify the selected geometry. * **Compile & Play**: Opens the compile tool to run your map, use Fast Compile while working. * **2D Viewport**: Shows an [orthographic](https://en.wikipedia.org/wiki/Orthographic_projection) view of the map from any direction. You can shift views by pressing Top ( <key>F2</key> ), Front ( <key>F3</key> ), Side ( <key>F4</key> ) * **Assets Window**: Props, Materials, Prefabs etc... You can drag and drop from the **Asset Browser** that opens when running the workshop tools as well. * **Object Properties**: While having an object or **point entity** selected you can modify its scale, position, rotation, and any properties it might have. * **Grid Settings**: When moving or resizing an object, it will snap to the smallest amount of units you have selected. Most of the time we will use **64**, **32**, **16**, and **8** units. --- # Making the map step-by-step ## Step 1: With the **Block Tool** ( <key>SHIFT</key> + <key>B</key> ), select **Quad** in the **Object Editing** window, make a plane that is *2048x2048* units. The bigger your map is, the longer compiling takes, so for now we'll keep it small and enlarge it when we're ready to finalize. <upload src="314/8d90a8c729cf228.png" size="910081" name="image.png" /> You can use the **Object Properties** to center the plane in **X: 0; Y: 0** ## Step 2: With the **Entity Tool** ( <key>SHIFT</key> + <key>E</key> ) selected, from the **Object Editing** window place the **Player Start**, **Sky**, and **Environment Light**. Make sure to rotate the light having the arrow face down using the **Rotate Tool** ( <key>R</key> ) <upload src="314/8d90a8d6cba4512.png" size="447667" name="image.png" /> ### Step 2.5: Slap a grass texture on the plane and do a **Fast Compile**, if all you wanted was a literal flatgrass then you have finished the tutorial. ## Step 3: With the **Block Tool** ( <key>SHIFT</key> + <key>B</key> ), select **Cylinder** in the **Object Editing** window, make a cylinder that is *512x512* units and place it in the center. <upload src="314/8d90a8ed3e90fc7.png" size="825083" name="image.png" /> ## Step 4: With the **Clipping Tool** ( <key>SHIFT</key> + <key>X</key> ) and working in the **2D Viewport**, slice the cylinder in half by pressing <key>ENTER</key> to confirm, then slice in quarters. <upload src="314/8d90a8f8be3894c.png" size="951295" name="image.png" /> In the **Object Editing** window remember to have the third **Keep Mode** selected. ## Step 5: While in **Objects Selection Mode** ( <key>5</key> ) use the **Move Tool** ( <key>T</key> ) <upload src="314/8d90a90de6709c7.png" size="937315" name="image.png" /> # WORK IN PROGRESS I'll finish this tomorrow. ---