Static Sound

From Serious Sam Wiki
Jump to: navigation, search
Editor model of CStaticSoundEntity.

General information

Class: CStaticSoundEntity

The Static sound is an entity used to play different sound from specified point in the world space.

Properties

Sound (CBaseSound)

Contains a pointer to .ogg, .wav of .mp3 sound file.


Volume (FLOAT)

Controls sound's loudness.


Pitch (FLOAT)

Controls the degree of highness or lowness of a tone.


Random pitch (FLOAT)

Defines the value on which Pitch parameter will randomly change itself.


Hot spot (FLOAT)

Range of the most hearable sound's working area.


Fall off (FLOAT)

Range of sound's working area.


Cone angle (INDEX)

Defines an angle on which sound will be hearable.


Soft angle (INDEX)

Defines an angle on which sound will be the most hearable.


Outside cone volume (FLOAT)

Sound's volume, hearable when the player is outside working cone area.


Flags (LFLAGS)

Contains several properties, that could be applied to the sound.


  • looping - defines if sound will repeat
  • 3D - defines if sound will be 3D-positioned
  • volumetric - defines if sound will be volumetric (3D?)
  • music - defines if sound is a music
  • voiceover - defines if sound is a voice hearable from head
  • synced - defines if sound will be synced in multiplayer
Autoplay (BOOL)

Defines if sound will be played on level start.


Random autoplay delay (FLOAT)

Defines delay on which sound will be played (only if Autoplay set to true).


Parent part (IDENT)

If the parent has more than one moving part this property defines which part the sound is parented to.


Controlled from script (ENUM)

Defines if sound can be controlled by any kind of scripting.


Spawn flags (LFLAGS)

Defines in which difficulty levels and game types the Static Sound is spawned.


Name (CString)

Defines the name of the Static Sound.


Defines a entity pointer to the parent of the Static Sound.


Platforms (LFLAGS)

Defines on which platforms the Static Sound is spawned.


Entity ID (ULONG)

Displays the entity ID of the Static Sound.


Info 16x16.png Note: Entity ID cannot be edited.

Script Functions

Methods

CStaticSoundEntity Methods
Name Parameters Return Data Type Description
Name Data Type
GetSound - CBaseSound Returns the sound sample that is currently set on this sound source.
IsPlaying - BOOL Returns true if sound is playing of false if not.
PlayLooping - void Starts playing sound and repeats on end.
PlayLoopingFadeIn FadeInLength FLOAT void Starts playing repeating sound with fading in on the beginning.
PlayOnce - void Plays sound once.
PlayOnceWait FadeInLength FLOAT LatentFunctionID Plays sound once with fading in and out (specified parameters used to control fading length). Can be used as Wait(sound:PlayOnceWait(x,y)) to stop script until sound finished.
FadeOutLength FLOAT
SetSound Sound CBaseSound void Changes the sound sample that will be played when any of the play function are called.
SetSoundDelayed Sound CHAR void Obtains and sets the given sound.
SetVolume Volume FLOAT void Changes sound's playing volume.
Stop - void Stops playing sound.
StopLooping - void Stops playing looping sound.
StopLoopingFadeOut FadeOutLength FLOAT void Stop playing looping sound with fade out.
CBaseEntity Methods
Name Parameters Return Data Type Description
Name Data Type
ApplyDamageTool
SEd3.5 or higher
DamageSource CString void To do: Add description
DamageType CString
WeaponIndex WeaponIndex
CharacterClass IDENT
Damage SLONG
EnableReceiveDamageScriptEvent
SEd3.5 or higher
- void Enables ReceiveDamage script events (see below).
Warning 16x16.png Warning: This function disables native damage handling.
EnableTouchAutoMoveTarget
SEd4.0 only
Enabled BOOL void Enables the entity to become an auto move target.
GetAngularVelocity - Vector3f Returns angular velocity of the entity in Vector3f format.
GetAttachmentAbsolutePlacement Attachment IDENT QuatVect Returns placement of attachment in relation to World Spawn in QuatVect format.
GetAttachmentRelativePlacement Attachment IDENT QuatVect Returns placement of attachment in relation to entity in QuatVect format.
GetClassName
SEd3.5 or higher
- CString Returns classname in CString format.
GetLinearVelocity - Vector3f Returns linear velocity of entity in Vector3f format.
GetName - CString Returns the name of the entity in CString format.
GetParent Name IDENT Handle Returns a CBaseEntity handle of the parent of the entity.
GetPlacement - QuatVect Returns position and orientation of the entity in QuatVect format.
GetWorld
SEd3.5 or higher
- CWorld* To do: Add description
GetWorldInfo
SEd3.5 or higher
- CWorldInfoEntity* To do: Add description
InflictDamage Amount SLONG void Inflicts damage to entity.
InflictDamageOfType Amount SLONG void Inflicts damage of a specified damage type to entity.
DamageType CString
InflictDamageToTarget
SEd3.5 or higher
Target Handle void To do: Add description
Amount SLONG
Weapon IDENT
DamageType CString
InflictWeaponDamage
SEd3.5 only
Amount SLONG void To do: Add description
Weapon IDENT
DamageType CString
IsDestroyed - BOOL Returns 1 if entity is destroyed.
IsReceiveDamageScriptEventEnabled
SEd3.5 or higher
- BOOL Returns 1 if ReceiveDamageScriptEvent is enabled (see above).
SetAngularVelocity AngVelocity Vector3f void Sets angular velocity of entity to the specified Vector3f value.
SetLinearVelocity Velocity Vector3f void Sets the velocity of the entity to the specifed Vector3f values.
SetPlacement Placement QuatVect void Sets position and orientation of the entity to the specified QuatVect values.

Events

Destroyed
Triggers when the Mirror is destroyed.
EntityDeleted → SEd3.5 or higher
Triggers when the Mirror is deleted.
ReceiveDamage → SEd3.5 or higher
Triggers when the Mirror receives damage.
Info 16x16.png Note: This event requires enabling via EnableReceiveDamageScriptEvent method.

Other Information

  • Once you set Autoplay to true, the entity can't be controlled from script. That means, if your sound is Autoplayed and Looping, it will never stop.

Related Pages and Links