
Note: This tutioral is no longer needed, a Beta of the Portal 2 sdk is now on steam.
If you are like me then you will want a bit of an edge over the competion, its time we showed the guys at Black Mesa a thing or two about banging rocks. Can't wait for the offical mod sdk? Well we have you covered.
What you need:
- Portal 2, well sorta obvious but you never know.
- Alien swarm, its free so....
Step 1 (Setting up the Alien Swarm sdk for Portal 2):
We will use the Alien Swarm sdk because it is the most recent version of the source engine (bar Portal 2) and it can load Portal 2 models and textures.
Note: Click the images for a larger version.
Go to the tools tab in steam and launch the Alien Swarm Authoring tools.
Open the the edit game configurations option.

Then go to add and then enter "Portal 2" as the name and the browse to your Portal 2 folder.
See the image below for an example for what the path should look like.

Ok so thats the Authoring tools set up, next we have to edit the portal 2 gameinfo.txt file to tell it to look in the platform folder for the editior resources. If you didnt add this Hammer would moan about missing files, the 3d veiw wouldnt work and the 2d veiws would be trippy. (try it if you must :P)
Go to your portal 2 folder inside the portal2 folder and open the gameinfo.txt text file.
e.g. "C:\Program Files\Steam\steamapps\common\portal 2\portal2"
Scroll down to the bottom and look for "SearchPaths" and change it to look like this
{
Game |gameinfo_path|.
"Game" "platform"
}
Almost done, now we just have to set up the compile options and you can proced with the testing.
Compiling:
Ok, so launch the Alien Swarm Authoring tools again and select Portal 2 in the current game drop down box and now just launch Hammer.
When hammer loads you should see this in the messages box.
If you dont see the second line mentioning platform double check you gameinfo.txt file.
Thankfully the final hurdel is an easy one.
To get your map to compile you will need to use the expert compile option (f9, then Expert).
We need remove some of the options for the compile tools to avoid errors.

