Zh/Ambient generic: Difference between revisions

From Valve Developer Community
< Zh
Jump to navigation Jump to search
(Created page with "{{otherlang2 |ru=ambient_generic:ru |en=ambient_generic }} {{Entity also in GoldSrc:zh}} {{base point:zh|ambient_generic}} ==实体描述== left...")
 
(重大更新!中文!)
Line 31: Line 31:
; Volume <code><[[整数型]] 0-10></code>
; Volume <code><[[整数型]] 0-10></code>
: 声音的音量大小。0是静音,10是正常,默认为10。
: 声音的音量大小。0是静音,10是正常,默认为10。
:{{tip|This keyvalue doesn't allow decimals, but the Volume input does.}}
:{{提示|键值并不允许小数,但是对其输入可以。}}
:{{bug|The sound does not play at all if the volume is 0.}}
:{{bug|当设置为0,声音不会被播放。}}
; Start Volume <code><int 0-10></code>
; Start Volume/初始音量 <code><整数 0-10></code>
; Fade in time in seconds <code><int 0-100></code>
; Fade in time in seconds/淡入时间/秒 <code><整数 0-100></code>
; Fade out time in seconds <code><int 0-100></code>
; Fade out time in seconds/淡出时间/秒 <code><整数 0-100></code>
: How long to spend fading in and out, and what volume to start at. Default is no fading.
: 淡入淡出时间以及开始时的音量大小,默认不淡入淡出。
; Pitch <int 1-255>
; Pitch <整数 1-255>
: Pitch, where 1 is low, 100 is normal, and 255 is high.
: 音高,1为低,100为正常,255为高。
:{{bug|Very high or very low values can cause other sounds to be distorted.}}
:{{bug|太高值或者太低都会导致其他声音失真。}}
; Start pitch <int 1-255>
; Start pitch/初始音高 <整数 1-255>
; Spin up time <code><int 0-100></code>
; Spin up time/升速时间 <code><整数 0-100></code>
; Spin down time <code><int 0-100></code>
; Spin down time/降速时间 <code><整数 0-100></code>
: 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 <code><choices></code>
; Dynamic Presets <code><choices></code>
: Various [[DSP]] effects that can be applied.
: 可以应用各种[[DSP]]效果。
; LFO type <code><int></code>
; LFO type <code><整数型></code>
: Type of [[LFO|Low Frequency Oscillation]] to employ.
: [[LFO|低频振荡]]种类的采用。
:* Off (default)
:* Off (default)/关(默认)
:* Square Wave (alternate between low and high)
:* Square Wave (alternate between low and high)/矩形波(高低交替)
:* Triangle Wave (crossfade between high and low)
:* Triangle Wave (crossfade between high and low)/三角波(高低之间淡入淡出)
:* Random
:* Random/随机
; LFO rate <code><int 0-1000></code>  
; LFO rate <code><整数 0-1000></code>  
: How frequently the LFO effect repeats itself.
: LFO效果重复频率。
; LFO modulation - pitch <code><int 0-100></code>
; LFO modulation - pitch <code><整数 0-100></code>
: Affects the sound pitch or [[Wikipedia:vibrato|vibrato]]. Higher numbers change the pitch more - warbling singers use little, police sirens use a lot.
: 影响音高或者[[Wikipedia:vibrato|颤音]]。更高的数字会改变更多音高 - 颤声歌手很少使用,警笛常用。
; LFO modulation - volume <code><int 0-100></code>
; LFO modulation - volume <code><整数 0-100></code>
: Affects the volume of the sound, causing it to "pulse." Similar to [[Wikipedia:tremolo|tremolo]]. At a really high rate, this can make the same effect as talking through fan blades.
: 影响声音的音量大小,让其"跳动"。类似于[[Wikipedia:tremolo|震声*和颤声很类似]]。非常高的频率,类似于对着旋转的风扇叶说话。
; Incremental Spinup Count <code><int></code>
; Incremental Spinup Count <code><int></code>
: Appears to be a intended to increase pitch in time with <code>ToggleSound</code> inputs, but: {{bug|Non-functional.}}
: 似乎为了增加音高在指定时间内与<code>ToggleSound</code>的输入。 but: {{bug|没用,无效!}}


{{KV BaseEntity}}
{{KV BaseEntity:zh}}
==Flags==
==Flags/标签==
*1: Play everywhere
*1: Play everywhere
*:Sound plays at a constant volume, no matter how far away the listener is from the sound source. {{todo|How does this interact with {{ent|env_microphone}} sound detection?}}  
*:无论接受者与音源多远,都以恒定的音量播放。{{todo|如何 与实体{{ent|env_microphone}} 的声音检测交互?}}  
:{{bug|This flag '''is broken at engine level''' for [[Soundscripts]]. It will only work when a sound is played with its raw filename.}}
:{{bug|标签 '''is broken at engine level''' for [[Soundscripts]].只会在声音.raw以文件名播放时生效。}}
*16: Start Silent
*16: Start Silent
:The map will start without this sound playing. Enabled by default. {{bug|Looping sounds that do not start silent cannot be controlled!}}
:此声音将不会播放。默认启用 {{bug|循环声音无法设置成这样并且无法控制!}}
*32: Is NOT Looped
*32: Is NOT Looped
:Changes how the <code>ambient_generic</code> 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! {{bug|Having this option ticked while using a looped sound WILL prevent you from controlling it!}}
:改变<code>ambient_generic</code>如何处理停止和开始播放。它不会使一个在循环的声音停止循环,但是设置正确的值依然''十分重要''' 。如果不是,难以控制停止或者启用声音?{{bug|循环的声音请勿勾选,否则会丢失控制!}


== Inputs ==
== 输入 ==
;Pitch <code><[[int]]></code>
;Pitch <code><[[整数型]]></code>
:Sets the sound pitch, expressed as a range from 1 to 255, where 100 is the sound's original pitch. {{bug|Pitch will play the sound without informing the rest of the entity. This makes looping sounds unstoppable!.}}
:设置声音音高,范围从1~255,100是原始音高。{{bug|似乎会导致声音立刻播放,并且循环的声音将无法控制。}}
; <code>PlaySound</code>
; <code>PlaySound</code>
: Starts the sound.
: 开始播放声音。
; <code>StopSound</code>
; <code>StopSound</code>
: Stops a looping sound. Does ''not'' stop a non-looping sound: this is intentional, and can be changed [[Ambient generic: stop and toggle fix|with C++]]. However, a non-looping sound can be stopped by using the Volume input with a value of 0.
: 停止播放循环声音。不会停止''''''循环声音! 这是故意的, 并且能够改变,修复文章:[[Ambient generic: stop and toggle fix|C++修复大法于您的mod]]。然而非循环声音可以通过Volume输入,设置值为0来实现。
; <code>ToggleSound</code>
; <code>ToggleSound</code>
: Toggles a looping sound between playing and stopped. Behaves like <code>PlaySound</code> if the sound is unlooped.
:开关循环声音的按钮功能。表现类似于 <code>PlaySound</code>输入。
; <code>Volume <[[float]]></code>
; <code>Volume <[[float]]></code>
: Plays the sound at a volume from 0 to 10, where 10 is the loudest. {{bug|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.}} {{bug|Setting the volume to 0 will cause the sound to pause, rather than play silently.}}
: 以0~10的音量设置一个声音大小。10为最大声。{{bug|会自动播放声音。并导致声音循环播放且无法停止!本应该在输入时更改其音量。}} {{bug|设置0会导致声音停止而不是静音播放。}}
; <code>FadeIn <[[int]]></code>
; <code>FadeIn <[[int]]></code>
:Fades the sound up to full volume over a specified number of seconds, with a range from 0 to 100 seconds. {{bug|Non-functional, except in Portal 2.}}
:指定秒数内将声音调整为最大声。范围0~100/秒。 {{bug|无功能,portal2除外。}}
; <code>FadeOut <[[int]]></code>
; <code>FadeOut <[[int]]></code>
:Fades the sound to silence over a specified number of seconds, with a range from 0 to 100 seconds. {{bug|Will bring the sound up to full volume (i.e. 10) before beginning to fade it.}}
:指定秒数内将声音调整为最小声。范围0~100/秒。{{bug|在淡出前会将声音调整最大(10)}}
{{I BaseEntity}}
{{I BaseEntity:zh}}
== Outputs ==
== 输出 ==
{{O BaseEntity|l4d=1}}
{{O BaseEntity:zh|l4d=1}}
== See also ==
== 参见 ==
* [http://www.gamebanana.com/tuts/5141 Adjust ambient_generic volume higher than 10] (Advanced Mapping Tutorial)
* [http://www.gamebanana.com/tuts/5141 超越实体极限,将声音调整至10以上。] (通用地图教程)
* [[env_soundscape]] - used to play many ambient/background sounds from a single entity [[soundscape|via a script]]
* [[env_soundscape]] - 用单个实体播放多个声音[[soundscape|通过脚本]]
* [[Looping a Sound]] - which requires modifying the actual .wav file
* [[Looping a Sound]] - which requires modifying the actual .wav file
* [http://www.slackiller.com/New%20Tuts/sound.html Setting up ambient_generics in Counter-Strike: Source using logic_auto] - a substitute for creating a proper env_soundscape.
* [http://www.slackiller.com/New%20Tuts/sound.html 用logic_auto在css设置此实体。] - 创建env_soundscape的替代方案。


[[Category:Sound System]]
[[Category:Sound System]]

Revision as of 07:50, 12 October 2019

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提示:键值并不允许小数,但是对其输入可以。
Icon-Bug.png错误:当设置为0,声音不会被播放。  [todo tested in ?]
Start Volume/初始音量 <整数 0-10>
Fade in time in seconds/淡入时间/秒 <整数 0-100>
Fade out time in seconds/淡出时间/秒 <整数 0-100>
淡入淡出时间以及开始时的音量大小,默认不淡入淡出。
Pitch <整数 1-255>
音高,1为低,100为正常,255为高。
Icon-Bug.png错误:太高值或者太低都会导致其他声音失真。  [todo tested in ?]
Start pitch/初始音高 <整数 1-255>
Spin up time/升速时间 <整数 0-100>
Spin down time/降速时间 <整数 0-100>
播放开始/结束消耗多少时间升速或降低音高,以及从多少音高开始。默认不执行。
Dynamic Presets <choices>
可以应用各种DSP效果。
LFO type <整数型>
低频振荡种类的采用。
  • Off (default)/关(默认)
  • Square Wave (alternate between low and high)/矩形波(高低交替)
  • Triangle Wave (crossfade between high and low)/三角波(高低之间淡入淡出)
  • Random/随机
LFO rate <整数 0-1000>
LFO效果重复频率。
LFO modulation - pitch <整数 0-100>
影响音高或者颤音。更高的数字会改变更多音高 - 颤声歌手很少使用,警笛常用。
LFO modulation - volume <整数 0-100>
影响声音的音量大小,让其"跳动"。类似于震声*和颤声很类似。非常高的频率,类似于对着旋转的风扇叶说话。
Incremental Spinup Count <int>
似乎为了增加音高在指定时间内与ToggleSound的输入。 but:
Icon-Bug.png错误:没用,无效!  [todo tested in ?]


Warning icon.png
This article has been marked as a candidate for speedy deletion for the following reason:
The redirect page got deleted, therefore this page should too.
If you object to this decision, then please discuss why here (If you make a discussion section also create this redirect page). If this page doesn't meet the criteria for speedy deletion, then please remove this notice, but do not remove it from pages that you have created yourself
Administrators / Moderators - Remember to check if anything links here and the page history before deleting.

Flags/标签

  • 1: Play everywhere
    无论接受者与音源多远,都以恒定的音量播放。
    待完善: 如何 与实体env_microphone 的声音检测交互?
Icon-Bug.png错误:标签 is broken at engine level for Soundscripts.只会在声音.raw以文件名播放时生效。  [todo tested in ?]
  • 16: Start Silent
此声音将不会播放。默认启用
Icon-Bug.png错误:循环声音无法设置成这样并且无法控制!  [todo tested in ?]
  • 32: Is NOT Looped
改变ambient_generic如何处理停止和开始播放。它不会使一个在循环的声音停止循环,但是设置正确的值依然十分重要' 。如果不是,难以控制停止或者启用声音?{{bug|循环的声音请勿勾选,否则会丢失控制!}

输入

Pitch <整数型>
设置声音音高,范围从1~255,100是原始音高。
Icon-Bug.png错误:似乎会导致声音立刻播放,并且循环的声音将无法控制。  [todo tested in ?]
PlaySound
开始播放声音。
StopSound
停止播放循环声音。不会停止循环声音! 这是故意的, 并且能够改变,修复文章:C++修复大法于您的mod。然而非循环声音可以通过Volume输入,设置值为0来实现。
ToggleSound
开关循环声音的按钮功能。表现类似于 PlaySound输入。
Volume <float>
以0~10的音量设置一个声音大小。10为最大声。
Icon-Bug.png错误:会自动播放声音。并导致声音循环播放且无法停止!本应该在输入时更改其音量。  [todo tested in ?]
Icon-Bug.png错误:设置0会导致声音停止而不是静音播放。  [todo tested in ?]
FadeIn <int>
指定秒数内将声音调整为最大声。范围0~100/秒。
Icon-Bug.png错误:无功能,portal2除外。  [todo tested in ?]
FadeOut <int>
指定秒数内将声音调整为最小声。范围0~100/秒。
Icon-Bug.png错误:在淡出前会将声音调整最大(即 10)。  [todo tested in ?]
Base:
AddContext <字符串(en)>
添加到实体的 Response Contexts/响应上下文列表。格式是<key>:<value>
AddOutput <字符串(en)>
在此实体上分配新的键值/输出。对于键值,有些依赖于额外的必要代码来运行,如果它只是通过这个输入改变就行不通。必须遵循严格的格式:
语法:

ClearContext
从此实体的列表中删除所有上下文。
ClearParent
从移动层次结构中删除该实体,使其可以自由移动。
FireUser1 to FireUser4
触发相应的OnUser输出;详见 User Inputs and OutputsEnglish
Kill
从这个世界中删除此实体。
KillHierarchy
功能类似Kill,尽管此实体与其父实体都被删除了,但比Kill快一点。
RemoveContext
从实体列表删除一个上下文。名字应与现有上下文进行匹配。
SetParent <字符串(en)>
跟随此实体移动,详见 实体层级(依赖关系)
SetParentAttachment <字符串(en)>
更改此实体到其父级上的特定附属English点。实体将传送,以至于其骨骼方位English与附属匹配。在使用此输入前必须设置好实体的父实体。
SetParentAttachmentMaintainOffset <字符串(en)>
同上,但没有传送。在接收到输入时,实体保持其相对于附件的位置。
Use  不存在于FGD!
与调用 +use 的玩家相同[玩家按 +use(使用,默认E按钮)];大多数情况下没有影响。
DispatchResponse <字符串(en)> 不存在于FGD!
向实体发送一个上下文。 详见 ResponseEnglishConceptEnglish.
DispatchEffect <字符串(en)> (被移除求生之路 以来) 不存在于FGD!
在实体的原点坐标设置一个特定效果;参见 List of Client EffectsEnglish。自从求生之路 求生之路后由粒子系统取代。
RunScriptFile <脚本(en)> (存在于自 求生之路2 以来)
从硬盘执行一个 VScript 脚本文件,不带文件后缀名。会合并接收实体的脚本域。
RunScriptCode <字符串(en)> (存在于自 求生之路2 以来)
在接收输入的实体范围内执行一串 VScript 源代码。通过控制台触发时可能需要字符串引用。
Icon-Bug.png错误:在 Hammer 中,使用带有字符串的参数会破坏 VMFEnglish 文件的结构,使下一个 Hammer 会话无法查看该文件。  [todo tested in ?]
Note.png修复:使用文本编辑器手动删除带有字符串的参数。
CallScriptFunction <字符串(en)> (存在于自 求生之路2 以来) 不存在于FGD!
在接受实体脚本域上执行一段 VScript 函数。
SetLocalOrigin <coordinates(en)> (存在于自 异形丛生 以来) 不存在于FGD!
将此实体设置到地图中的某个位置。如果此实体是某实体父级,那么它的子级也会随着移动。
SetLocalAngles <angles(en)> (存在于自 异形丛生 以来) 不存在于FGD!
设置该实体的角度。

输出

Base/基础:

OnUser1 to OnUser4
这些输出将分别响应于 FireUser1FireUser4 输入。 详见 User Inputs and Outputs
OnKilled  (存在于 求生之路系列求生之路系列 之中)
当实体被Kill输入时响应此输出。

参见