S&box Wiki

Revision Difference

GettingStartedWithHammer#560922

<cat>Hammer.Intro</cat> <title>Getting Started With Hammer</title> <deprecated></deprecated>⤶ # Getting Started ## Creating a content project Before you can do anything, you will need to make a project which will contain your map file(s), and any other custom assets you will want to use for your map. If you already have a project, you can skip this part. A project can have multiple maps in it. Start by going to the Projects tab and pressing the `+` button, then selecting `Create a new project...` <upload src="70c/8db84579290e9d7.png" size="19634" name="image.png" /> Once you have done that a window will pop up with some options, select `Empty` content project and fill in the rest as you see fit, namely the project name and location. <upload src="70c/8db8471ccda5b89.png" size="24068" name="image.png" /> Press Create and you now have a content project ready for use. ## Creating a new map Once you have a project created, you can navigate to it using the Asset Browser and then create your first map file. Select your project from the project list in the Asset Browser, right click on any empty space in the Asset List and select `New Asset...` then `Map`: <upload src="70c/8db8471e5059429.png" size="44413" name="image.png" /> A popup will show up asking for a name, and save location. You will want to create a new folder called `maps/`, open it, give the map a name, and save it. <note>Your map **must** be within the maps/ folder, or it will fail to load in-game when testing.</note> The game will create a sample map file for you with some basic entities pre-placed to get you started. You can now open and edit your new map. <upload src="70c/8db84740a83f540.png" size="31789" name="image.png" /> ## First steps to run the map in-game You can open your map in the Hammer editor by double clicking the map asset in the Asset Browser. You can also right click for more options, such as quickly loading a compiled version of the map in-game. Ah yes. Before you can load your map in-game it must be first compiled. To do this press the "Run Map" button in the toolbar, or simply press <key>F9</key> when your map is open in Hammer. <upload src="70c/8db8473cbdbc96f.png" size="21120" name="image.png" /> This will open map compilation dialog. You can also open this window using `File` > `Build Map...` option the Hammer Editor's toolbar. <upload src="70c/8db8473f1b5317d.png" size="25147" name="image.png" /> Select `Fast Compile` and `Load in engine after build` and press `Build`. This will quickly compile your map and load it in-game using your currently selected gamemode. And that's it! You have made your first map and loaded it in-game. You can now start [learning to use the Hammer Editor](Mapping_Resources) and create your very own map! Just keep in mind that you will need to compile the map to see changes in-game. ## What's next? Once you are happy with how your map looks and plays, you can publish it to asset.party, for other players to play on. Before uploading your map you will want to perform `Full Compile` or `Final Compile` build of the map. This will be much slower, but will result in best quality for lighting. You can then [upload your map to asset.party by following this guide](UploadingAssets).