This project is in an unknown state of working. I haven't touched it in nearly two years at this point.
This program is built around taking exported textures from the .WAD files in Half-Life's \valve\ folder and .VPK files in Half-Life 2's \hl2\ folder, and replacing them with a texture of the same size styled after the magenta and black checkerboarded placeholder texture commonly used by software.
To use the program, you put the executable file in the same directory as the .BMP images from the WAD3 file, and a list.txt containing the names of each image separated by newlines (I used Half-Life Texture Tools to get these). You must also create a subdirectory called new. This is what your directory should look like, pictured with spraypaint.wad:
Once your directory is set up, run the program. The new folder will be filled with the modified images. Take these and compile them into a .WAD file once again. I did this using HLTT once again, but I believe the Half-Life SDK has a tool for this.
You'll need 4 programs.
- GCFScape
- vtex2
- VTFEdit/VTFEdit Reloaded
- HL2TextureStyler, either compiled by you or from the releases tab.
- Open
Half-Life 2\hl2\hl2_textures_dir.vpkin GCFScape and expand the root folder. Right click and extract materials to an empty directory. - Open that directory in command prompt and input the following:
vtex2 extract -f bmp -r .\materials\. Make sure vtex2 is in the same folder as your materials folder or in a PATH environment variable folder. Keep that command window open. - Go into the materials folder and run this command in command prompt:
del /F /S /Q *.v??, then rundir /B /S /A:-D > list.txt. One more time, keep cmd open. - Move list.txt into the same folder as HL2TS. Make sure the entry for list.txt is the first entry in the file.
- Copy the
materialsfolder somewhere else, rename itmaterials_new, and move it into the same directory as the original materials folder - Navigate to
materials_newwith CMD and rundel /F /S /Q *.bmp, then run HL2TS. - If
materials_newis filled with blocky textures, then open VTFEdit and go to Tools > Convert Folder. Set your input folder asmaterials_newand your output folder as whatever you want. Select "To VTF" and change the text in the box to be *.bmp. Check Recursive, uncheck Create VMT Files. Click Options and go to Advanced, then set the version to 7.1. Hit Convert. The program is likely to freeze, just give it some time. - Go into your Half-Life 2 files and open the folder
\hl2\. Create a new folder calledcustomand put your output folder in there. The folder layout should beHalf-Life 2\hl2\custom\<your folder name>\materials\
You should now have modified textures.
