Env soundscape triggerable: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Undo revision 151979 by TomEdwards (talk).)
(updates)
Line 1: Line 1:
{{wrongtitle|title=env_soundscape_triggerable}}
{{lang|Env soundscape triggerable}}
{{base_point}}[[Category:Sound System]]
[[File:env_soundscape.png|left]]{{base point|env_soundscape_triggerable}} This entity works just like {{ent|env_soundscape}} but can only be activated with {{ent|trigger_soundscape}}.
{{in code|class=class_c_env_soundscape_triggerable.html CEnvSoundscapeTriggerable|file=soundscape_8cpp-source.html soundscape.cpp}}


==Entity Description==
{{PreservedEnt}}
[[Image:env_soundscape.png|left]]A point entity that works like the [[env_soundscape]] entity except that it works in conjunction with the [[trigger_soundscape]] entity to determine when a player hears it. In some mods such as TF2, soundscapes cannot be "seen" through water, in which case a triggerable soundscape is useful workaround.
 
{{code class|CEnvSoundscapeTriggerable|soundscape.cpp}}


{{note|This entity has the same keyvalues, (non-existant) flags, inputs, and outputs as [[env_soundscape]].}}
{{clr}}
{{clr}}


==Keyvalues==
==Keyvalues==
* {{KV Targetname}}
{{KV|Radius (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.}}
* {{KV Parentname with warning}}
{{KV|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 <code>playsoundscape</code> console command.}}
* {{KV EnableDisable}}
{{KV|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 {{ent|info_target}} or anything visible).}}
* '''radius'''
{{KV EnableDisable}}
: <integer> Radius - If set to <code>-1</code>, then the player can hear the soundscape as long as the entity has [[line of sight]] to him (regardless of distance to it).
{{KV BaseEntity}}
* '''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.


<!--This entity doesn't have any flags.-->
==Inputs==
==Inputs==
* {{I Targetname}}
{{IO|ToggleEnabled|Toggle the soundscape on/off.}}
* {{I Parentname}}
{{I EnableDisable}}
* {{I EnableDisable}}
{{I BaseEntity}}
* '''Disabled'''
: {{TODO|Write description. (It's not a typo - both ''Disable'' and ''Disabled'' exists.)}}
* '''ToggleEnabled'''
: Toggle the soundscape enabled state.


==Outputs==
==Outputs==
* {{O Targetname}}
{{IO|OnPlay|Fired when this soundscape becomes the active one.}}
* '''OnPlay'''
{{O BaseEntity|l4d=1}}
: Fired when this soundscape becomes the active one.
 


== See also ==
==See Also==
*[[Soundscapes]]
*[[Soundscape lists]]


* [[Soundscapes]]
[[Category:Sound System]]
* [[trigger_soundscape]]
* [[env_soundscape]]
* [[env_soundscape_proxy]]
* {{Soundscape lists}}

Revision as of 21:54, 1 October 2018

English (en)Translate (Translate)
Env soundscape.png

Template:Base point This entity works just like env_soundscape but can only be activated with trigger_soundscape.

Icon-Important.pngImportant: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:
More info
  • On a new round entities with this classname will intentionally not reset. You can use logic_auto to emulate resetting it.
  • Killing it removes it forever, as it is not respawned on a new round.
  • It cannot be spawned with a point_template.
  • Parenting this with non-preserved entities may have undesirable effects.
C++ In code, it is represented by theCEnvSoundscapeTriggerableclass, defined in thesoundscape.cppfile.

Keyvalues

Radius (radius) ([todo internal name (i)]) <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) ([todo internal name (i)]) <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) ([todo internal name (i)]) 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).
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
Fired when this soundscape becomes the active one.


See Also