This article's documentation is for anything that uses the Source engine. Click here for more information.

Env soundscape: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (updated with template:soundscape lists)
(→‎Keyvalues: Confirmed effects of multiple same-targetname Sound Positions)
 
(39 intermediate revisions by 18 users not shown)
Line 1: Line 1:
{{wrongtitle|title=env_soundscape}}
{{LanguageBar}}
{{base_point}}[[Category:Sound System]]
{{TabsBar|main=Env soundscape}}
{{Preserved entity}}
{{CD|CEnvSoundscape|file1=soundscape.cpp}}
{{This is a|point entity|sprite=1|name=env_soundscape}} It changes the active [[soundscape]] of players, and defines where positioned sounds within it play from. A player must be within the entity's radius and be able to see it for the change to take place. The entity's soundscape will then play until another one takes over. If more than one soundscape entity is fighting for control, the nearest wins.
{{toc-right}}


== Entity description ==
{{ent|env_soundscape_triggerable}} is a related entity identical to env_soundscape, but for use in conjunction with the brush entity {{ent|trigger_soundscape}}.
[[Image:{{PAGENAME}}.png|left]]An entity to control sound in an area. Soundscapes can play a collection of sounds complete with timing and random selections, soundscapes can also apply effects like an echo to their sounds and any others played while they are active. The actual effects and sounds need to be defined [[Soundscapes|outside of Hammer]] but this entity is required to implement them. The active soundscape at any time is the last one that had line-of-sight to the player, and was within the radius.
{{clr}}


=== See also ===
{{tip|In some games such as {{tf2|2}}, soundscape entities cannot be "seen" through water, in which case a [[env_soundscape_triggerable|triggerable]] soundscape is a useful workaround.}}
* [[Soundscapes]] - describes how to define new soundscapes and has more information on the use of this entity.
{{warning|This entity counts an [[edict]] in {{src13}} games (except {{tf2|2}}), inheriting the [[CPointEntity]] base class. In later branches{{which}} it is a server-only entity, inheriting the [[CServerOnlyEntity]] base class.}}
* [[Env_soundscape (prefab)]] - a prefab containing basic soundscape setup.
{{altnames|game={{hls|2}} and {{hldms|2}}|name1=env_sound|misc=<br>See [[List of HL:S Soundscapes]] for which soundscapes correspond to which {{goldsrc|2}} [[env_sound]] values.}}
* [[ambient_generic]] - an entity used for playing individual sounds at specific locations, usually intentionally triggered.
==Keyvalues==
* {{soundscape lists}}
{{KV Targetname}}
 
