How to install the Hammer Editor on Linux

Discussion in 'Tutorials & Resources' started by Hurricane Pootis, Sep 6, 2020.

  1. Hurricane Pootis

    Hurricane Pootis L1: Registered

    Messages:
    6
    Positive Ratings:
    5
    If you want to use CSGO's sdk, follow this: https://andrealmeid.com/post/2020-05-28-csgo-hammer-linux/

    1. First, open up steam through terminal with -console (steam -console)

    2. You will now see a console tab next to your other tabs on the top bar.

    3. Then, go to the website https://steamdb.info/ and look at your game.

    4. For example, let's look at TF2, who's steam id is 440.

    5. If you go to the depots of 440 (https://steamdb.info/app/440/depots/) you will see a depot with the ID 232251 which provides all of the windows binaries, and the sdk for TF2.

    6. With this now, go back to your steam console and type download_depot 440 232251

    7. This will download that depot into your ~/.local/share/steam/ubuntu12_32/steamapps/content/app_440/depot_232251/

    8. You will want to copy all of the files in the bin folder from the depot into your own bin folder already installed with the linux binaries.

    9. You know have hammer installed. You must now configure wine.

    10. DXVK works for me, but I remember it not working for some while, so be careful. Gallium nine works eh, and esync and fsync work fine.

    11. First, make sure you have winetricks installed. To install on arch, type sudo pacman -S winetricks If you are on another distro, I can't help you there, for I use arch.

    12. The create the new wine prefix, in a terminal window type WINEPREFIX=~/.hammer winetricks This will create a new wine prefix at ~/.hammer, and open up winetricks.

    13. To open up winetricks without make a new wine prefix, type winetricks into your terminal

    14. Select your default prefix

    15. Select Install a Windows DLL or component

    16. Install MS .NET 4.8, vcrun2003, vcrun2005, vcrun2008, vcrun2010, vcrun2012, vcrun2013, vcrun2015

    17. After everything is done installing, navigate to the bin folder where you copy and pasted the windows files into.

    18. Open up a terminal there. If you created a new wine prefix, type WINEPREFIX=~/.hammer wineconsole hammer.bat. If you are using your normal prefix, type wineconsole hammer.bat

    19. Congrats! You now have hammer running on linux. If you want to increase compile times, I would suggest using an esync/fsync enabled wine binaries. If you want to use esync/fsync, setup an application like lutris to launch hammer with it's own wine version, which has esync and fsync.

    20. Here's a picture for proof: https://imgur.com/a/aSNLAkd
    Extra Info:

    This is good enough, but I would also recommend using Lutris. Lutris's version of wine supports fsync, and Lutris itself allows you to customize wine settings much easier than using winetricks itself. Make sure to point Lutris to the wineprefix you made (i.e. ~/.hammer), and to launch from the .exe instead of the .bat.

    Also, Slammin tools hammer (which I recommend using with the multi-thread vrad) works on Linux too. If you are going to use Slammin, you must and an argument to your launch command. You most add -game (path\to\game\directory\in\wine) If you don't point to your game directory using slammin tools, blended textures don't work. For example, even though I am on Linux, for my argument I have: -game "D:\SteamLibrary\steamapps\common\Team Fortress 2" If you want to find your path to your game reliably, you can type into your terminal wine explorer.exe and copy the path that you get when you go to your tf2 folder. Here's image proof that it works: https://i.imgur.com/vt424DX.png

    Sorry if these seems like a mess, I just wanted to get this info out because I have seen plenty of poor guides for hammer on Linux. If you gues have questions, leave a comment, and I will try to respond
     
    • Thanks Thanks x 4
  2. Pawlakov

    Pawlakov L4: Comfortable Member

    Messages:
    160
    Positive Ratings:
    34
    I once tried to run Hammer on my Fedora PC without any success.
    I'll try to follow these steps and maybe this time I'll succeed.
    Thanks!
     
  3. Hurricane Pootis

    Hurricane Pootis L1: Registered

    Messages:
    6
    Positive Ratings:
    5
    No problem! :)
     
  4. beeP 2

    beeP 2 L1: Registered

    Messages:
    1
    Positive Ratings:
    0
    Hey,

    I came across this post wondering how to get hammer working on Linux and your guide has helped me get hammer working for HL2, Thanks a bunch!
     
  5. Vermelho

    Vermelho L1: Registered

    Messages:
    12
    Positive Ratings:
    1
    i do not understand the "You will want to copy all of the files in the bin folder from the depot into your own bin folder already installed with the linux binaries."

    Copy what? The Team Fortress 2 folder? Or only TF2 binaries?
    And i have errors with hammer: Missing Files is hte problem.
     
  6. Kube

    aa Kube Stale air

    Messages:
    1,317
    Positive Ratings:
    1,776
    Copy all the files from the depot "/bin/" over to the "/bin/" folder in your default installation.
    Unfortunately I can't help with any Hammer missing files errors :(

    Also: I've got HL2 Hammer working on Kubuntu thanks to this tutorial!

    upload_2021-6-8_15-24-46.png
     
  7. SovietAgent007

    SovietAgent007 L1: Registered

    Messages:
    5
    Positive Ratings:
    2
    Adding another big thanks! These instructions work for Hammer++ too and Ubuntu MATE.

    The only minor thing I've noticed so far that doesn't work is auto-launching TF2 after the map is done compiling. Thankfully it does copy over the *.bsp correctly, so manually launching TF2 through Steam and running `map my_map_name` works as intended.

    Screenshot at 2021-06-16 23-42-54.png
     
    • Like Like x 1
  8. Hurricane Pootis

    Hurricane Pootis L1: Registered

    Messages:
    6
    Positive Ratings:
    5
    A note abote DXVK: I remember DXVK working fine on stock hammer and that one custom version of hammer released before hamemr++ whose name I've forgotten.

    However, DXVK gave me microstutters on my system whenever running it with hammer++, so I wrote a simple bash script that will check your wine prefix to see if you have installed dxvk, and it will remove it during the duration hammer is running (this script is written assuming you installed dxvk with a system package using the setup_dxvk command).

    Code:
    #!/bin/bash
    #Created by HurricanePootis
    #=================================
    cd "$HOME/.wine/drive_c/windows/system32/" || exit
    
    if fd *9.dll.old 1> /dev/null
    then
    setup_dxvk uninstall > /dev/null #You need to replace the "setup_dxvk" with the/path/to/setup_dxvk if you don't have setup_dxvk in your /usr/bin or /usr/local/bin
    else
    echo bruh > /dev/null
    fi
    #=================================
    #This section is to check if I am using DXVK, and if I am, to remove it; hammer++ doesn't work with DXVK
    
    cd </path/to/your/steam/library>/steamapps/common/Team\ Fortress\ 2/bin || exit
    wine hammerplusplus.exe
    wait
    setup_dxvk install > /dev/null #You need to replace the "setup_dxvk" with the/path/to/setup_dxvk if you don't have setup_dxvk in your /usr/bin or /usr/local/bin
    #This reinstalls dxvk
    
     
    • Like Like x 1
  9. Kube

    aa Kube Stale air

    Messages:
    1,317
    Positive Ratings:
    1,776
    For folks who stumble upon this guide, looking to install Portal 2's Hammer Editor on Linux:

    1. Install the Portal 2 Authoring Tools from Steam.

    2. Right-click Portal 2 Authoring Tools > Properties > General > Launch Options. Set to PROTON_USE_WINED3D=1 %command%

    3. Portal 2 Authoring Tools > Properties > Compatibility > Force the use of a specific Steam Play compatibility tool > Proton Experimental

    4. Portal 2 > Properties > Compatibility > Force the use of a specific Steam Play compatibility tool > Proton Experimental

    5. Launch Portal 2 Authoring Tools

    Pro-tip: If you system automatically maximizes new windows, disable that functionality for WM_CLASS(STRING) steam_app_629
     
    • Thanks Thanks x 1