PrecacheScriptSound: Difference between revisions
Jump to navigation
Jump to search
Stoopdapoop (talk | contribs) (just being a little more specific) |
Biohazard 90 (talk | contribs) mNo edit summary |
||
Line 1: | Line 1: | ||
PrecacheScriptSound is a function provided to | PrecacheScriptSound is a [[function]] provided to [[precache]] [[Soundscript|Soundscripts]] by name. The Soundscript must be declared in the [[Soundscript|Soundscript manifest document]]. | ||
Revision as of 17:19, 14 April 2011
PrecacheScriptSound is a function provided to precache Soundscripts by name. The Soundscript must be declared in the Soundscript manifest document.
Usage
//-----------------------------------------------------------------------------
// Purpose: Add a Sound Script to the precached list so you can use it
// Input : *soundname - Sound's name as defined in scripts/game_sounds.txt
// Output :
//-----------------------------------------------------------------------------
HSOUNDSCRIPTHANDLE CBaseEntity::PrecacheScriptSound( const char *soundname )
Examples
//-----------------------------------------------------------------------------
// Precache
//-----------------------------------------------------------------------------
void CPropJeepEpisodic::Precache( void )
{
PrecacheScriptSound( "JNK_Radar_Ping_Friendly" );
PrecacheScriptSound( "Physics.WaterSplash" );
BaseClass::Precache();
}
void CWeaponGravityGun::Precache( void )
{
BaseClass::Precache();
PrecacheScriptSound( "Weapon_Physgun.Scanning" );
PrecacheScriptSound( "Weapon_Physgun.LockedOn" );
PrecacheScriptSound( "Weapon_Physgun.Scanning" );
PrecacheScriptSound( "Weapon_Physgun.LightObject" );
PrecacheScriptSound( "Weapon_Physgun.HeavyObject" );
}