I hate Soundscripts but I love them

Avatar
Thornscrup
45 Posts
Posted Apr 09, 2012
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. :lol:

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?

Advertisement
Registered users don’t see ads! Register now!
Avatar
ChickenMobile
2,460 Posts
Posted Apr 10, 2012
Replied 12 hours later
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].

Avatar
Thornscrup
45 Posts
Posted Apr 10, 2012
Replied 3 hours later
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!

Avatar
ChickenMobile
2,460 Posts
Posted Apr 10, 2012
Replied 57 minutes later
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...

Avatar
Thornscrup
45 Posts
Posted Apr 10, 2012
Replied 2 hours later
Okay, I'll try this way. Thanks for everything!
Avatar
baca25
342 Posts
Posted Apr 29, 2012
Replied 19 days later
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.
Images 1
Post image 1
Avatar
ChickenMobile
2,460 Posts
Posted Apr 30, 2012
Replied 4 hours later
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"

      "Portal 2"
      {
         "GameDir"      "E:\Program Files (x86)\Steam\steamapps\common\portal 2\portal2"
         "hammer"
         {
            "GameData0"      "E:\Program Files (x86)\Steam\steamapps\accountname\..."
            ...
            "CordonTexture"      "tools\toolsskybox"
            "MaterialExcludeCount"      "0"
         }
      }

Your game should then be under one of the options in the sdk. Mine is located in Source Engine MP

gameconfig.jpg

Once you choose Portal 2 from the list, it should then make it the active mod, however also open up Hammer to make sure.

Images 1
Post image 1
Avatar
Brainstone
401 Posts
Posted Apr 30, 2012
Replied 3 hours later
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?
Avatar
ChickenMobile
2,460 Posts
Posted Apr 30, 2012
Replied 1 hour later
I assume it just goes for a default amount of time. Probably around 3 seconds.
Avatar
baca25
342 Posts
Posted Apr 30, 2012
Replied 1 hour later
still not working. This is want my command prompt says, and what my entire gameconfig.txt looks like.

&quot;Configs&quot;
{
&nbsp; &nbsp;&quot;Games&quot;
&nbsp; &nbsp;{
&nbsp; &nbsp;&nbsp; &nbsp;&quot;Portal 2&quot;
&nbsp; &nbsp;&nbsp; &nbsp;{
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&quot;GameDir&quot;&nbsp; &nbsp;&nbsp; &nbsp;&quot;c:\program files (x86)\steam\steamapps\common\portal 2\portal2&quot;
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&quot;hammer&quot;
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;{
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&quot;TextureFormat&quot;&nbsp; &nbsp;&nbsp; &nbsp;&quot;5&quot;
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&quot;MapFormat&quot;&nbsp; &nbsp;&nbsp; &nbsp;&quot;4&quot;
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&quot;DefaultTextureScale&quot;&nbsp; &nbsp;&nbsp; &nbsp;&quot;0.250000&quot;
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&quot;DefaultLightmapScale&quot;&nbsp; &nbsp;&nbsp; &nbsp;&quot;16&quot;
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&quot;DefaultSolidEntity&quot;&nbsp; &nbsp;&nbsp; &nbsp;&quot;func_detail&quot;
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&quot;DefaultPointEntity&quot;&nbsp; &nbsp;&nbsp; &nbsp;&quot;info_player_teamspawn&quot;
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&quot;GameExeDir&quot;&nbsp; &nbsp;&nbsp; &nbsp;&quot;c:\program files (x86)\steam\steamapps\common\portal 2\portal2&quot;
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&quot;MapDir&quot;&nbsp; &nbsp;&nbsp; &nbsp;&quot;c:\program files (x86)\steam\steamapps\baca25\sourcesdk_content\tf\mapsrc&quot;
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&quot;CordonTexture&quot;&nbsp; &nbsp;&nbsp; &nbsp;&quot;tools\toolsskybox&quot;
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&quot;MaterialExcludeCount&quot;&nbsp; &nbsp;&nbsp; &nbsp;&quot;0&quot;
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&quot;GameExe&quot;&nbsp; &nbsp;&nbsp; &nbsp;&quot;c:\program files (x86)\steam\steamapps\baca25\team fortress 2\hl2.exe&quot;
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&quot;BSP&quot;&nbsp; &nbsp;&nbsp; &nbsp;&quot;c:\program files (x86)\steam\steamapps\baca25\sourcesdk\bin\orangebox\bin\vbsp.exe&quot;
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&quot;Vis&quot;&nbsp; &nbsp;&nbsp; &nbsp;&quot;c:\program files (x86)\steam\steamapps\baca25\sourcesdk\bin\orangebox\bin\vvis.exe&quot;
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&quot;Light&quot;&nbsp; &nbsp;&nbsp; &nbsp;&quot;c:\program files (x86)\steam\steamapps\baca25\sourcesdk\bin\orangebox\bin\vrad.exe&quot;
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&quot;BSPDir&quot;&nbsp; &nbsp;&nbsp; &nbsp;&quot;c:\program files (x86)\steam\steamapps\baca25\team fortress 2\tf\maps&quot;
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&quot;GameData0&quot;&nbsp; &nbsp;&nbsp; &nbsp;&quot;c:\program files (x86)\steam\steamapps\baca25\sourcesdk\bin\orangebox\bin\tf.fgd&quot;
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;}
&nbsp; &nbsp;&nbsp; &nbsp;}
&nbsp; &nbsp;}
&nbsp; &nbsp;&quot;SDKVersion&quot;&nbsp; &nbsp;&nbsp; &nbsp;&quot;5&quot;
}

