Env soundscape: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(New!)
 
No edit summary
Line 6: Line 6:
An entity to control sound in an area. The active soundscape at any time is the last one that had line-of-sight to the player, and was within the radius.
An entity to control sound in an area. The active soundscape at any time is the last one that had line-of-sight to the player, and was within the radius.


==Entity Values==
==Keyvalues==
===Keys===


* '''Name''' ''targetname <target_source>''
*[[Targetname]]
: The name that other entities refer to this entity by.
*[[Parentname]]
*[[EnableDisable]]
*'''radius'''
:<integer> If set to -1, then the player can hear the soundscape as long as he can see it (regardless of distance to it).


* '''Parent''' ''parentname <target_destination>''
* '''soundscape'''
: The name of this entity's parent in the movement hierarchy. Entities with parents move with their parent.
: <string> The name of the soundscape to use. Corresponds to an entry in the soundscapes*.txt file in the scripts directory.
 
**Nothing
* '''Start Disabled''' ''StartDisabled <choices>''
**Automatic
* '''Radius''' ''radius <integer>''
**Automatic_Dialog
: If set to -1, then the player can hear the soundscape as long as he can see it (regardless of distance to it).
**GenericIndoor
 
**GenericOutdoor
* '''Soundscape''' ''soundscape <choices>''
: The name of the soundscape to use. Corresponds to an entry in the soundscapes*.txt file in the hl2acripts directory. See also [[Listing of HL2 Soundscapes]].


* '''Sound Position 0''' ''position0 <target_destination>''
* '''Sound Position 0''' ''position0 <target_destination>''
Line 32: Line 32:
: Sound positions that will be referenced inside the soundscape text file. Usually used to position a set of sounds within the world.
: Sound positions that will be referenced inside the soundscape text file. Usually used to position a set of sounds within the world.


===Inputs===
==Inputs==
 
* '''Kill'''
: Removes this entity from the world.
 
* '''KillHierarchy'''
: Removes this entity and all its children from the world.
 
* '''AddOutput <string>'''
: Adds an entity I/O connection to this entity. Format: <output name> <targetname>:<inputname>:<parameter>:<delay>:<max times to fire (-1 == infinite)>. Very dangerous, use with care.
 
* '''FireUser1'''
: Causes this entity's OnUser1 output to be fired.
 
* '''FireUser2'''
: Causes this entity's OnUser2 output to be fired.


* '''FireUser3'''
* [[Targetname]]
: Causes this entity's OnUser3 output to be fired.


* '''FireUser4'''
* [[Parentname]]
: Causes this entity's OnUser4 output to be fired.


* '''SetParent <string>'''
* [[EnableDisable]]
: Changes the entity's parent in the movement hierarchy.
 
* '''SetParentAttachment <string>'''
: Change this entity to attach to a specific attachment point on its parent. Entities must be parented before being sent this input. The parameter passed in should be the name of the attachment.
 
* '''ClearParent'''
: Removes this entity from the the movement hierarchy, leaving it free to move independently.
 
* '''Enable'''
: Enable the soundscape.
 
* '''Disable'''
: Disable the soundscape.


* '''ToggleEnabled'''
* '''ToggleEnabled'''
: Toggle the soundscape enabled state.
: Toggle the soundscape enabled state.


===Outputs===
==Outputs==
 
* '''OnUser1'''
: Fired in response to FireUser1 input.
 
* '''OnUser2'''
: Fired in response to FireUser2 input.
 
* '''OnUser3'''
: Fired in response to FireUser3 input.
 
* '''OnUser4'''
: Fired in response to FireUser4 input.


* [[Targetname]]
* '''OnPlay'''
* '''OnPlay'''
: Fired when this soundscape becomes the active one.
: Fired when this soundscape becomes the active one.
Line 92: Line 51:
==See Also==
==See Also==


* [[Listing of HL2 Soundscapes]] - for soundscape keyvalue
* [[Soundscapes]] - describes how to define new soundscapes and has more information on the use of this entity.
* [[Soundscapes]] - describes how to define new soundscapes and has more information on the use of this entity.
* [[Listing of HL2 Soundscapes]] - a list of soundscapes available in Half-Life 2.
* [[Listing of HL2 Soundscapes]] - a list of soundscapes available in Half-Life 2.

Revision as of 19:54, 9 July 2005

Template:Wrongtitle

Entity Description

Entity Name: env_soundscape

An entity to control sound in an area. The active soundscape at any time is the last one that had line-of-sight to the player, and was within the radius.

Keyvalues

<integer> If set to -1, then the player can hear the soundscape as long as he can see it (regardless of distance to it).
  • soundscape
<string> The name of the soundscape to use. Corresponds to an entry in the soundscapes*.txt file in the scripts directory.
    • Nothing
    • Automatic
    • Automatic_Dialog
    • GenericIndoor
    • GenericOutdoor
  • Sound Position 0 position0 <target_destination>
  • Sound Position 1 position1 <target_destination>
  • Sound Position 2 position2 <target_destination>
  • Sound Position 3 position3 <target_destination>
  • Sound Position 4 position4 <target_destination>
  • Sound Position 5 position5 <target_destination>
  • Sound Position 6 position6 <target_destination>
  • Sound Position 7 position7 <target_destination>
Sound positions that will be referenced inside the soundscape text file. Usually used to position a set of sounds within the world.

Inputs

  • ToggleEnabled
Toggle the soundscape enabled state.

Outputs

Fired when this soundscape becomes the active one.

See Also