Change $bsp_exe to "-game $gamedir $path\$file".
If you left the -alldetail option you would get alot of compiler warnings.
Well Thats about all to it.
Notes: I found some textures will cause the map to have no lighing ingame (compilers report no errors), I have a feeling that Vavle added a new material property that the compilers are freaking out over.
You can use this map decompiler to get the entity names: Nuclearvelocity.com I used the stable version as the beta with portal 2 support didnt seem to work but the older one works just fine.
Happy moding :)
Ok things are now starting to take off.
There is an .fdg in the works that you can grab from this thread: Facepunch.com
Lets get started.
Were going to do maps ... even if you dont like it !
Let's have fun...with mapping!!
But why is it part of the Alien Swarm SDK? Why not normal Source SDK?
The Alien Swarm SDK is the most recent version of the sdk that we have acess to, so it gives the cloest set of tools next to the one vavle used internaly for Portal 2.
The Hammer version in the normal Source SDK doesnt suport loading files from the .vpk structre that Vavle now use, nor does it suport the new model format.
You can still compile maps with the Source SDK and have them run in portal 2 but you will missout on being able to see the textures and models, you could extract the textures and put them in a folder within the normal SDK but thats uneeded hassle and you wont get the benifate of the improve compile tools.
Valve has stated they will release a proper SDK at a later date, this is just a temporary solution someone discovered.
Well, soon a real P2 sdk is comming!
Get ready!
Yea, but Vavle unfortanly tend to have, em, timing issues. Developer.valvesoftware.com
They said they are to be made available after launch, but we dont know how long that could be.
No harm in having a leg up anyway :)
At least the offical one should have helpers in hammer for lining up the areial plates.
I hope the real SDK allows full blown mods.
if not, that's just sad. lose out on things like Blue Portals etc. porting to Portal 2 and taking advantage of the new engine, while adding their own definitive stamp onto the game.
still, looking forward to map again. it's going to be fun!
^This.
I think it would be cool to recreate portal 1 in portal 2 but add the new stuff in some how
I was thinking the same thing. It would be fun to try out Portal 1 using Portal 2 mechanics. Even maybe making some of the P1 maps co-op using different tactics.
(buried)
There would be no point doing that, really. And even if there was, it's too much work.
@Jeek I believe when you made your account you put an e instead of an r - Jerk. Respect other people's ideas.
Have the BMS team do that and it will be out in 2037
will custom maps work for coop mode?, if so that will be awsome
yes it do
When people make mods to Portal 2, are they gonna use this then?
Too glitchy. Waiting for the official release.
can you make maps for co op and even put them on a mod so people can play it online within your mod?
and are there prefabs for portal 2?
Yep you can make coop maps with this, you just need to use the coop spawn entitys.
To play a custom coop map with a freind you will have to send them the map and then invite them to play coop with you. When you are both in the hub, open the console and type changelevel yourmap and that should be it.
People were talking about this on the steam forum: Forums.steampowered.com
The FDG is located here: Facepunch.com
If this was stated before sorry =\... If not, enjoy mapping!
Some one else showed me a similair guide on the facepunch fourms, only real differnace between my metiod and theirs is that with mine you dont need to extract anything with gcfscape, Alien Swarms tools can read right out of the .vpks so there is no need. Handy if you cant spare space on your hard drive :)
Also added a link to the fdg in the guide, thanks.
Thanks for the guide, it was very helpful for me! :-)
I'm new to creating custom maps, and played around with Hammer a little, but when I tried to run the map, the following error occured: "Can't find background image 'materials/console/background_menu_widescreen.vtf'. However, when I start Portal 2 and run the map from the console, it works just fine.
What could I do to solve this system? Thanks in advance!
Are you useing the run game after compile option (the last option in the compile menu)?
I just have it disabled, have Portal2 running in bordeless windowed mode.
Then when I compile all I have to do is load the map in the console.
It's alot faster than startng the game each time I recompile.
I am already working on a Portal 2 mod, by making concept maps in Portal 1.
Thanks for your reply. I think I'm going to do it this way now. :-)
However, I have another problem with the editor. I configured the SDK as described in the tutorial, but the "weapon_portalgun" class does not show up in my entity list.
Maybe the name is different from Portal 1?
Okay, I solved the problem. I found out that if you type weapon_portalgun into the dropdown menu for the entity names, it will actually appear in the game, though it won't in the map editor.
Is anyone able to decompile a few portal 2 maps so i can look i can't seem to get the tool to work.
Thanks.
The beta version with suposted suport for Portal 2 maps doesnt work but the version just before it does. Dont fix whats not broken?
Anyway I uploaded the version that I have as I know it works Arkage.co.cc
That version don't work just flashs open then closes.
Odd, maybe try updateing your java?
The guide was great!
but I had 1 problem.
when I load the map using the map command in portal 2 it disconnects me from the server in single player and it doesn't load the map please help!
If you already have an offical map loaded and then try to load your map it will dissconnect you, just reenter the command and it will load it then.
Thanks a lot this really helped!:D
Afther editting the game configurations and the search path, when I try to switch "alien swarm" to "portal 2" it doesn't switch.
Close the Alien Swarm authoring tools and then reopen, now you should be able to see the portal 2 option.
I can see the option but when I click on it it doesn't switch to portal it stays on alien swarm.
That sounds really strange, have you tryied making a Alien Swarm mod jsut to see if it will appear in the list and be selectable?
I followed all the steps, but when I try to compile the map the compiler always crashes. What do I do?
Does it display anything in the output window or does it just close? If its out puts anything what does it say?
There aren't any entities in my Hammer. When I click to add an entity the drop boxes are empty. Also I don't have Orangebox or SourceSDK, just Alien Swarm and Portal 2. (if that makes a difference)
Can you check your gameconfiguration from inside hammer nad see if there are any .fdgs listed?
It says Portal2_omni.fdg is listed under game data files.
I noticed when I edit the portal2_omni.fdg that it says "@include "halflife2.fgd"" would I need to have HL2 for this to work? To my knowledge I don't have halflife2.fgd
I fixed it. I didn't have halflife2.fgd or the other FGD's, just the custom portal 2 one. After getting a zip with all the FGDs it is now showing me Entities and working as expected. Thanks for the help.
When I run my map it does alot of things in a command window but in the end it says "Empty map"
What can I do to fix this?
So far I only have a hollow cube with (I think) a spawnpoint in the middle (I don't really know how to spawn custom entities yet) and a block you can jump on. So it's defenitely not empty.
The Portal 2 SDK has just gone live on steam.
Not much seems to have changed :(
Wireframe is missing and textures only display debug textures.