Garry's Mod

Garry's Mod

Not enough ratings
Different Ways to Setup Hammer for Garry's Mod
By malcontents
This guide will describe and provide guidance on multiple ways to setup Valve's map creaton software, Hammer, for Garry's Mod.
   
Award
Favorite
Favorited
Unfavorite
Intro
Welcome! The purpose of this guide is to provide lots of info on different ways to setup Hammer (Valve's Mapping Tool) for use of creating maps for Garry's Mod. If you try one way, and that way doesn't work for you, or you can't use that setup due to different circumstances (lack of game ownership for example), simply try a different way, and maybe that setup will allow you to begin on your mapping journey for Garry's Mod.
Setup One
The first way to setup Hammer for Garry's Mod (And is the configuration that I use), would be to utilize the fact that Half-Life 2 and Garry's Mod run on basically the same version of the Source Engine. We will be creating a custom profile in Half-Life 2's install of Hammer, and setting everything up to work properly with Garry's Mod. Let it be noted that you need to own and have Half-Life 2 installed to use this setup, as it relies on Half-Life 2's version of Hammer.

Let's Begin.
  1. Navigate to your Half-Life 2 game files, normally located at C:\Program Files (x86)\Steam\SteamApps\Common\half-life 2
  2. From the half-life 2 folder, enter the hl2 folder (\half-life 2\hl2)
  3. Create a new folder named custom, if there isn't one already
  4. Enter the custom folder, and create two folders, garrysmod and cstrike
  5. In another window, navigate to your GarrysMod game files, normally located at C:\Program Files (x86)\Steam\SteamApps\Common\GarrysMod\
  6. From the GarrysMod folder, enter the garrysmod folder (\GarrysMod\garrysmod)
  7. Copy these files and folders from \GarrysMod\garrysmod to garrysmod (\half-life 2\hl2\custom\garrysmod) in your other open window:
    • garrysmod_dir.vpk
    • garrysmod_000.vpk
    • garrysmod_001.vpk
    • garrysmod_002.vpk
    • materials
    • models
    • sound
  8. Go out of your garrysmod (\GarrysMod\garrysmod) folder back to GarrysMod
  9. Enter the bin folder (\GarrysMod\bin)
  10. Find and copy garrysmod.fgd from (\GarrysMod\bin) to garrysmod (\half-life 2\hl2\custom\garrysmod), in your other open window
  11. You should now see the following, minus the eft.fgd and eft2.fgd (used for making Extreme Football Throwdown maps):
  12. Copy the followiing folders to \half-life 2\hl2 (you may have to merge the folders with some of the folders that may already exist under the same name,):
    • materials
    • models
    • sound
    You may be prompted to overwrite existing files (ex. textures), simply choose to not replace the existing files with the same name
  13. Navigate back to custom (\half-life 2\hl2\custom), then enter the cstrike folder (\half-life 2\hl2\custom\cstrike)
  14. Now, using the explorer window opened to (\GarrysMod\bin), navigate to your Counter-Strike: Source game files, usually located at C:\Program Files (x86)\Steam\SteamApps\Common\counter-strike: source, unless you do not own CS: S, and instead use CS: S textures, in which case navigate to them and skip to step sixteen
  15. Enter the folder cstrike (counter-strike: source\cstrike)
  16. Find and open cstrike_pak_dir.vpk using a tool such as GCFScape, which can be downloaded here[nemesis.thewavelength.net]

  17. Extract these folders from cstrike_pak_dir.vpk to or copy your CS: S textures to cstrike (\half-life 2\hl2\custom\cstrike):
    • materials
    • models
    • particles
    • sound
  18. You should now see the following in your cstrike folder (\half-life 2\hl2\custom\cstrike):
  19. Now, navigate back to your Half-Life 2 game files, usually located at C:\Program Files (x86)\Steam\SteamApps\Common\half-life 2
  20. Find and enter the bin folder (\half-life 2\bin)
  21. Locate and launch Hammer.exe
  22. In Hammer, navigate to Tools, and click Options

    Legacy Setup
    The remaining steps in this section are outdated and don't seem to work anymore. Jump to the updated section one procedure for the updated steps. Some values from the legacy steps may need to be referenced if they are blank.

  23. Click on the edit button next to the drop-down menu of configurations
  24. In the pop-up box, click add, then enter Garry's Mod, or whatever you would like to name your configuration, and click Ok
  25. Select the configuration that you just created in drop-down menu under Configuration if it isn't selected already
  26. Next to the Game Data Files area, click Add, and navigate to your Half Life 2 game files
  27. From your Half Life 2 game files, navigate to \bin\ (\Half Life 2\bin)
  28. Select and click Open on halflife2.fgd
  29. Click Add again, and navigate to the garrysmod.fgd that you copied over, located in \half-life 2\hl2\custom\garrysmod
  30. Select it, and click Open
  31. Now, fill out the rest of the boxes so that they match this info:
    The values:
    • Default PointEntity Class:
      info_player_start
    • Default SolidEntity Class:
      func_detail
    • Cordon Texture:
      tools/toolsskybox
    • Game Executable Directory:
      $SteamUserDir\half-life 2
    • Game Directory:
      $SteamUserDir\half-life 2\hl2
    • Hammer VMF Directory:
      $SteamUserDir\half-life 2\sourcesdk_content\hl2\mapsrc
  32. Change over to the Build Programs tab
  33. Ensuring the Garry's Mod configuration (or whatever you named it) is selected, match the info as follows:

    The values:
    • Game Executable:
      D:\SteamLibrary\SteamApps\common\GarrysMod
    • BSP Executable:
      $SteamUserDir\half-life 2\bin\vbsp.exe
    • VIS Executable:
      $SteamUserDir\half-life 2\bin\vvis.exe
    • RAD Executable:
      $SteamUserDir\half-life 2\bin\vrad.exe
    • Place compiled maps in this directory before running the game:
      C:Program Files (x86)\Steam\SteamApps\common\GarrysMod\garrysmod\maps
You're done! You should now be able to launch and use Half-Life 2's Hammer.exe (in \half-life 2\bin) to create maps for Garry's Mod.

Advantages/Disadvantages
The downsides of using this method are as follows:
  • You use up a lot of "unnecessary" hard drive space, because you have two copies of the Garry's Mod vpks, three copies of the materials, models, sound, etc folders, and two copies of all the textures and models from Counter-Strike: Source (these include the game install's copies)
  • Whenever you add custom content to Garry's Mod, and want to use that in this Hammer setup, you will have to copy the file (ex. texture) to the respective folder in custom, and the respective folder in hl2
