Portal 2

Portal 2

107 ratings
[HAMMER] Installing Hammer++ v8864 for Portal 2
By Hazel Rose
This guide is outdated! Hammer++ now has an official Portal 2 build!

Everyone is wanting Hammer++, but for use in Portal 2. And because of how unclear the installation process for H++ for P2 is, people might be confused and think they have to purchase Prime for $15 for the SDK. You don't need to buy it, (it's not worth it) it's not necessary. This guide goes over the installation of H++, for P2.
2
4
3
2
   
Award
Favorite
Favorited
Unfavorite
The Introduction
This guide is now outdated! Hammer++ now has an official Portal 2 build, head over to the Hammer++ site to get it!

A better guide on the Valve Developer Community can be found here: https://developer.valvesoftware.com/wiki/Installing_Hammer%2B%2B_for_Portal_2

Build 8867+ Update
Hammer++ is now on build number 8867, and therefore this method will NO LONGER work for CSGO unless you decide to stick with build number 8864. Therefore, I have made a NEW guide for getting Hammer++ build 8867 and beyond for GarrysMod for Portal 2!

CS2 Update
As many are aware, the CS2 update completely wipes out CSGO. So, what is the solution? Well, you can do either of the following:

For those who DO play CS2
1. Do not update the game yet, if possible. If the game had auto-updated, follow the steps in the next section, then continue following these.
2. Rename the CSGO folder in `steamapps/common` to something different, such as "CSGO OLD". This will kinda trick Steam into thinking CSGO isnt properly installed, but also allows the game files (namely "gameinfo.txt") to interact with Steam files.
3. Install CS2

For those who DO NOT play CS2
1. Find CSGO/CS2 in your Library
2. Go to "Properties", then go to the "Betas" tab
3. Change the drop down to "csgo_legacy"
4. If the game did update, then itll reinstall the old files.