I also noticed your chicken has a hammer now. Did you ever get a chance to play whack-o-mole on my last map?

Images 1
Post image 1
Avatar
ChickenMobile
2,460 Posts
Posted Apr 30, 2012
Replied 54 minutes later
Your computer hates you. Try the other way to set the game directory through the executable (follow this page https://developer.valvesoftware.com/wik ... _directory )
OR use the -game command to set the current directory.

EDIT: Did you even check if it compiled?

EDIT2: put a -d 0 in it like the console suggested. Problem solved

Avatar
baca25
342 Posts
Posted Apr 30, 2012
Replied 5 hours later
ya i didn't have a clue where to plug in the -d 0 was the thing. so i just randomly put it places until I put it at the end of the command prompt. It seemed to work. Thanks for your help.
Edit
I also found another typo of yours. You said to name the files closedcaption_... when they need to be called closecaption_...
Avatar
ChickenMobile
2,460 Posts
Posted Apr 30, 2012
Replied 6 hours later

baca25 wrote:
I also found another typo of yours. You said to name the files closedcaption_... when they need to be called closecaption_...

Nonsense... the wiki didn't say that :wink:

Avatar
Brainstone
401 Posts
Posted Jun 03, 2012
Replied 1 month later
To bring this thread back from the dead: I have the very same problem like baca.
img
Everything is exactly the same, apart from the fact that you can switch "closecaption_Castle" with "closecaption_tAA_english".
The problem is: under Steam/username I don't have a folder named sourcesdk. I never installed any different sdk game than Portal. I can't change the active mod. It should always be Portal. Still, captioncompiling does not work.

EDIT I've messed around a bit: It seems that (apart from the file called gameConfig.txt) inside portal 2/portal2 is a file called gameinfo.txt. If I just copy it and paste it into portal 2/bin (No idea what I am doing), I will at least get a different error, which looks a bit more progressive:

Images 1
Post image 1
Avatar
ChickenMobile
2,460 Posts
Posted Jun 03, 2012
Replied 3 hours later
Looks like it cant find closecaption_taa_english.txt. Is it in your resource folder? (Same name)
Advertisement
Registered users don’t see ads! Register now!
Avatar
Brainstone
401 Posts
Posted Jun 04, 2012
Replied 10 hours later

Victory!

After I have tipped 50 times the same command with different constellations, e.g. moving certain files to dlc2, copying gameInfo from Portal 2, from Portaal 2 dlc or trying something with the -game parameter, I finally did it the following way:

  1. Copied GameInfo.txt from Portal 2/portal2 into Portal 2/bin
  2. Created a new folder: Portal 2/bin/resource and put my desired closecaption_tAA_english.txt as the only file into it.
  3. Giving the common command to the console (captioncompiler.exe -v closecaption_tAA_english)
  4. Screenshot attached for future problems of the same kind.
Images 1
Post image 1