Portal 2

Portal 2

Not enough ratings
How to publish a hammer map
By Wizzator
I had problems the first time I tried, but this guide will help you to publish a hammer map.
   
Award
Favorite
Favorited
Unfavorite
Publishing a Map to Workshop
WARNING: This Guide I made is outdated; I have learned more
I made this guide when I was quite new to hammer. Some of the stuff here is wrong. Please check out the new guide at this link: https://steamcommunity.com/sharedfiles/filedetails/?id=3160547993

BEFORE PUBLISHING
The name of the .vmf and .bsp files need to have no special characters including underscores. (i.e. anything that isn't a letter or number.) If it does, you will need to rename the file(s) or the map will fail to publish!

Step 1 - Adding Instances
You will need to add a very important func_instance. Set its "VMF Filename" to instances/p2_editor/global_pti_ents.vmf (or do so by finding the file with the "Browse" button. This is what allows the game to end with the box that lets you like or dislike the map and lets it be a workshop map. If you do not want Cave Johnson to ramble on at the beginning, set "$disable_pti_audio" to 1.

Step 2 - Connect
If you do not have an ending elevator, you will need some sort of input, but first, you need to name the func_instance. In this case, I am going to name it "transition_ents". You can name it whatever you want, though. Your input can be anything. Inside you will need to put:
  • On my output named "[OUTPUT]" - Put the output that fits. e.g. OnTrigger, OnPressed etc.
  • Target entities named "transition_ents" - Put the name of the func_instance
  • Via this input "instance:@relay_pti_level_end:Trigger"
Note: The input will show up as red. This is fine, it is actually correct.
Note: If you want / already have an elevator, ignore this step.

Step 3 - Compile
This step updates all of the necessary files that are part of the map. Press F9 or "Run Map" at the top. (The button that looks a bit like a fidget spinner). Check "Don't run the game after compiling" to avoid Portal 2 from opening. (If you do want it to open, you don't need to check it.)

Step 4 - Publish
In the file explorer, go to "C:\Program Files (x86)\Steam\steamapps\common\Portal 2\bin". Sort it by file type (to make it easier) and find the "p2map_publish" application. Choose a picture from a file on your computer, a title and description then choose the hammer map to publish. (You can find it at "C:\Program Files (x86)\Steam\steamapps\common\Portal 2\sdk_content\maps") Check the agreement and Publish.

Step 5 - Possible Step
I experienced a bug when uploading my map. To check that it worked, look your workshop page and find the map you just uploaded. Click on it and there may be a red box at the top saying you need to agree to the workshop agreement. Click on it and press "Accept".

CONGRATULATIONS! YOU PUBLISHED A HAMMER MAP!

If you are unsure about any of the guide above, please let me know in the comments! Thank you.
Adding an Opening/Ending Elevator
This part of the guide is optional. If you want an elevator, ignore step 2 of the publishing instructions. If you already have an elevator or do not want an elevator, this part is unnecessary.

Now, on with the guide.

Opening Elevator
Adding elevators is very easy.
  1. Add a func_instance.
  2. Double-click and set "VMF Filename" to "instances/turbine_elevator/arrival_elevator_a4_base.vmf"
  3. Drag while holding [SHIFT] in a small circle and then to the very same spot.
  4. Let go of click then let go of [SHIFT]. (Steps 3 & 4 copies the instance.)
  5. Double-click on one of them and set "VMF Filename" to "instances/turbine_elevator/arrival_elevator_a4_logic.vmf".
That's it.

Ending Elevator
Adding an ending elevator is exactly the same, except put "departure" where it says "arrival" in the "VMF Filename".

After Adding
You only need to do this ONCE, whether or not you added both sets or not.
  1. Add another func_instance.
  2. Set "VMF Filename" to "instances/transitions/arrival_departure_transition_ents.vmf".
It's simple, but critical. If you don't do this, you won't spawn in the elevator or properly end in the elevator!

Remember, adding elevators is optional.
2 Comments
Wizzator  [author] Jun 23, 2024 @ 1:21am 
Your're right! Thank you for pointing that out! :steamhappy: :steamthumbsup:
gazeX radio Jun 17, 2024 @ 12:07pm 
Hey, the VMF filename was spelt wrong. Instead of instances/p2_editor/global_pti_ents.vmf it's instances/p2editor/global_pti_ents.vmf (no underscores in p2editor). At least for me this was the case.