Hammer++ Update
Ficool announced in a Discord server (i sadly don't remember which one) that Portal 2 will be getting a proper Portal 2 build. If that does come into fruition, then this guide will be entirely useless, which is AWESOME. That would mean no more janky solutions, no more confusion, and more importantly, no more keeping 30+GB of files that you'll never touch! So thank you, Ficool, if this does happen. H++ is such an awesome tool, and having an official Portal 2 version would be a life saver for a lot of folks. Anyway, on to the rest of the (hopefully) soon to be outdated guide:

Before I even start, I want to give Mystical Ace a huge thank you for being (as far as I know,) the first person to discover how to get Hammer++ to work for Portal 2. If he didn't go through that pain himself, it probably would've taken much, much longer for us to learn how to get H++ working for P2. So again, huge thanks to him! Also, he is an awesome mapper, so definitely check out his Workshop!

For those unaware (for some reason), Hammer++ is a HUGE Hammer upgrade; more stability, rope physics, prop physics for placements, lighting preview, better color selection, and many, many more quality of life improvements to the editor regarding usability. So big thanks to Ficool2, the developer, for making this tool!

Now, this guide will be going over the installation of H++ for P2's Hammer; this is not a guide on how to use H++. Any of those questions can be left to TopHattWaffle, who's made a pretty good video on the usage of H++. He's also the main guy for Hammer tutorials, so if you need help with something regarding Hammer, he has hundreds of videos. Eventually I will be making a video version of this guide, but I wanted to get this out as quick as I could.

Bonus: You do not need CSGO's Prime thing! You do not need to pay $15USD for CSGO's SDK, as this guide will explain how to get this working with Portal 2's SDK. So, without further ado, here it is.
The Assets
"Where can I get Hammer++?" you may be asking. Simple; from the official website[ficool2.github.io].

Now, this method uses the Link Shell Extension[schinagl.priv.at], which makes the creation of symbolic links super easy. If you don't want to install it, you can follow this tutorial using the Command Prompt[www.howtogeek.com]. Note though, that the Command Prompt method is slightly slower.

If you're having issues with this, you CAN technically copy and paste files, but I don't recommend it, especially if you're like me and have several gigs of custom files.
The Configuration
So, you've downloaded Hammer++, and have installed Link Shell Extension. What next?

Well, you'll want to extract the Hammer++ files from the .zip folder and put them into CSGO. So in the opened .zip folder, open the bin folder and select the "hammerplusplus" folder and "hammerplusplus.exe" file, and drop them into "Counter-Strike Global Offensive\bin", as show below:


Cool! With that done, run "hammerplusplus.exe". You'll get a popup that looks like this:


Click "No", then copy the contents of the screenshot below into your Game Configs panel:


If you're having issues, look up the VDC page for creating Hammer Game Configurations.

Once that's done, click okay. You'll get two popups afterwards telling you something about certain settings not applying till H++ restarts. Click "Ok" on both of them; they don't matter. Then H++ will launch! Congrats! You're halfway done!


For actually exporting the map, go to Tools > Options > Build Programs, and point to Portal 2's VBSP, VVIS, and VRAD, as shown below:]

With that done, we need to set up the Map Compile thing. So, open up a random map. Don't worry about missing assets for right now, we'll go over that later. Go to the Expert mode, and click the dropdown menu that says "Fast", and select "Full Compile -final (slow!)". Then select "$game_exe", and replace the Parameters with "-dev -game $gamedir +map $file +sv_lan 1", with no quotation marks. It should now look like this:

Next up is lights.rad. As you know, Portal 2 has different texture lights than CSGO, and H++ looks for the assets relative to the CSGO directory. So, open up Portal 2's lights.rad file, found in "Portal 2\portal2", and CSGO's lights.rad, found in "Counter-Strike Global Offensive\csgo", in the text editor of your choice. You'll want to copy all of Portal 2's lights.rad file contents, and place it somewhere in CSGO's lights.rad file, without erasing what's currently in CSGO's lights.rad. I added mine here, and commented them to separate them from CSGO's textures:


We do this so that way Portal 2's texture lights work in H++'s Lighting Preview. That's basically it.

HammerAddons Configs
That's it! However, if you have HammerAddons installed, or wish to do so, there's a bit more left to do. Obviously if you haven't already, install the latest version of HammerAddons[github.com] as per its instructions. Do everything. Even the stuff for Portal 2's Hammer. Cool, with that done, go back to H++, and do the same thing you did for the post-compiler in H++, still pointing to the Portal 2 directories. Your Final Compile configuration should now look like this:


Aaaand that's it with configuring H++!
The Customs
Congratulations! You have everything up and running! Now you can open a custom map of yours and- uh oh. Damn, looks like a lot of your custom assets, some Hammer assets, and Puzzlemaker/CoOp assets, as well as some Hammer models such as the info_player_start, overlay, and sprite models, are just giant ERROR models. This is a simple fix, thankfully.

Customs in the Game Files
This method goes over when you have custom files in your game files.

This part is going to use the Link Shell Extension. For those using Command Prompt, I linked the guide on how to link folders via Command Prompt in "The Assets" section. I'm going over the usage of Link Shell Extension.

To begin with, navigate to "Portal 2\portal2\" and open your gameinfo.txt file, and add in your portal2_dlcx folders in it, as well as any custom folders, as show below:

The reason why we do this is because unlike Portal 2's engine, CSGO's engine, and in turn H++'s engine, doesn't know to recognize Portal 2's DLC folders. Because of this, H++ won't try to find DLC content such as PuzzleMaker and CoOp models. This means you need to define the DLC folders in there, as well as any other custom DLC folders you may have.

Now with your DLC and custom folders defined, go back to the main Portal 2 folder, and select all of your custom folders and DLC folders. The image below shows all of my custom folders (I'll explain "csgo_content" in a bit), as well as my DLC folders (dlc3 is for the building cubemaps error, which I will not go over), and the Platform folder:

Now you'll want to right click one of the selected folders, and select the "Choose Link Source" option from the drop down menu.

Navigate to "Counter-Strike Global Offensive\", and right click a blank space in there. Go to "Drop Link As...", and select the "Symbolic Link" option. Your CSGO folder should look something like this, of course with your own assets instead of mine:

Now you may be wondering about the "csgo_content" folder. Couldn't I just add "Game "csgo"" to my gameinfo? And yes, I could. But if you try to compile the map, Portal 2's compilers don't have the permissions to access CSGO's .vpk files, and there's nothing you can do. Your best bet is to open the .vpk, and extract the models, textures, and maybe even sounds and particles, from the .vpk and put them in a custom folder (it'll take a while to extract). This allows you to use CSGO assets in P2 properly.

Customs Outside of the Game Files
For when you have your custom assets outside of the game files, such as in your downloads folder or on your desktop.

For this part, we don't exactly need the Link Shell Extension, though I recommend following the part above for the DLC folders. Thank you to NotASpookySkeleton for pointing out that this is possible.

Basically you'll want to have a folder somewhere outside of your game files that have your custom assets. In this case, on the Desktop. In order to use assets outside of the game files, you just need to define the full path to it in the gameinfo.txt file, as shown below:

Hammer Models and Materials
Now if you launch H++, you may notice that your info_player_start and your overlay models are giant ERROR models. There's a final step for that. You'll want to delete the "Materials" folder in CSGO's platform folder. Don't worry, the only thing in there is a text file that's completely commented out. Now you can do either the symlink method or the copy/paste method, but in Portal 2's platform folder, you'll wanna select the models and materials folders, and pick the link source/copy them, and drop as symbolic link/paste in CSGO's platform folder, as shown below:

So yeah, there's that method. This method is definitely better if you need to reinstall Portal 2 for whatever reason, be it file corruption or whatever else. I might actually move my files to my downloads folder....

Nerdy Explanation of the Above Process
You may have also noticed the little "shortcut" symbol that's on the DLC folders in the CSGO files. You may also be wondering what a symbolic link is. The Command Prompt explanation also explains what symlinks are, so I definitely recommend checking it out. But to put it simply, symlink folders are basically shortcuts, but any program that opens it will open the linked files as if it were in the new location, even though they are technically back in the original location. In this instance, we are tricking H++ into thinking the custom assets are in, say, "Counter-Strike Global Offensive\custom_content\", when in reality the files originate from "Portal 2\custom_content". This makes copying assets to H++ so much quicker, and saves you maybe an hour or two of time waiting for the files to copy over. It also simplifies the process of adding custom assets; you now only need to place the custom assets in the Portal 2 files, instead of both Portal 2 and CSGO files. Plus, saves on storage space on your computer.
The Finale
Congratulations! You have hopefully successfully installed Hammer++ for Portal 2!

Once again, huge thanks to Mystical Ace (profile linked in The Introduction) for discovering how to install H++ for P2. As said, if he hadn't, it would've probably taken weeks more time to figure it out. Go check out his profile and his Workshop; he's got some amazing maps in there.

Once again, a huge thanks to Ficool2 for making H++!

Have fun!
162 Comments
Hazel Rose  [author] Aug 1 @ 9:37am 
Please use the official Portal 2 build; this guide has been outdated for a long while
Thorns Aug 1 @ 3:14am 
In hammer++ my entity like "info_player_start"still show error in the editor.I finish the step:SearchPaths
{
Game |gameinfo_path|.
Game "portal2_dlc1"
Game "portal2_dlc2"
Game Hammer
Game "platform"
}
but it doesnt work:sad_seagull:
frxyja Nov 18, 2024 @ 11:23am 
As of yesterday Portal 2 is now officially supported: https://ficool2.github.io/HammerPlusPlus-Website/index.html
A true Scrap Mechanic Oct 9, 2024 @ 9:06am 
i know
i used the gmod version
Hazel Rose  [author] Oct 8, 2024 @ 8:34pm 
this version is outdated
A true Scrap Mechanic Oct 3, 2024 @ 6:23pm 
now what
A true Scrap Mechanic Oct 3, 2024 @ 6:23pm 
i did all of the things
A true Scrap Mechanic Oct 3, 2024 @ 6:23pm 
help me
MarkBV Aug 2, 2024 @ 2:59pm 
Would you mind helping me out? I have this issue in Hammer that nobody has been able to help me with yet, and I can't make maps until it's resolved. I'm asking around, but so far nobody has been able to figure it out.
Λvery Jun 30, 2024 @ 12:24am 
Because no one has taken the time to make them. Mainly because Ficool himself said an official Portal 2 version is on its way, so most of us are just waiting for that.