With OC we pretty much just cache and uncache sounds per map.

Our game_sounds_manifest.txt looks like this, pretty bare bones.

game_sounds_manifest
{
// BASE SOUNDS SHOULD ALWAYS BE CACHED

"precache_file"        "scripts/game_sounds.txt"
"precache_file"        "scripts/game_sounds_ui.txt"
"precache_file"        "scripts/game_sounds_player.txt"

// Weapon sounds
"precache_file"        "scripts/game_sounds_weapons.txt"

// HL2 World, Ambient Generic, Items, Physics, Vehicles
"precache_file"        "scripts/game_sounds_world.txt"
"precache_file"        "scripts/game_sounds_ambient_generic.txt"
"precache_file"        "scripts/game_sounds_items.txt"
"precache_file"        "scripts/game_sounds_physics.txt"
"precache_file"        "scripts/game_sounds_physics_ep2.txt"
"precache_file"        "scripts/game_sounds_vehicles.txt"
}

One thing we had to give up was quick sound cache so that function you
mentioned clears out the soundcache folder so you don't get any conflicts.

//-----------------------------------------------------------------------------
// Purpose: Clear out the maps/soundcache directory to prevent missing .wav
file errors
//-----------------------------------------------------------------------------
void UTIL_ClearSoundcacheDirectory( bool bRemoveOther /*= false*/ )
{
    FileFindHandle_t findHandle;
    char        szPath[260];
    const char *pCacheName = filesystem->FindFirstEx(
"maps/soundcache/*.cache", "MOD", &findHandle );
    while( pCacheName )
    {
        // Don't mess with the three special ones except when told to
        // Update: The function parameter is kind of useless now since I
always set
        // it to true, but I'm going to leave it incase it might be useful
later.
        if ( bRemoveOther && !V_stricmp( pCacheName, "_other.cache" ) )
        {
            // Just continue normally
        }
        else if ( !V_strnicmp( pCacheName, "_", 1 ) )
        {
            pCacheName = filesystem->FindNext( findHandle );
            continue;
        }

        V_snprintf( szPath, sizeof( szPath ), "maps/soundcache/%s",
pCacheName );

        filesystem->RemoveFile( szPath );
        pCacheName = filesystem->FindNext( findHandle );
    }

    filesystem->FindClose( findHandle );
}

I bet there is a way better way of dealing with all this, we just never got
around to exploring further.

Good Luck :)


On Mon, Jan 11, 2010 at 2:19 PM, Chief Whosm <
[email protected]> wrote:

> Thanks, the majority of my problems with my current code turned out to be
> the lack of the mdl and material flush commands. However some sounds which
> work through my static mount code still failed to work through the dynamic
> code I'd posted on pastebin. A good example was the gunship not making any
> rotor blade noises.
>
> So I took a plain sdk of the files, and diffed them with your OC code. For
> testing I borrowed the files (such as the mount files) from OC just so I
> was
> sure these wouldnt be the cause of any issues, and while it definately is
> dynamically mounting the gcfs using your code, the same sounds that failed
> to load in my code also fail in the code you uploaded for me.
>
> I did however have to comment out the UTIL_ClearSoundcacheDirectory lines
> as
> the code for this is missing, could that be the cause of it? and could you
> please post the code for that and where it should be as it wasn't in either
> of the .cpp files.
>
> Also the func_monitors never seem to play any sounds, is this caused by gcf
> mounting or does something have to be done to the env_microphone to make it
> work online. Noclipping to (for example) the "breencast" room allows you to
> hear the sound being played, but only within those four walls.
>
> Also yes I am an ATI user and on occasions it gives grab brians or
> sometimes
> doesnt give an error but doesnt display materials etc as though doing a
> grab
> brian error, but they're (thankfully) a rarity.
>
> Chief.
> _______________________________________________
> To unsubscribe, edit your list preferences, or view the list archives,
> please visit:
> http://list.valvesoftware.com/mailman/listinfo/hlcoders
>
>


-- 
~Ryan ( skidz )
_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders

Reply via email to