The advantages of using this method however, are:
  • By storing all the Counter-Strike: Source files in the custom folder, packing textures/models into the bsp won't include every single Counter-Strike: Source texture and model, like Setup 2 inadvertently does. This makes compiled maps considerably smaller, and including CS: S textures is redundant anyways, as most players have either Counter-Strike: Source mounted, or CS: S textures installed
Updated Setup One Procedure
This section serves as an update on correctly configuring Hammer for setup one. This is to address custom configurations not applying in Hammer's settings. Following the successful launch of Hammer.exe (in \half-life 2\bin) at step 21 and 22, complete the setup by doing the following:
  1. Leave the configuration set to Half-Life 2
  2. Next to the Game Data Files area, click Add, and navigate to the garrysmod.fgd file that you copied over, located in \half-life 2\hl2\custom\garrysmod
  3. Select it, and click Open
  4. Verify that halflife2.fgd is also in the list of utilized game data files
  5. If not, the file is located in \half-life 2\bin

  6. Verify other blank fields are matching the values described in setup one above, however the Game Executable and Place compiled maps in this directory before running the game fields under the Build Programs tab can be left blank or default
Now relaunch Hammer.exe and it will properly function creating maps, however you will need to use software alternate to Hammer's built in compiler, such as Valve Batch Compile Tool found here[qsextreme.com].
Setup Two
A second way to setup Hammer for Garry's Mod would be to utilize the version of Hammer that is installed into Garry's Mod's game files. This install of Hammer is located at \GarrysMod\bin\. Upon loading this Hammer, you will run into the error "Missing material 'editor/wireframe'" when you attempt to load/create a map, and Hammer will be unusable.