{{KV|Radius|intn=radius|int|Defines the entity's sphere of influence. Players must also have [[LOS]] to the entity for it to trigger. -1 means infinite range.}}
== Keyvalues ==
{{KV|Soundscape|intn=soundscape|string|The name of the soundscape to play. Some examples are provided, but the actual list is not. The best way to browse soundscapes is from within the game with the <code>playsoundscape</code> console command.}}
* {{KV Targetname}}
{{KV|Sound Position 0|intn=position0|to=Sound Position 7|intn2=position7|targetname|Entities which define the location from which any positioned sounds play. Must be entities that the [[client]] knows about (e.g {{ent|info_target}} or anything visible).}}
* {{KV Parentname}}
:{{Note|If a targetname used for sound position is used by multiple entities, the sound plays from the first one found.}}
* {{KV EnableDisable}}
{{KV StartDisabled}}
* '''radius'''
: <integer> Radius - If set to <code>-1</code>, then the player can hear the soundscape as long as he can see it (regardless of distance to it).
* '''soundscape'''
: <string> Soundscape - The name of the soundscape to use. Corresponds to an entry in the ''soundscapes_*.txt'' file in the ''hl2/scripts'' directory (normally packed into the ''source engine.gcf'' file).
:{| class=standard-table
! Literal Value || Description
|-
| Nothing || Nothing
|-
| Automatic || Automatic
|-
| Automatic_Dialog || Automatic (dialog)
|-
| GenericIndoor || Indoor
|-
| GenericOutdoor || Outdoor
|}
* '''position''0-7'''''
: <target_destination> Sound Position ''0-7'' - Sound positions that will be referenced inside the soundscape text file. Usually used to position a set of sounds within the world.


== Inputs ==
== Inputs ==
* {{I Targetname}}
{{I|ToggleEnabled|Toggle the soundscape on/off.}}
* {{I Parentname}}
{{I EnableDisable}}
* {{I EnableDisable}}
* '''Disabled'''
: {{TODO|Write description. (It's not a typo - both ''Disable'' and ''Disabled'' exist.)}}
* '''ToggleEnabled'''
: Toggle the soundscape enabled state.


== Outputs ==
== Outputs ==
* {{O Targetname}}
{{O|OnPlay|ac-is-this=1|Fired when this soundscape becomes the active one.}}
* '''OnPlay'''
 
: Fired when this soundscape becomes the active one.
== See also ==
* {{ent|env_soundscape_proxy}}
* {{ent|env_soundscape_triggerable}}
* [[Soundscape lists]]
 
[[Category:Sound System]]

Latest revision as of 19:50, 7 August 2025

English (en)Hrvatski (hr)Русский (ru)中文 (zh)Translate (Translate)
edit
Recycle-warning.png
This is a preserved entity in Counter-Strike: SourceHalf-Life 2: DeathmatchDay of Defeat: SourceTeam Fortress 2Left 4 DeadLeft 4 Dead 2Portal 2Counter-Strike: Global Offensive
If the game has round restart mechanics this entity may not behave as expected.
C++ Class hierarchy
CEnvSoundscape
CServerOnlyEntity
CBaseEntity
C++ soundscape.cpp
Env soundscape.png

env_soundscape is a point entity available in all Source Source games. It changes the active soundscape of players, and defines where positioned sounds within it play from. A player must be within the entity's radius and be able to see it for the change to take place. The entity's soundscape will then play until another one takes over. If more than one soundscape entity is fighting for control, the nearest wins.

env_soundscape_triggerable is a related entity identical to env_soundscape, but for use in conjunction with the brush entity trigger_soundscape.

Tip.pngTip:In some games such as Team Fortress 2 Team Fortress 2, soundscape entities cannot be "seen" through water, in which case a triggerable soundscape is a useful workaround.
Warning.pngWarning:This entity counts an edict in Source 2013 games (except Team Fortress 2 Team Fortress 2), inheriting the CPointEntity base class. In later branches[Which?] it is a server-only entity, inheriting the CServerOnlyEntity base class.
AltNames.pngAltNames: In Half-Life: Source Half-Life: Source and Half-Life Deathmatch: Source Half-Life Deathmatch: Source, this entity is also tied to env_sound.
See List of HL:S Soundscapes for which soundscapes correspond to which GoldSrc GoldSrc env_sound values.

Keyvalues

Name (targetname) <string>[ Edit ]
The name that other entities refer to this entity by, via Inputs/Outputs or other keyvalues (e.g. parentname or target).
Also displayed in Hammer's 2D views and Entity Report.
See also:  Generic Keyvalues, Inputs and Outputs available to all entities

Radius (radius) <integer>
Defines the entity's sphere of influence. Players must also have LOS to the entity for it to trigger. -1 means infinite range.
Soundscape (soundscape) <string>
The name of the soundscape to play. Some examples are provided, but the actual list is not. 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) <targetname>
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).
Note.pngNote:If a targetname used for sound position is used by multiple entities, the sound plays from the first one found.
Start Disabled (StartDisabled) <boolean>
Stay dormant until activated (with theEnableinput).

Inputs

ToggleEnabled
Toggle the soundscape on/off.

EnableDisable:

Enable / Disable
Enable/disable this entity from performing its task. It might also disappear from view.

Outputs

OnPlay
!activator = !caller = this entity
Fired when this soundscape becomes the active one.

See also