Difference between revisions of "Env sun:zh-cn"

From Valve Developer Community
Jump to: navigation, search
(Created page with "{{otherlang2 |title=Env_sun |en=Env_sun }} 译者:joyo_a(百度ID) {{注意|此翻译仅供参考。本译文是翻译2017年9月1日修改的文章。如果原文有...")
 
 
Line 8: Line 8:
 
{{注意|此翻译仅供参考。本译文是翻译2017年9月1日修改的文章。如果原文有大改动,请以最新修改日期的原文为准。}}
 
{{注意|此翻译仅供参考。本译文是翻译2017年9月1日修改的文章。如果原文有大改动,请以最新修改日期的原文为准。}}
  
env_sun是所有源游戏中可用的点实体。
+
env_sun是所有起源游戏中可用的点实体。
  
 
==实体描述==
 
==实体描述==

Latest revision as of 17:11, 2 December 2017

English

译者:joyo_a(百度ID)

注意:此翻译仅供参考。本译文是翻译2017年9月1日修改的文章。如果原文有大改动,请以最新修改日期的原文为准。

env_sun是所有起源游戏中可用的点实体。

实体描述

它将太阳或月亮效果(发光的sprite)放置在没有视差的天空盒中,给人的印象是几乎无限远。env_sun实体不提供任何实际的照明;它仅仅是太阳的视觉表现。使用light_environment为你的地图提供实际的阳光。除与阴影控制无关的CSGO外,使用shadow_control作为动态阴影可能会影响级联照明。

设置env_sun:设置Pitch Yaw Roll。Pitch表示太阳在天空中偏高或偏低。Yaw表示偏左或偏右。Roll是无关的,不需要设置。info_player_start可以用来定位太阳的位置;你可以设定它的角度,想象一条线从背后出来指向天空,其指向的位置就是太阳在游戏中的位置。然后复制并粘贴它的Pitch、Yaw和Roll到env_sun中(记得之后删除info_player_start)。将使用角度(Use Angles)设置为是(这意味着它将使用“Pitch Yaw Roll”的设置)。将“Pitch”设置为实际Pitch的负数(此数字会覆盖“Pitch Yaw Roll”键值中的Pitch)。太阳颜色是太阳的基本颜色。叠加颜色是过渡材质的颜色。覆盖层提供了一个很好的过渡到太阳的全面眩光,并平滑当太阳进入视野时所出现的渐变效果。大小是太阳的大小。将其设置为小于叠加大小的数值;16是微小的太阳,而256是巨大的太阳。设置叠加大小为比太阳大的数值。

这个实体的属性适用于整个地图。地图中存在这个实体的多个实例可能会导致错误。

  • 你也可以将输入发送到env_sun实体,方法是将其指向“env_sun”而不是使用目标名称。
  • 与天空相互作用的效果:纯净的黄色太阳和明亮的蓝色天空相互作用将使得太阳在游戏中表现为白色的太阳;改变颜色来解决这个问题。

键值

Viewer entity <targetname>
用于确定太阳位于天空盒中的实体的名称。太阳应该排队从这个实体到env_sun实体。
UseAngles <boolean>
定位env_sun的旧方法是将其指向目标。新的方法是指定角度。如果使用新方法,请将此属性设置为YES。
Pitch <integer>
该值设定太阳的Pitch位置。它覆盖角度(angles)键值中的Pitch值,即使保留为0,所以需要指定其数值。与角度(angles)键值相反,这个Pitch的旋转是从水平方向逆时针测量的,所以90是直线向上的,而-90是直线向下的。(这只是正常Pitch值的负值。)
Sun Color (R G B) <color255>
太阳的颜色。
Overlay Color (R G B) <color255>
设置值为0 0 0的使用旧方法。To do: 解释一下旧的方法。
Size <integer>
太阳的大小。
Overlay Size <integer>
设置值为-1意味着覆盖层使用旧方法。
Material Name <sprite>
内部发光的材质。
Overlay Material Name <sprite>
覆盖层发光的材质。
HDR color scale. <float>
在HDR模式下运行时,浮点(float)值用于多种sprite颜色。

Targetname:

Name <string>
The targetname that other entities refer to this entity by.
Entity Scripts <scriptlist> (New with Left 4 Dead 2)
Space delimited list of VScript files (without file extension) that are executed after all entities have spawned. The scripts are all executed in the same script scope, later ones overwriting any identical variables and functions.
Script think function <string> (New with Left 4 Dead 2)
Name of a function in this entity's script which will be called automatically every 100 milliseconds (ten times a second) for the duration of the script. It can be used to create timers or to simulate autonomous behavior. The return value (if present) will set the time until the next call.
Note:Try to avoid expensive operations in this function, as it may cause performance problems.

输入

TurnOn
启用太阳渲染。
TurnOff
禁用太阳渲染。
SetColor <color255>
改变太阳的颜色。格式:<红 0-255> <绿 0-255> <蓝 0-255>

Targetname:

Kill
Removes this entity and any entities parented to it from the world.
KillHierarchy
Functions the same as Kill, although this entity and any entities parented to it are killed on the same frame, being marginally faster than Kill.
AddOutput <string>
Evaluates a keyvalue/output on this entity. It can be potentially very dangerous, use with care.
Format: <key> <value>
Format: <output name> <targetname>:<inputname>:<parameter>:<delay>:<max times to fire, -1 means infinite>
FireUser1 to FireUser4
Fire the OnUser outputs; see User Inputs and Outputs.
Use  !FGD
Same as a player invoking +use; may not do anything. Can also be invoked by creating an output that does not specify an input.
This input is not included in Valve's FGDs.
RunScriptFile <script> (New with Left 4 Dead 2)
Execute a VScript file from disk, without file extension. The script contents are merged with the script scope of the receiving entity.
RunScriptCode <string> (New with Left 4 Dead 2)
Execute a string of VScript source code in the scope of the entity receiving the input. String quotation may be needed when fired via console.
Bug: In <Left 4 Dead 2>, the code is executed in the script scope of the entity that fires the output, not the one receiving the input.
Warning: Never try to pass string parameters to a script function with this input. It will corrupt the VMF structure because of the nested quotation marks, which then must be removed manually with a text editor.
CallScriptFunction <string> (New with Left 4 Dead 2) !FGD
Execute a VScript function in the scope of the receiving entity.
SetLocalOrigin <coordinates> (New with Alien Swarm) !FGD
Send this entity to a spot in the map. If the entity is parented to something, it will be offset from the parent by this amount.
SetLocalAngles <angles> (New with Alien Swarm) !FGD
Set this entity's angles.

输出

Targetname:

OnUser1 to OnUser4
These Outputs each fire in response to the firing of the like-numbered FireUser1 to FireUser4 Input; see User Inputs and Outputs.
OnKilled  (Only in the Left 4 Dead series)
This Output fires when the entity is killed and removed from the game.

关于Env_Sun的教程(俄语)

教程作者:Project-S

description of env_sun (Видимое солнце)

youtu.be/2H-ZtuoyK04

Env_Sun + Light_Environment (ещё одно видео о солнце)

youtu.be/WcGIrc0nWnw