CEnvSoundscape

From Source Entities
Jump to navigation Jump to search

Code classes:

CEnvSoundscape is a code class in all Source games. These entities play soundscapes.

Classnames:

  • env_soundscape - Makes the player hear a certain soundscape when they're able to see the entity. If multiple env_soundscapes are visible, the closest wins.

Bug: In some games (one being Tf2.png), soundscape entities cannot be "seen" through water, in which case a triggerable soundscape is a useful workaround. Tested in: Tf2.png To do: All others

ConVars/Commands[edit | edit source]

ConVar/CommandParameters or default valueParameter TypeEffect
soundscape_debug00 disables, 1 enablesShows which soundscape entities are trying to play. Soundscapes with positional sounds will also have those spots indicated. To do: Describe the line colors accurately.

Keyvalues[edit | edit source]

Radius (radius) <int>
Defines the entity's sphere of influence. -1 means infinite range.
Soundscape (soundscape) <string>
The name of the soundscape to play. Some examples are provided, but the entire list is not. Corresponds to an entry in the soundscapes*.txt file in the /scripts/ directory. The best way to browse soundscapes is from within the game with the playsoundscape console command.
Sound Position 0 (position0) to Sound Position 7 (position7) <target_destination>
Entities which define the location from which any positioned sounds play. Must be entities that the client knows about (e.g info_target or anything visible).
Start Disabled (StartDisabled) <boolean>
Stay inactive until Enabled.

Inputs[edit | edit source]

ToggleEnabled
Toggle the soundscape on/off. When off, the soundscape will never play from this entity.
Enable
Makes the entity active.
Disable
Makes the entity inactive.

Outputs[edit | edit source]

OnPlay
Fired when this soundscape becomes the active one.

See Also[edit | edit source]