To fix this issue:
  1. First, navigate to your Garry's Mod install, usually located at C:\Program Files (x86)\Steam\SteamApps\Common\GarrysMod\, if you weren't already there
  2. Second, enter the bin folder in GarrysMod (GarrysMod\bin)
  3. Next, locate and open GameConfig.txt
  4. Now, replace the entirety of the text file with this new text, which will setup Hammer properly for our use:
    "Configs" { "Games" { "Garry's Mod" { "GameDir" "C:\Program Files (x86)\Steam\SteamApps\common\GarrysMod\garrysmod" "Hammer" { "GameData0" "C:\Program Files (x86)\Steam\SteamApps\common\GarrysMod\bin\garrysmod.fgd" "TextureFormat" "5" "MapFormat" "4" "DefaultTextureScale" "0.250000" "DefaultLightmapScale" "16" "GameExe" "C:\Program Files (x86)\Steam\SteamApps\common\GarrysMod\hl2.exe" "DefaultSolidEntity" "func_detail" "DefaultPointEntity" "info_player_teamspawn" "BSP" "C:\Program Files (x86)\Steam\SteamApps\common\GarrysMod\bin\vbsp.exe" "Vis" "C:\Program Files (x86)\Steam\SteamApps\common\GarrysMod\bin\vvis.exe" "Light" "C:\Program Files (x86)\Steam\SteamApps\common\GarrysMod\bin\vrad.exe" "GameExeDir" "C:\Program Files (x86)\Steam\SteamApps\common\GarrysMod" "MapDir" "C:\Program Files (x86)\Steam\SteamApps\common\GarrysMod\sourcesdk_content\mapsrc" "BSPDir" "C:\Program Files (x86)\Steam\SteamApps\common\GarrysMod\garrysmod\maps" "CordonTexture" "tools\toolsskybox" "MaterialExcludeCount" "0" } } "Team Fortress 2" { "GameDir" "C:\Program Files (x86)\Steam\SteamApps\common\GarrysMod\tf" "Hammer" { "GameData0" "C:\Program Files (x86)\Steam\SteamApps\common\GarrysMod\bin\tf.fgd" "TextureFormat" "5" "MapFormat" "4" "DefaultTextureScale" "0.250000" "DefaultLightmapScale" "16" "GameExe" "C:\Program Files (x86)\Steam\SteamApps\common\GarrysMod\hl2.exe" "DefaultSolidEntity" "func_detail" "DefaultPointEntity" "info_player_teamspawn" "BSP" "C:\Program Files (x86)\Steam\SteamApps\common\GarrysMod\bin\vbsp.exe" "Vis" "C:\Program Files (x86)\Steam\SteamApps\common\GarrysMod\bin\vvis.exe" "Light" "C:\Program Files (x86)\Steam\SteamApps\common\GarrysMod\bin\vrad.exe" "GameExeDir" "C:\Program Files (x86)\Steam\SteamApps\common\GarrysMod" "MapDir" "C:\Program Files (x86)\Steam\SteamApps\common\GarrysMod\content\tf\mapsrc" "BSPDir" "C:\Program Files (x86)\Steam\SteamApps\common\GarrysMod\tf\maps" "CordonTexture" "tools\toolsskybox" "MaterialExcludeCount" "0" } } "Day of Defeat: Source" { "GameDir" "C:\Program Files (x86)\Steam\SteamApps\common\GarrysMod\dod" "Hammer" { "GameData0" "C:\Program Files (x86)\Steam\SteamApps\common\GarrysMod\bin\dod.fgd" "TextureFormat" "5" "MapFormat" "4" "DefaultTextureScale" "0.250000" "DefaultLightmapScale" "16" "GameExe" "C:\Program Files (x86)\Steam\SteamApps\common\GarrysMod\hl2.exe" "DefaultSolidEntity" "func_detail" "DefaultPointEntity" "info_player_allies" "BSP" "C:\Program Files (x86)\Steam\SteamApps\common\GarrysMod\bin\vbsp.exe" "Vis" "C:\Program Files (x86)\Steam\SteamApps\common\GarrysMod\bin\vvis.exe" "Light" "C:\Program Files (x86)\Steam\SteamApps\common\GarrysMod\bin\vrad.exe" "GameExeDir" "C:\Program Files (x86)\Steam\SteamApps\common\GarrysMod" "MapDir" "C:\Program Files (x86)\Steam\SteamApps\common\GarrysMod\content\dod\mapsrc" "BSPDir" "C:\Program Files (x86)\Steam\SteamApps\common\GarrysMod\dod\maps" "CordonTexture" "tools\toolsskybox" "MaterialExcludeCount" "0" } } "Counter-Strike: Source" { "GameDir" "C:\Program Files (x86)\Steam\SteamApps\common\GarrysMod\cstrike" "Hammer" { "GameData0" "C:\Program Files (x86)\Steam\SteamApps\common\GarrysMod\bin\cstrike.fgd" "TextureFormat" "5" "MapFormat" "4" "DefaultTextureScale" "0.250000" "DefaultLightmapScale" "16" "GameExe" "C:\Program Files (x86)\Steam\SteamApps\common\GarrysMod\hl2.exe" "DefaultSolidEntity" "func_detail" "DefaultPointEntity" "info_player_terrorist" "BSP" "C:\Program Files (x86)\Steam\SteamApps\common\GarrysMod\bin\vbsp.exe" "Vis" "C:\Program Files (x86)\Steam\SteamApps\common\GarrysMod\bin\vvis.exe" "Light" "C:\Program Files (x86)\Steam\SteamApps\common\GarrysMod\bin\vrad.exe" "GameExeDir" "C:\Program Files (x86)\Steam\SteamApps\common\GarrysMod" "MapDir" "C:\Program Files (x86)\Steam\SteamApps\common\GarrysMod\content\cstrike\mapsrc" "BSPDir" "C:\Program Files (x86)\Steam\SteamApps\common\GarrysMod\cstrike\maps" "CordonTexture" "tools\toolsskybox" "MaterialExcludeCount" "0" } } } "SDKVersion" "5" }
    Don't worry about the formatting, once you run Hammer, it will automatically fix that for you.
  5. If your game library differs in location, adjust the paths to reflect your steam library's location (Ex. My library is at D:\Steamlibrary, so I would replace C:\Program Files (x86)\Steam with D:\Steamlibrary
  6. Now, launch Hammer again, select Garry's Mod from the list of profiles, and click OK
  7. In Hammer, navigate to Tools, and click Options
  8. Next to the Game Data Files area, click Add, and navigate to your Half Life 2 game files
  9. From your Half Life 2 game files, navigate to \bin\ (\Half Life 2\bin)
  10. Select and click Open on halflife2.fgd
  11. In the Game Configurations tab, everything should already be setup properly, and look the same as below, minus the different paths to my Steam games
    Note: I used the halflife2.fgd located in \GarrysMod\bin, but using the halflife2.fgd from your Half Life 2 game files will work the exact same way Make sure that the drop-down menu under Configuration: is set to Garry's Mod
  12. The settings should be correctly setup due to us modiying the GameConfig text file earlier, but if you decide to change some of the settings, here are some of the default settings based on the new version of GameConfig.txt that we created
    • Game Executable Directory:
      C:\Program Files (x86)\Steam\SteamApps\common\GarrysMod
    • Game Directory:
      C:\Program Files (x86)\Steam\SteamApps\common\GarrysMod\garrysmod
    • Hammer VMF Directory:
      C:\Program Files (x86)\Steam\SteamApps\common\GarrysMod\sourcesdk_content\mapsrc
  13. Ensuring that the settings were correct in the Game Configurations tab, navigate over to the Build Programs tab

