Portal 2

Portal 2

64 ratings
How to : Fix broken links between Portal 2 and the workshop
By Geneosis
This guide is here to explain a solution I found to repair broken link beween Portal 2 and the workshop.
   
Award
Favorite
Favorited
Unfavorite
What is a broken link?
First of all, what do I call a broken link?
This is what could happen when you try to update a map you already published in the workshop. Sometimes, the publishing tool integrated in the map editor will fail to find your old map (no idea why) and instead of updating the existing page of the workshop, it will create a new workshop page for the map.
So your map will be duplicated in your workshop, and this can be a real problem if you had for exemple a lots of ratings and comments on the original map, because the newly created workshop page have no comments and no rating at all, as if it was a new map.
Easy fix (by Bisqwit)
Here is an easy way to fix the problem by replacing a line in the file reprensenting your map on your computer.

Check your published map in steam (that you _want_ to publish into), and pay attention to the fileid. E.g. for http://steamproxy.net/sharedfiles/filedetails/?id=154999399 , the ID is 154999399.
Take a calculator and convert this number into hexadecimal. E.g. 154999399 is 93D1A67 in hex, or 0x93D1A67.
Now find your puzzle's p2c file on the disk. The easiest way to do it is to open the puzzle in puzzlemaker, save it, close portal 2, and go to steamapps\common\Portal 2\portal2\puzzles\<numbersequence> (This numbersequence is unique to you, and there's just one directory so just go there). Sort the files by date, and edit the newest .p2c file in e.g. notepad. Find a line that near the top that has "FileID" on it. It looks like this: "FileID" "0x0000000001234567"
Replace the hexadecimal number on that line with your intended map, for example "0x93D1A67", and save the file, replacing the old p2c file. The leading zeros after "0x" are not important.
Now, when you open the map in Portal 2, and publish, it will update the intended map rather than the accidentally created clone. Done!

If this solution worked correctly, you can skip all the next steps. If something went wrong or if it didn't work, you can try the other method I found and explained after that ;)
What do you need to fix it? (by Geneosis)
I found a way to solve this problem, so that your old workshop page will be updated insted of creating a new one. This solution is not easy to unserstand if you don't know a bit how computer works but I will try to make it understandable for anyone anyway.

This solution involves an external program I know and I use on Windows, sorry for Mac and Linux users but I have no idea if this can work on other systems.

First, you need to download and install a program called Cheat Engine.
WARNING : This program may be considered as a malware by your antivirus because it allow you to edit in real time the memory of any program running on your computer. So you should be aware that Cheat Engine could damage your system if you use it the wrong way. Anyway if you follow correctly the steps of this tutorial, there will be no problem.
NOTE : You will probably have to add Cheat Engine in the whitelist of your antivirus if you dont want it to be deleted, this is not part of this tutorial, ask someone in your family or some freind if you don't know how to do that.
Download page here.[www.cheatengine.org]

When the installation is completed, you can go to the next step.
Step 1 : Publishing the broken map
NOTE : You can click on the images to see them in full size

Now you should start Portal 2, edit the map with a broken link with the map editor, try to publish it again and stop when you are on this screen :



Here use Shift+Tab to open steam menu and go to your workshop, if you got the broken link problem, this is how it should looks like now :

There is two versions of the same map and what you want is to update the old map (on the right) and remove the useless new map (on the left).

Now you should open the workshop page of the new map (the map you want to remove), and copy the number at the end of the URL of the page (highlighted on the screenshot).

Then you have to go back to your desktop without closing the game, for that you can use Alt+Tab keys or the Windows key.
Step 2 : Finding the wrong map ID
Now we will look into the program memory and replace the wrong workshop map id by the good one.

When you are on your desktop, you should start Cheat Engine. On the main window of the program, click on the little blinking computer button at top left to open the process list. In the list select [some numbers]-portal2.exe and click Open.


Then paste the number you copied earlier in the field Value and click on the First Scan button. If everything worked correctly, at least 3 results with the value you asked should apear in the list at the left (I got 10 on the screenshot). If the value of any result change after a few seconds, click on the Next Scan button to remove it from the list.


When no values are changing, double-click on every item in the result list to add them in the bottom list :
Step 3 : Replacing the wrong map ID
Now we will take the correct map id (the one of the old map) and replace all the wrong ids in the program by the good one.

For that you should go back into the game, go on the workshop page of the old map, and copy the id number at the end of the URL exactly as you did in Step 1. When you have it come back to Cheat Engine, check all the boxes at the left of the bottom list (to prevent the program to change the values while you're trying to fix them). And then double-click on each id in the list (this will open a little windows to edit the value) and replace them by the one you just copied.


After replacing all the values, return in the game and click on the button to publish the map.
If everything worked correctly, your old map have been updated, all you need to do now is to remove the useless map present in your workshop. For that go on the workshop page of the new map (the one with no rating and no comments) and use the delete link in the menu on the right.
Conclusion
When your map link is correctly fixed, you can come back one last time to your desktop and close Cheat Engine, to be sure it wont affect the game by mistake.

I hope this will help some people unable to update their maps properly ;)

If you enconter any problem with this method or have any question about it, feel free to ask in the comments ^^
42 Comments
Clumaex 23 Dec, 2020 @ 5:54am 
Awesome, it worked!
Geneosis  [author] 28 Apr, 2020 @ 9:43am 
@Dark Rozen: If you are talking about the first method, then yes you need to save the file after changing the value in it.
Dark Rozen 28 Apr, 2020 @ 8:16am 
Do I have to save it after?
Geneosis  [author] 17 Mar, 2018 @ 5:50am 
@YUKI_67: You might be able to use this tutorial to overlap the workshop version with the rebuilt version, but I'm not sure if it would actually work...
YUKI_67 16 Mar, 2018 @ 3:42pm 
And if I rebuild them, there is no way to update them without losing all statistics and commentary ? :S
Geneosis  [author] 16 Mar, 2018 @ 10:57am 
@YUKI_67: Sadly I don't think so :/ I also lost some of the original files of my maps after changing computer, and I simply can't update them any more... Unless I rebuild them from scratch XD
YUKI_67 13 Mar, 2018 @ 10:55pm 
Hi Geneosis, long ago I erased all my data portal 2. and I wonder if it is possible to update my 1st maps published ? (knowing that I have more neither the p2c nor bsp)
Swedish Firefighter 8 Aug, 2017 @ 11:01am 
Yes, the second map apered in workshop after i'm publish the chamber, but not the way you describe it in your guide.
It does not appear until it's to late to do something about it.
I wrote my comment as this guide is old and there have been several updates. Therefore, your description is no longer correct as I can see it.
only to help other.
Geneosis  [author] 7 Aug, 2017 @ 12:19pm 
@Swedish Firefighter: Well, if you detect that the link is broken before actually updating your map then yes ^^ But in my case it's the fact that a second map appeared on the workshop after an update that was the symptom of the broken link problem... So I had both maps on the workshop and I were able to compare the IDs this way, but using the autosave file might be a correct method as well :)
Swedish Firefighter 6 Aug, 2017 @ 1:30pm 
The guide is wrong in part 1.

There will not be a new testchamber in your workshop until you publish.
I found the wrong ID in autosave.p2c file:
Steamapps \ common \ Portal 2 \ portal2 \ puzzles \ <numbersequence> autosave.p2c
Compare this ID with the correct file from your workshop.
After that the guide works.