Garry's Mod

Garry's Mod

Pas assez d'évaluations
Using Hammer on Linux
De OPGman
This guide will explain how to use the Hammer editor on Linux using the most simple method that I've personally found.
   
Récompenser
Ajouter aux favoris
Favoris
Retirer des favoris
Introduction
I've spent quite a while trying to find a way to run Hammer on Linux. I found several methods but they were all outdated, complicated, or simply didn't work. I ended up finding this method on my own while testing a bunch of different things.

This is probably one of the most if not the most simple method. It does not require you to download an SDK, download the Windows version of Steam, use SteamCMD, or do much manual configuration (compared to other methods anyway).

Notes
  • Just because this method works for me, doesn't mean it will work for you. Results may vary between distros, software versions, and possibly even hardware.

  • This guide assumes that you already know the basics of Linux and Hammer. If you don't, there's plenty of resources out there for both.

  • This guide was made specifically for the Garry's Mod version of Hammer. It's possible other versions will work too, but I can't guarantee anything.

  • If you end up finding an easier method or different Wine version not mentioned here that works, let me know and I'll update the guide.
Installing Garry's Mod
Garry's Mod has a native Linux version, but Hammer and the rest of the SDK tools are not shipped with it, so you will need to force Steam to download the Windows version. There are several ways to do this, but the easiest way is to simply right click the game in your library, click Properties, click the Compatibility tab, and enable the checkbox that says "Force the use of a specific Steam Play compatibility tool".

You can then select a Proton version from the drop down menu. I recommend either Proton Experimental or the latest version of Proton GE if you have that installed. You won't be using this to run Hammer, so choose whichever version you think works best for running Garry's Mod itself. Once you select a Proton version, Steam should automatically start downloading the Windows version of the game.
Installing Lutris & Wine
The main piece of software you'll need is Lutris. This program allows you to run Windows software on Linux through a variety of different configurations, and has an easy to use GUI. It's mainly intended for games, but it works just as well with regular software.

Click here to view the Lutris installation instructions for your distro.[lutris.net]

You will also need to ensure that Wine gets installed, since it's responsible for actually running Hammer. Depending on what distro and package manager you're using, Wine might get automatically installed alongside Lutris. For example, in the Manjaro software manager, Wine shows up as an optional dependency that you can select to be installed with Lutris. If this isn't the case for you, you'll have to install it manually.[github.com]

NOTE: If you're using Wayland, you might be better off using the latest version of Proton GE[github.com] instead of Wine. Hammer is extremely laggy to the point of being unusable when run with Wine. Proton GE doesn't run it perfectly either but based on my tests it has a greater chance of being usable.

The specific version of Wine you download could make a huge difference. Older versions do not seem to work well with Hammer. The oldest version that seems to work is 9.0, which is currently the newest stable version. Anything newer should also work just as well. The older 8.x releases and the special Lutris versions did not work for me.
Adding Hammer to Lutris
The next step is to configure Hammer to be launched from within Lutris. In the top left corner of Lutris, click the plus (+) button, then click "Add locally installed game".

You should now see a window to configure a new game. Under the "Game info" tab, set the Name value to something fitting such as Hammer or Valve Hammer Editor, and set the Runner option to Wine.

Under the "Game options" tab, click the browse button next to the Executable option and select the hammer.exe file, which by default should be in ~/.steam/steam/steamapps/common/GarrysMod/bin. Leave everything else unchanged for now.

Under the "Runner options" tab, set the Wine version to 9.0, or whatever your newest version is. You might have to play around with this option to see which version works the best. You can also try Proton as well. Everything else here as well as everything in the "System options" tab can be left unchanged. Click save in the top right corner.

Next you can set a path for the Wine prefix. This is basically a virtual Windows drive that Hammer will use to store information such as recently opened files and view sizes. If you don't set one, it will be generated at ~/.wine, which is okay, but I personally recommend giving every program in Lutris its own prefix, in case you need to regenerate it for some reason. If you wish to do this, set the prefix path to an empty folder of your choice.

Once you set the prefix path, save the settings and launch Hammer through the Play button within Lutris. You should see a message stating that it's generating the Wine prefix. You might have to launch Hammer a second time for it to actually load once the prefix is generated.
Troubleshooting
Missing gameinfo.txt error
If you got this error, then congrats, you technically got Hammer working! Now you just need to edit a config that tells Hammer where to look for the rest of the game files. Navigate to the same bin directory that the hammer.exe is located in, and open the file named "GameConfig.txt".

Hammer is running within a Wine prefix, so it's looking for Windows paths rather than Linux paths. To have Hammer access files located in your Linux file system, you will have to go through the virtual Z: drive. For example, the GameDir path usually looks something like this: "C:\Program Files (x86)\Steam\steamapps\common\GarrysMod\garrysmod", and it needs to be changed to something like this: "Z:\home\[user]\.steam\steam\steamapps\common\GarrysMod\garrysmod". These paths could be different for you depending on where you have Garry's Mod installed, but hopefully you get the idea. Every path with a drive letter in the GameConfig.txt file needs to be changed into this new format.

Hammer crashes or freezes when opening a map
This is most likely caused by an incompatible Wine or Proton version. Keep trying different versions until it works. It might also be worth trying to roll back or update your video driver and switching between X11 and Wayland, if possible.

Views are glitched and unusable
This is either caused by an incompatible Wine/Proton version, or an improper configuration within Hammer. Check your Hammer options and ensure every option within the Game Configurations tab is set properly. Also make sure all of the file paths in the GameConfig.txt file are set properly.

Game won't launch when running map
When the game is launched from inside the Wine prefix, it tries to detect Steam, and closes if it can't find it. You can technically fix this by installing the Windows version of Steam into the prefix, but it's much easier to just launch the game through Steam on Linux and load the map manually after compiling. You'll probably run into even more issues trying to run the game through Wine instead of Proton anyway.
6 commentaires
OPGman  [créateur] 25 juil. à 7h13 
ok
2homezz 25 juil. à 1h04 
im a linux user, i have no idea what hammer is. (dont tell me what it is i dont wanna know anyway)
OPGman  [créateur] 23 juil. à 15h23 
Thanks! If anyone manages to find a better method or gets Hammer running on a different Wine version than what's mentioned here, let me know and I'll update the guide.
Nik1 23 juil. à 2h15 
Finally a genuinly good tutorial compared to other meme tutorials that aren't even funny (atleast to me, its fine if you like them).
Thanks for the tutorial, I hope more linux users that like to make maps for Garry's mod will find it!
func_arf 17 juil. à 21h40 
This will be useful when I build my new tower, thanks.
MateCRO 13 juil. à 5h49 
This will come in hand for when I switch, thank you kind internet stranger :Blessing: