Please or Register to create posts and topics.

Portal 2 having trouble loading custom materials and sounds

So, I've recently retaken Hammer mapping, something I left a while ago due to lazyness and lack of time, this time by editing a couple pre-made PeTi maps.

Things have being going swell, but I just decided to place a couple custom .vtfs and .wavs in my map.

Hammer is loading the files fine, but once I run the map in Portal 2 these resources do not load, and it gives me a "file is missing from disk/respository" error in console.

I'm perfectly sure the files are in the right directory, and Hammer isn't giving compile errors. What could be causing this and what do I do to solve it?

Hey Pearity,
welcome to twp!

Anyways, on topic: usually paths to files are relative, so if your map is in steam/steamapp/common/portal 2/portal2/maps/ and your song is in steam/steamapps/common/portal 2/portal2/sound/myawesomesong/ hammer tells portal to search for your wav in ../sound/myawesomesong/

The full path is often a bad idea. I believe that portal also doesn't like sounds that are not in the steam/steamapps/ folder or any subfolder are. So if you're adding a song from "My Documents" it will probably bug.

Once the paths are right it should work on your machine because the game can find and use your files. As soon as you want to distribute your map you'll need a program like pakrat to add those files INTO your bsp. This way everyone that downloads your map will also be able to hear and see your custom stuff!

What LPFreaky said, however in order to play custom sounds in the hammer editor without putting it in your .bsp needs you to run the snd_rebuildaudiocache console command. It should not give that error after you run that command.

VTF's are easier to implement though. I use the .vtf plugin for photoshop and/or vtfedit to convert my images.

?????????????????????????????TWP Releases | My Workshop

Ah, apparently I had a mixed-up pathname for the .vtf in the .vmt, and as for audio, snd_rebuildaudiocache worked just fine. Can't believe I forgot all bout it.

Thanks!
I hope to say in TWP for future mapping help, I'm still stumbling my way back to Hammer.