Charater limits imposed on sections of guides has forced me to split Setup 2 into two parts.
Setup Two (Cont.)
Note: Due to having to split Setup 2 into two parts, the steps have reset back to 1, so just pretend step 1 is actually step 14, and so on
  1. The settings should also already be correct, and match below, again differing in the paths to your Steam libraryIn case you decide to change some of the settings and need the default paths, here are the default settings:
    • Game Executable:
      C:\Program Files (x86)\Steam\SteamApps\common\GarrysMod\hl2.exe
    • BSP Executable:
      C:\Program Files (x86)\Steam\SteamApps\common\GarrysMod\bin\vbsp.exe
    • VIS Executable:
      C:\Program Files (x86)\Steam\SteamApps\common\GarrysMod\bin\vvis.exe
    • RAD Executable:
      C:\Program Files (x86)\Steam\SteamApps\common\GarrysMod\bin\vrad.exe
  2. When you are done editing all your settings to your game installation, click OK, and relaunch Hammer
Now you are done, and should be able to use Garry's Mod's install of Hammer to create maps for Garry's Mod!

Downside
The downside of using this method is that you won't have any Counter-Strike: Source textures, models, sounds, etc, unless you extract the materials, models, sounds, etc folders from cstrike_pak_dir.vpk, located in your Counter-Strike: Souce game files (Counter-Strike: Source\cstrike) into GarrysMod\garrysmod. The issue comes into play when you start using custom textures not included in any Source game in your maps. When you attempt to pack the custom content into the BSP (compiled map), so that others can see/use it, the packing software, such as Map Analyst, will pack all the Counter-Strike: Source materials, models, etc, into your BSP along with your custom content. This not only greatly increases the file size of your map, and is redundant except for those who haven't installed Counter-Strike: Source or CS:S textures, it is also not necessarily legal, as you would be distributing your map with Valve's content in it.
Conclusion
In conclusion, this guide presents different ways to setup Hammer to work properly with Garry's Mod, allowing for the creation of maps for Garry's Mod. I plan on eventually adding more ways to setup Hammer, possibly one through the Source SDK tool, when I have the time. I personally prefer setup 1, just because I don't have to worry about the hard drive space, and I work with custom textures frequently, so I don't want all the Counter-Strike: Source content being packed into my map. Hope this helped someone, and if I missed something/messed up, feel free to let me know in the comments.
15 Comments
.*Samochud*. JUMP2009.WMV 21 Oct, 2018 @ 7:35am 
Also, will the same work for CSGO & Portal 2 assets?
.*Samochud*. JUMP2009.WMV 21 Oct, 2018 @ 7:29am 
What about Episodic content?
malcontents  [author] 21 Mar, 2018 @ 6:48pm 
@TheBlizWiz Good point, thanks for the tip!
TheBlizWiz 19 Mar, 2018 @ 6:12pm 
If you don't have a materials / models / sound folder, just create an empty folder of the same name. That just means you don't have any custom content that would require those folders to generate. =)
~$$~ BlackCatTheGreat 7 Mar, 2017 @ 5:42pm 
Everything seems to be working, i shall be attempting the creation of a new map.
~$$~ BlackCatTheGreat 7 Mar, 2017 @ 5:34pm 
Never mind i found my "garrysmod.fgd" in a different file location then stated in the guide.
~$$~ BlackCatTheGreat 7 Mar, 2017 @ 4:52pm 
I found the GCF program of whatever that you linked in the guide that i failed to see but it seems that "garrysmod.fgd" is missing.
~$$~ BlackCatTheGreat 7 Mar, 2017 @ 2:45pm 
What exactly do you mean by "Extract"?? Is there something i am missing? When i try to open garrysmod_dir.vpk normally it doesnt 't do anything i am able to see. Do i need to exstract with a program such as Winrar, or some other program i don't know of that pertains to the "Source game addon" file type??
malcontents  [author] 6 Mar, 2017 @ 6:42pm 
~$$~ BlackCatTheGreat ♣♣ extract it from your garrysmod_dir.vpk
~$$~ BlackCatTheGreat 4 Mar, 2017 @ 10:15am 
What to do it Sounds and Models aare missing in the garrysmod folder?