Skip to content

Instantly share code, notes, and snippets.

@BadgerCode
Created July 16, 2020 18:49
Show Gist options
  • Save BadgerCode/356c74bf8932e53853378052d3a0be38 to your computer and use it in GitHub Desktop.
Save BadgerCode/356c74bf8932e53853378052d3a0be38 to your computer and use it in GitHub Desktop.
Replace materials within a compiled map

This is useful for replacing questionable materials within old maps.

Steps

  1. Get the map's .bsp (e.g. extract workshop addon)
  2. Get these programs
    1. Get https://developer.valvesoftware.com/wiki/GCFScape
    2. Get https://developer.valvesoftware.com/wiki/VTFEdit
      • Associate .vtf files with this program
    3. Get https://developer.valvesoftware.com/wiki/VIDE
  3. Open the map's .bsp file in GCFScape and find the materials you wish to replace
    • An easy way to do this is to extract the map's materials folder
    • You can then either open up .vtf files individually in VTF Edit to see what they look like
    • Or copy the files into your gmod folder/addon folder and browse the materials in sandbox
  4. Make a replacement for the vtf
    1. Create a PNG/JPEG with the same dimensions
    2. Import it into VTFEdit (with the same dimensions as the original material)
    3. Save the file with the exact same name as the material file you are replacing
  5. Replace the material in the map
    1. Open VIDE and select "Pakfile lump editor" (last icon on the right, looks like a map and a pencil)
    2. Open the map's .bsp file
    3. Click "Add" under Pakfile options
    4. Select your material
    5. Click OK (do not click anything else in this menu)
    6. Set the path to be /materials/whatever-the-original-path-was
      • E.g. if the original material is /materials/ttt_coolmap/questionable_material.vtf, then set this to /materials/ttt_coolmap
    7. Click ok & click "Yes" to overwrite
    8. Click "Save" under BSP options
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment