S&box Wiki

Revision Difference

GettingStartedWithHammer#551173

<cat>Hammer.Intro</cat> <title>Getting Started With Hammer</title> # Getting Started ## Creating a Map Addon⤶ Before you do anything, you need to make a Content addon which will allow you to compile and upload the map. Start by going to the Projects tab and pressing the "+" button and selecting "Create New..."⤶ <upload src="a3852/8daf5837731a15c.png" size="15676" name="sbox-dev_jRaDXkNRxP.png" /> Once you have done that a window will pop up with some options, change the "Project Type" to Content and fill in the rest with what you want such as Map name and location. <upload src="a3852/8db5186d7c2bb5b.png" size="24617" name="image.png" /> Then navigate to the Asset Browser and locate the map, Right click and "Open in Editor...". <upload src="a3852/8db518718d3242e.png" size="21832" name="image.png" />⤶ ⤶ ## Errors⤶ ⤶ If you are getting the error "(map path) is outside of the directory required for game content:" your map is not classed as an addon, which means you either haven't created a map addon or in some cases your vmap does not match the name of the addon package ident. ⤶ ⤶ If you created a map before making a addon, follow the above steps using your vmap name and copy your current map into the addons /maps folder.⤶ ⤶ If you are getting a "You were disconnected from the server. CLIENT_NO_MAP Reason:(map name)" It means the package ident does not match the vmap/vpk you uploaded.⤶ # 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).