Zh/Ambient generic

From Valve Developer Community
< Zh
Revision as of 07:13, 12 October 2019 by 求生的兔 (talk | contribs) (Created page with "{{otherlang2 |ru=ambient_generic:ru |en=ambient_generic }} {{Entity also in GoldSrc:zh}} {{base point:zh|ambient_generic}} ==实体描述== left...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Template:Otherlang2

Template:Base point:zh

实体描述

Ambient generic.png

此实体用于播放声音,可以设置单次或循环。同样可以设置从某坐标点或者全局可听见。 其可以播放和控制声音脚本的声音,一段.wav实例或者scripted sentence(实体)。不像贴图或者模型那样,你必须重启Hammer才能看到变化,声音不需要,只需要点browser即可。

Tip.png提示:此实体可以手动添加"parentname"键值或者"SetParent"输入,则能够设置父实体,尽管未被fgd列出此键值或输入。
Icon-Bug.png错误:ambient_generics在Counter-Strike Source中播放循环声音,必须配合logic_auto,否则将在第一回合后停止播放。  [todo tested in ?]
Icon-Bug.png错误:声音无法停止问题(如下详情),可以由 用C++修复您Mod声音无法停止问题文章修复。  [todo tested in ?]
Icon-Bug.png错误:当此实体正在播放声音的时候,删除(kill)此实体,会导致在地图持续时间内永远播放!  [todo tested in ?]
Icon-Bug.png错误:ambient_generic在播放声音时不会随着父级更新位置。  [todo tested in ?]
Icon-Bug.png错误:过多ambient_generics在同一时间播放会导致其它ambient_generics表现奇怪或者失败,无视其播放距离。  [todo tested in ?]

键值

Sound Name (message) <字符串>
声音脚本的名字,或者需要播放的声音的路径。对于 scripted sentence,需要在此实体名字前加上一个"!"。 (例如: !COMBINE_THROW_GRENADE4)
Note.png注意:如果您需要将声音识别为音乐,以获取其对音乐的影响,你需要在music路径前面加入"#"。 (例如: music/song01 becomes #music/song01)
Max Audible Distance <浮点型>
最大播放距离unit(hammer单位)对于客户端来说。
Icon-Bug.png错误:声音仍会在距离之外播放?  [todo tested in ?]
Icon-Bug.png错误:由于DSP,声音可能在很远的距离依旧清晰可听。  [todo tested in ?]
Template:注意
SourceEntityName <实体名>
如果指定,声音将从此实体上播放而不是ambient_generic实体。如果目标是能够口型同步的npc, 并且能找到因素信息。那么目标能与声音口型同步。
Icon-Bug.png错误:如果ambient_generic被删除,声音将在地图原点(坐标 0,0,0)处播放!  [todo tested in ?]
Icon-Bug.png错误:多个ambient_generics无法堆叠到同一实体上。  [todo tested in ?]
Volume <整数型 0-10>
声音的音量大小。0是静音,10是正常,默认为10。
Tip.png提示:This keyvalue doesn't allow decimals, but the Volume input does.
Icon-Bug.png错误:The sound does not play at all if the volume is 0.  [todo tested in ?]
Start Volume <int 0-10>
Fade in time in seconds <int 0-100>
Fade out time in seconds <int 0-100>
How long to spend fading in and out, and what volume to start at. Default is no fading.
Pitch <int 1-255>
Pitch, where 1 is low, 100 is normal, and 255 is high.
Icon-Bug.png错误:Very high or very low values can cause other sounds to be distorted.  [todo tested in ?]
Start pitch <int 1-255>
Spin up time <int 0-100>
Spin down time <int 0-100>
How long to spend spinning pitch up/down at the start/end of playback, and what pitch to start at. Default is no spinning.
Dynamic Presets <choices>
Various DSP effects that can be applied.
LFO type <int>
Type of Low Frequency Oscillation to employ.
  • Off (default)
  • Square Wave (alternate between low and high)
  • Triangle Wave (crossfade between high and low)
  • Random
LFO rate <int 0-1000>
How frequently the LFO effect repeats itself.
LFO modulation - pitch <int 0-100>
Affects the sound pitch or vibrato. Higher numbers change the pitch more - warbling singers use little, police sirens use a lot.
LFO modulation - volume <int 0-100>
Affects the volume of the sound, causing it to "pulse." Similar to tremolo. At a really high rate, this can make the same effect as talking through fan blades.
Incremental Spinup Count <int>
Appears to be a intended to increase pitch in time with ToggleSound inputs, but:
Icon-Bug.png错误:Non-functional.  [todo tested in ?]


Flags

  • 1: Play everywhere
    Sound plays at a constant volume, no matter how far away the listener is from the sound source.
    待完善: How does this interact with env_microphone sound detection?
Icon-Bug.png错误:This flag is broken at engine level for Soundscripts. It will only work when a sound is played with its raw filename.  [todo tested in ?]
  • 16: Start Silent
The map will start without this sound playing. Enabled by default.
Icon-Bug.png错误:Looping sounds that do not start silent cannot be controlled!  [todo tested in ?]
  • 32: Is NOT Looped
Changes how the ambient_generic handles stopping and starting playback. It won't stop a sound that loops from looping, but it is still very important to set it to the right value. You might not be able to stop and/or start the sound if it isn't!
Icon-Bug.png错误:Having this option ticked while using a looped sound WILL prevent you from controlling it!  [todo tested in ?]

Inputs

Pitch <int>
Sets the sound pitch, expressed as a range from 1 to 255, where 100 is the sound's original pitch.
Icon-Bug.png错误:Pitch will play the sound without informing the rest of the entity. This makes looping sounds unstoppable!.  [todo tested in ?]
PlaySound
Starts the sound.
StopSound
Stops a looping sound. Does not stop a non-looping sound: this is intentional, and can be changed with C++. However, a non-looping sound can be stopped by using the Volume input with a value of 0.
ToggleSound
Toggles a looping sound between playing and stopped. Behaves like PlaySound if the sound is unlooped.
Volume <float>
Plays the sound at a volume from 0 to 10, where 10 is the loudest.
Icon-Bug.png错误:Volume will play the sound without informing the rest of the entity. This makes looping sounds unstoppable! It is speculated that the input is supposed to change the volume at which the ambient_generic plays its sound when prompted by other inputs, not play it by itself.  [todo tested in ?]
Icon-Bug.png错误:Setting the volume to 0 will cause the sound to pause, rather than play silently.  [todo tested in ?]
FadeIn <int>
Fades the sound up to full volume over a specified number of seconds, with a range from 0 to 100 seconds.
Icon-Bug.png错误:Non-functional, except in Portal 2.  [todo tested in ?]
FadeOut <int>
Fades the sound to silence over a specified number of seconds, with a range from 0 to 100 seconds.
Icon-Bug.png错误:Will bring the sound up to full volume (i.e. 10) before beginning to fade it.  [todo tested in ?]

Outputs

See also