Recently I posted a huge (2526 replays) replay pack for which I had all the chat stripped out for privacy reasons. A few people asked me how it was possible, so I'm going to write a quick guide to show you how it's done. Although it's designed for multiple replays it can easily be used for singular replays if you wish.
Overview and Preparation
Basically a .SC2Replay is a MPQ file. This means we can use Ladik's MPQ editor to manipulate files within the replay. Each replay has a file called 'replay.message.events', this contains all the chat data. We're going to create a new blank file, then replace the existing file with this newly created blank, effectively removing any chat from the replay.
To begin we want to copy all the relevant replays to a new folder, allowing us to work on something other than the originals in case something goes wrong. We'll need to type out the location of this folders so make sure you know the path to it.
Personally I used a folder in My Documents called Replays, so my path would be C:\Users\<Comptuer Name>\Documents\Replays
Also create a new blank text file in this directory. Rename this text file 'replay.message.events'. Ensure that you're overwriting the .txt format at the end, not ending up with replay.message.events.txt. You may need to turn on the option for "Show file extensions for known files" to do this.
Following this, copy and paste the MPQEditor.exe file into the replay folder also.
Step 1. Renaming Replays
This step isn't strictly necessary UNLESS you have Korean / Chinese / non-english characters in your replay names which will often occur if you're playing on the Korean server. To do this we can use SC2Gears.
1. Open SC2Gears
2. Double click on Auto-saved reps on the left hand side
3. Click on Search Source Tab near the top.
4. Remove any selected sources that are there.
5. Click on add folder.
6. Select your created folder (I.e. My Documents / Replays)
7. Click on List all replays of this source.
8. Once results are listed, select all files, right click, select rename replays.
Select something that won't involve forign characters. The actual names matter very little, as after this is completely we can repeat the process and rename them once more whatever we like. I personally just removed the names on the end (rename as '/T - /m'), but some people may still have foreign map names. Use game length, gateway, whatever.
Step 2. Getting file list
Now the file names have been renamed we need to obtain a raw listing of these file names in a text file. There could very well be a more direct method of doing this entire process, but I only spent an afternoon figuring it out so while this is a little convoluted, at least it works.
1. Start command prompt (Start, in search box type 'cmd', press enter)
2. Navigate to the folder where your replays are saved (cd C:\Users\Desktop\Documents\Replays in my case)
3. Type 'dir > list.txt'
4. This creates a text file called list.txt inside your replay directory listing every file you have in there (along with other information).
Step 3. Making the script
Great, now we have a file list (kind of) we need to shorten it down. This is where excel comes in.
1. Open Excel and cut and paste the information from list.txt into it. I'm assuming you pasted in Cell A1.
2. Remove any extra information above and below the replay files, such as text like "Directory of c:\Users\Desktop\Documents", "20 File(s) 100,539,301 bytes", etc.
At this stage we should simply have a long list of files with dates, times, file sizes and the names.
3. Use the text to column feature in excel to break out the file name into it's own column. In 2010 this is located under the data tab. To do this....
a) Select all of column A by clicking on A up the top.
b) Click on the Text to Columns button
c) Select fixed width to break it down
d) Click next
e) A series of black lines will demonstrate what will be individual columns, it doesn't really matter but ensure that the replay names are all in an unbroken column by dragging any black lines that would have been separating them to the right hand side
f) Click next to separate
4. Highlight any columns that have irrelevant information (anything not the file names) and delete them. All going well you should have a long list of file names of all your replays on their own in text format with each replay being a different line, YAY!
5. Select all your replays and copy paste it in the same column 4 times. I.e. if originally all your replays were lines 1-400, you should now have the same list in 401 - 800, 801 - 1200, 1201 - 1600.
6. Click on sort so now you'll have 4 of the same file name for every replay all together. Cut and paste this list into column C (so I can provide a formula for something later). We're now going to create the necessary instructions for the script for the MPQ editor.
7. In A1 type o, A2 type d, A3 type a, A4 type c. Now select the 4 cells and double click on the bottom right corner to fill down the same pattern all the way to the end.
8. In cell B1 type ", select the column to fill all the way down.
9. In cell D1 type ", select the column to fill all the way down.
8. In cell E2 type replay.message.events, in E3 type replay.message.events. Select E1, E2, E3 and E4 and click on the bottom right hand corner to fill down. The inclusion of these blanks is deliberate so the replay.message.events only occurs on lines with either a 'd' or an 'a' in column A.
9. In cell F3 type replay.message.events. Select F1, F2, F3, F4 and click on the bottom right hand corner to fill down.
10. In G1 paste the formula =CONCATENATE(A1, " ",B1,C1,D1," ",E1," ",F1) and fill this formula all the way down.
11. Select the resulting text that's created in the G column, copy and right click on a different column (say J for example) select paste special, then select values.
Finally we're done! This has created a script command for the MPQ editor for every replay you have. It may seem very convoluted if you're doing 1, however if you're doing 2000 replays this saves so much time, and it's much quicker than it appears once you know what you're doing. To confirm, you should have something like this for each replay.
o "ReplayName.SC2Replay"
d "ReplayName.SC2Replay" replay.message.events
a "ReplayName.SC2Replay" replay.message.events replay.message.events
c "ReplayName.SC2Replay"
for every replay that you have.
Step 4. Executing the script
Once more we are going to go back to the command prompt. To confirm the preperation once more, we need to have the MPQEditor.exe file, a blank replay.message.events file and all of our replays that we wish to edit in the folder.
1. Create a new text file and call it script.txt
2. Copy and paste all of the text commands we created in excel into script.txt (This should be from column J, or wherever you did the paste special > vaules).
3. Save the file and close.
4. In command prompt once more navigate to the folder we're working in (C:\Users\<Computer name>\Documents\Replay)
4. Type MPQEditor.exe /console script.txt
All going well, we're done!
This should have opened each replay, deleted the chat from it, replaced it with a blank file then closed the file once we were done working with it. To confirm this has worked close any command windows you have open, double click on MPQEditor.exe to open the GUI. Select any replay file at random to examine the files in it. The replay should have a replay.message.events file of 0 bytes, and also have a date of modification next to it.
Even the smallest donations help keep sc2sea running! All donations go towards helping our site run including our monthly server hosting fees and sc2sea sponsored community tournaments we host. Find out more here.