Zh/Env soundscape: Difference between revisions

From Valve Developer Community
< Zh
Jump to navigation Jump to search
m (Mark translate)
No edit summary
Line 1: Line 1:
{{lang|Env soundscape}}
{{lang|Env soundscape}}
{{translate}}
{{base_point|env_soundscape|sprite=1}} 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.


{{PreservedEnt}}
{{base_point:zh-cn|env_soundscape|sprite=1}}它改变了玩家的活动[[soundscape|音景]],并定义了其中播放的定位声音。玩家必须在实体的半径内并且能够看到它才能发生变化。然后该实体的音景将播放,直到另一个接管。如果不止一个音景实体在争夺控制权,则由最近的接管。


'''env_soundscape_triggerable''' is a related entity identical to env_soundscape, but for use in conjunction with the brush entity [[trigger_soundscape]].
{{PreservedEnt:zh-cn}}


{{tip|In some games such as TF2, soundscape entities cannot be "seen" through water, in which case a [[env_soundscape_triggerable|triggerable]] soundscape is a useful workaround.}}
'''env_soundscape_triggerable''' 是一个与 env_soundscape 相同的相关实体,但与笔刷实体 [[trigger_soundscape]] 结合使用。
 
{{tip:zh-cn|在某些游戏(例如军团要塞 2)中,无法通过水“看到”音景实体,在这种情况下,[[env_soundscape_triggerable|可触发的音景]]是一种有用的解决方法。}}


{{code class|CEnvSoundscape|soundscape.cpp}}
{{code class|CEnvSoundscape|soundscape.cpp}}


==Keyvalues==
==键值==
{{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|Radius (radius)|int|定义实体的影响范围。玩家还必须拥有 [[LOS]] 实体才能触发。 -1 表示无限范围。}}
{{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|Soundscape (soundscape)|string|要播放的音景的名称。提供了一些示例,但没有提供实际列表。浏览音景的最佳方式是在游戏中使用<code>playsoundscape</code>控制台命令。}}
{{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).}}
{{KV|Sound Position 0 (position0)|to=Sound Position 7 (position7)|targetname|定义任何定位声音播放位置的实体。必须是[[client|客户端]]知道的实体(例如 {{ent|info_target}} 或任何可见的东西)。}}
{{KV EnableDisable}}
{{KV EnableDisable:zh-cn}}
{{KV BaseEntity}}
{{KV BaseEntity:zh-cn}}


==Inputs==
==输入==
{{IO|ToggleEnabled|Toggle the soundscape on/off.}}
{{IO|ToggleEnabled|打开/关闭音景。}}
{{I EnableDisable}}
{{I EnableDisable:zh-cn}}
{{I BaseEntity}}
{{I BaseEntity:zh-cn}}


==Outputs==
==输出==
{{IO|OnPlay|Fired when this soundscape becomes the active one.}}
{{IO|OnPlay|当此音景变为活动音景时触发。}}
{{O BaseEntity|l4d=1}}
{{O BaseEntity:zh-cn|l4d=1}}


==See Also==
==另请参见==
*{{ent|env_soundscape_proxy}}
*{{ent|env_soundscape_proxy}}
*[[Soundscape lists]]
*[[Soundscape lists|音景列表]]


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

Revision as of 01:45, 6 August 2021

English (en)Hrvatski (hr)Русский (ru)中文 (zh)Translate (Translate)
Env soundscape.png

起源 env_soundscape是一个存在于所有的 起源 游戏的点实体。它改变了玩家的活动音景,并定义了其中播放的定位声音。玩家必须在实体的半径内并且能够看到它才能发生变化。然后该实体的音景将播放,直到另一个接管。如果不止一个音景实体在争夺控制权,则由最近的接管。

Template:PreservedEnt:zh-cn

env_soundscape_triggerable 是一个与 env_soundscape 相同的相关实体,但与笔刷实体 trigger_soundscape 结合使用。

Template:Tip:zh-cn

C++ 在源代码中,它由 class CEnvSoundscape 代表,定义于 soundscape.cpp

键值

Radius (radius) ([todo internal name (i)]) <整数(en)>
定义实体的影响范围。玩家还必须拥有 LOS 实体才能触发。 -1 表示无限范围。
Soundscape (soundscape) ([todo internal name (i)]) <字符串(en)>
要播放的音景的名称。提供了一些示例,但没有提供实际列表。浏览音景的最佳方式是在游戏中使用playsoundscape控制台命令。
Sound Position 0 (position0) ([todo internal name (i)]) to Sound Position 7 (position7) <目标名(en)>
定义任何定位声音播放位置的实体。必须是客户端知道的实体(例如 info_target 或任何可见的东西)。

EnableDisable/启动禁用:

Start Disabled (StartDisabled) <布尔值(en)>
保持休眠状态,直到被唤醒。(利用Enable输入)。

Template:KV BaseEntity:zh-cn

输入

ToggleEnabled
打开/关闭音景。

EnableDisable/启动禁用:

Enable
Disable
启动/禁用此实体所具备的效果。同样会使实体消失。
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!
设置该实体的角度。

输出

OnPlay
当此音景变为活动音景时触发。

Base/基础:

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

另请参见