I hate Soundscripts but I love them
Quote from Thornscrup on April 9, 2012, 2:37 pmHi.
I have problems using custom soundscripts in Hammer. I've been searching in several forums, wikis and blogs, found many answers but I'm still stuck. So here I am.Here's what I'd like to do: I've got custom voice sounds (.wav), and I need to create soundscripts because I want to add subtitles and I read you can't do that with simple Raws. Okay.
So I made my .txt file, put it and the all the raws in the correct folders, and I think I did that well. My problem is in the "game_sound_manifest" file. I read you have to add a precache command for Hammer to correctly load your script. I tried that, here's what happenned:
- when I use "precache_file" with my custom soundscript's name, Hammer doesn't detect the script (it's supposed to be in the "Game Sounds" section, right?).
- when I add the Raw directly in an existing soundscript (game_sounds.txt for example), it works just fine and I can load, play and use my file in Hammer.
Basically, in the second method, I don't edit the "game_sound_manifest" as I am told to, but a existing soundscript that is probably already used in the game. It works, but I'm afraid it could cause fatal errors and stuff. And it could be complicated to share my map with those modified soundscripts. Actually I tried that only for testing!
If you've got anything, or need more details, please tell me! I'm getting desperate.
![]()
EDIT: I tried to delete some lines in the game_sound_manifest file, and run Hammer. It doesn't seem to cause any bug, all soundscripts are working. So I'm a little confused: when do Hammer or Portal 2 execute the commands that are in the manifest file? How do I get them to do it?
Hi.
I have problems using custom soundscripts in Hammer. I've been searching in several forums, wikis and blogs, found many answers but I'm still stuck. So here I am.
Here's what I'd like to do: I've got custom voice sounds (.wav), and I need to create soundscripts because I want to add subtitles and I read you can't do that with simple Raws. Okay.
So I made my .txt file, put it and the all the raws in the correct folders, and I think I did that well. My problem is in the "game_sound_manifest" file. I read you have to add a precache command for Hammer to correctly load your script. I tried that, here's what happenned:
- when I use "precache_file" with my custom soundscript's name, Hammer doesn't detect the script (it's supposed to be in the "Game Sounds" section, right?).
- when I add the Raw directly in an existing soundscript (game_sounds.txt for example), it works just fine and I can load, play and use my file in Hammer.
Basically, in the second method, I don't edit the "game_sound_manifest" as I am told to, but a existing soundscript that is probably already used in the game. It works, but I'm afraid it could cause fatal errors and stuff. And it could be complicated to share my map with those modified soundscripts. Actually I tried that only for testing!
If you've got anything, or need more details, please tell me! I'm getting desperate.
EDIT: I tried to delete some lines in the game_sound_manifest file, and run Hammer. It doesn't seem to cause any bug, all soundscripts are working. So I'm a little confused: when do Hammer or Portal 2 execute the commands that are in the manifest file? How do I get them to do it?

Quote from ChickenMobile on April 10, 2012, 2:45 amI see a major flaw in your method! All the files in the portal2_dlc1/scripts folder will automatically override any in the portal2/scripts folder.
I know for sure that this could be your problem because I was adding soundscripts / scenes for my mod today and wondered why when I went into SourceSDK the soundscript appeared in faceposer but didn't in P2AT faceposer.
Also if your console is popping up that your sound is missing from the disk repository when you play your soundscript, you need to put in the console command: 'snd_rebuildaudiocache' / snd_buildsoundcachefordirectory [pathname].
I see a major flaw in your method! All the files in the portal2_dlc1/scripts folder will automatically override any in the portal2/scripts folder.
I know for sure that this could be your problem because I was adding soundscripts / scenes for my mod today and wondered why when I went into SourceSDK the soundscript appeared in faceposer but didn't in P2AT faceposer.
Also if your console is popping up that your sound is missing from the disk repository when you play your soundscript, you need to put in the console command: 'snd_rebuildaudiocache' / snd_buildsoundcachefordirectory [pathname].
Quote from Thornscrup on April 10, 2012, 6:36 amYeah! Thank you very much, you are totally right. I put the precache command in the dlc manifest and everything's fine. Hammer can read the script and the game play it as well.
If I may ask you one last question though, I'd like to know what I'll have to do when I want to share the map. Should I upload the manifest too? Or maybe just instructions to modify it? Or does the hammer compiler take care of all this?
I'm sorry to bother you with all the question marks. Thanks again for your quick and very helpful answer!
Yeah! Thank you very much, you are totally right. I put the precache command in the dlc manifest and everything's fine. Hammer can read the script and the game play it as well.
If I may ask you one last question though, I'd like to know what I'll have to do when I want to share the map. Should I upload the manifest too? Or maybe just instructions to modify it? Or does the hammer compiler take care of all this?
I'm sorry to bother you with all the question marks. Thanks again for your quick and very helpful answer!

Quote from ChickenMobile on April 10, 2012, 7:33 amIf you are just making a single release map or a small mappack I suggest you don't add soundscripts but show the subtitles with the custom sounds which are played from ambient_generics. (i.e. dont make any scene files. You cannot build scenes.image or portal will have a fit).
Follow this tutorial (which consequently I made)
Generally when it says it needs to be a name of a soundscript, its just a name so then it can be referenced when you want to display your subtitles.Make sure you look at the discussion tab to see an example.
I believe that using soundscripts makes you need to rebuild the sound cache but packing custom sounds in the bsp doesn't. Unless this was vpk's... can't remember...
If you are just making a single release map or a small mappack I suggest you don't add soundscripts but show the subtitles with the custom sounds which are played from ambient_generics. (i.e. dont make any scene files. You cannot build scenes.image or portal will have a fit).
Follow this tutorial (which consequently I made)
Generally when it says it needs to be a name of a soundscript, its just a name so then it can be referenced when you want to display your subtitles.
Make sure you look at the discussion tab to see an example.
I believe that using soundscripts makes you need to rebuild the sound cache but packing custom sounds in the bsp doesn't. Unless this was vpk's... can't remember...
Quote from Thornscrup on April 10, 2012, 9:46 amOkay, I'll try this way. Thanks for everything!
Okay, I'll try this way. Thanks for everything!
Quote from baca25 on April 29, 2012, 10:45 pmSo I wanted to add subtitles to my newest map. And I seen this. So... Where it says "Note: If the file refuses to compile because the Game Directory is different from the portal 2 folder, change it by making a duplicate entry in the gameinfo.txt with the paths leading to the Portal 2/portal2 directory. Then run SourceSDK with the custom parameters to make Portal 2 the active mod." I can't make sense out of that. I Dont know which gameinfo.txt file to edit, where to duplicate what, and where did running sourceSDK come from? So ya... That note has me confused. Attached is a picture of what my command console says.
So I wanted to add subtitles to my newest map. And I seen this. So... Where it says "Note: If the file refuses to compile because the Game Directory is different from the portal 2 folder, change it by making a duplicate entry in the gameinfo.txt with the paths leading to the Portal 2/portal2 directory. Then run SourceSDK with the custom parameters to make Portal 2 the active mod." I can't make sense out of that. I Dont know which gameinfo.txt file to edit, where to duplicate what, and where did running sourceSDK come from? So ya... That note has me confused. Attached is a picture of what my command console says.
Mapping Since May 21, 2011

Quote from ChickenMobile on April 30, 2012, 3:05 amI wrote that page so I know completely what it means (however I did a typo and meant GameConfig.txt not GameInfo.txt).
With SourceSDK: whenever you chooser a certain game in a version of source, it sets it as the active mod you are working on. (FacePoser etc.) Because Portal 2 is not automatically added into the SDK (it is in its own authoring tools) the directory is not set for certain SDK tools.
Go into Steam/steamapps/accountname/SourceSDK/bin/orangebox/bin (or ep1 if you dont have a orangebox) and open up a file called GameConfig.txt. Copy and paste another one of your games (it doesnt matter which) and change the "gameDir" value to the path of your Portal 2.
Here I just copied the config for Portal and changed the path of "GameDir"
- Code: Select all
"Portal 2"
{
"GameDir" "E:Program Files (x86)Steamsteamappscommonportal 2portal2"
"hammer"
{
"GameData0" "E:Program Files (x86)Steamsteamappsaccountname..."
...
"CordonTexture" "toolstoolsskybox"
"MaterialExcludeCount" "0"
}
}Your game should then be under one of the options in the sdk. Mine is located in Source Engine MP
gameconfig.jpgOnce you choose Portal 2 from the list, it should then make it the active mod, however also open up Hammer to make sure.
I wrote that page so I know completely what it means (however I did a typo and meant GameConfig.txt not GameInfo.txt).
With SourceSDK: whenever you chooser a certain game in a version of source, it sets it as the active mod you are working on. (FacePoser etc.) Because Portal 2 is not automatically added into the SDK (it is in its own authoring tools) the directory is not set for certain SDK tools.
Go into Steam/steamapps/accountname/SourceSDK/bin/orangebox/bin (or ep1 if you dont have a orangebox) and open up a file called GameConfig.txt. Copy and paste another one of your games (it doesnt matter which) and change the "gameDir" value to the path of your Portal 2.
Here I just copied the config for Portal and changed the path of "GameDir"
- Code: Select all
"Portal 2"
{
"GameDir" "E:Program Files (x86)Steamsteamappscommonportal 2portal2"
"hammer"
{
"GameData0" "E:Program Files (x86)Steamsteamappsaccountname..."
...
"CordonTexture" "toolstoolsskybox"
"MaterialExcludeCount" "0"
}
}
Your game should then be under one of the options in the sdk. Mine is located in Source Engine MP
Once you choose Portal 2 from the list, it should then make it the active mod, however also open up Hammer to make sure.
Quote from Brainstone on April 30, 2012, 6:06 amI have another question: If your text doesn't inherit the Code <len:#>, will the caption appear forever, until the next caption pops up, or a default amount of time?
I have another question: If your text doesn't inherit the Code <len:#>, will the caption appear forever, until the next caption pops up, or a default amount of time?

Quote from ChickenMobile on April 30, 2012, 7:49 amI assume it just goes for a default amount of time. Probably around 3 seconds.
I assume it just goes for a default amount of time. Probably around 3 seconds.
Quote from baca25 on April 30, 2012, 9:43 amstill not working. This is want my command prompt says, and what my entire gameconfig.txt looks like.
- Code: Select all
"Configs"
{
"Games"
{
"Portal 2"
{
"GameDir" "c:program files (x86)steamsteamappscommonportal 2portal2"
"hammer"
{
"TextureFormat" "5"
"MapFormat" "4"
"DefaultTextureScale" "0.250000"
"DefaultLightmapScale" "16"
"DefaultSolidEntity" "func_detail"
"DefaultPointEntity" "info_player_teamspawn"
"GameExeDir" "c:program files (x86)steamsteamappscommonportal 2portal2"
"MapDir" "c:program files (x86)steamsteamappsbaca25sourcesdk_contenttfmapsrc"
"CordonTexture" "toolstoolsskybox"
"MaterialExcludeCount" "0"
"GameExe" "c:program files (x86)steamsteamappsbaca25team fortress 2hl2.exe"
"BSP" "c:program files (x86)steamsteamappsbaca25sourcesdkbinorangeboxbinvbsp.exe"
"Vis" "c:program files (x86)steamsteamappsbaca25sourcesdkbinorangeboxbinvvis.exe"
"Light" "c:program files (x86)steamsteamappsbaca25sourcesdkbinorangeboxbinvrad.exe"
"BSPDir" "c:program files (x86)steamsteamappsbaca25team fortress 2tfmaps"
"GameData0" "c:program files (x86)steamsteamappsbaca25sourcesdkbinorangeboxbintf.fgd"
}
}
}
"SDKVersion" "5"
}I also noticed your chicken has a hammer now. Did you ever get a chance to play whack-o-mole on my last map?
still not working. This is want my command prompt says, and what my entire gameconfig.txt looks like.
- Code: Select all
"Configs"
{
"Games"
{
"Portal 2"
{
"GameDir" "c:program files (x86)steamsteamappscommonportal 2portal2"
"hammer"
{
"TextureFormat" "5"
"MapFormat" "4"
"DefaultTextureScale" "0.250000"
"DefaultLightmapScale" "16"
"DefaultSolidEntity" "func_detail"
"DefaultPointEntity" "info_player_teamspawn"
"GameExeDir" "c:program files (x86)steamsteamappscommonportal 2portal2"
"MapDir" "c:program files (x86)steamsteamappsbaca25sourcesdk_contenttfmapsrc"
"CordonTexture" "toolstoolsskybox"
"MaterialExcludeCount" "0"
"GameExe" "c:program files (x86)steamsteamappsbaca25team fortress 2hl2.exe"
"BSP" "c:program files (x86)steamsteamappsbaca25sourcesdkbinorangeboxbinvbsp.exe"
"Vis" "c:program files (x86)steamsteamappsbaca25sourcesdkbinorangeboxbinvvis.exe"
"Light" "c:program files (x86)steamsteamappsbaca25sourcesdkbinorangeboxbinvrad.exe"
"BSPDir" "c:program files (x86)steamsteamappsbaca25team fortress 2tfmaps"
"GameData0" "c:program files (x86)steamsteamappsbaca25sourcesdkbinorangeboxbintf.fgd"
}
}
}
"SDKVersion" "5"
}
I also noticed your chicken has a hammer now. Did you ever get a chance to play whack-o-mole on my last map?
Mapping Since May 21, 2011