PrecacheScriptSound: Difference between revisions
Jump to navigation
Jump to search

Biohazard 90 (talk | contribs) mNo edit summary |
m (Added {{lang}}.) |
||
Line 1: | Line 1: | ||
{{lang|PrecacheScriptSound}} | |||
PrecacheScriptSound is a [[function]] provided to [[precache]] [[Soundscript|Soundscripts]] by name. The Soundscript must be declared in the [[Soundscript|Soundscript manifest document]]. | PrecacheScriptSound is a [[function]] provided to [[precache]] [[Soundscript|Soundscripts]] by name. The Soundscript must be declared in the [[Soundscript|Soundscript manifest document]]. | ||
== Usage == | == Usage == |
Latest revision as of 16:02, 30 August 2021


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" );
}