Overview
This guide is here to explain a solution I found to repair broken link beween Portal 2 and the workshop.
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 [link] , 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 steamappscommonPortal 2portal2puzzles<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 ^^