shadow_control

From Valve Developer Community
Jump to: navigation, search
English

译者:joyo_a(百度ID)

注意:此翻译仅供参考。本译文是翻译2013年7月30日修改的文章。如果原文有大改动,请以最新修改日期的原文为准。
Shadow control.png
shadow_control is a point entity available in all Source games.定义整个地图的动态阴影的方向、颜色和衰减距离。

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

English Русский
Toolsskybox.gif
天空盒照明通过每一个toolsskybox纹理的笔刷进入地图。其基本属性由三个实体组合使用来控制:
  • light_environment定义(a)漫反射天窗的颜色和强度以及(b)直射日光的方向,颜色和强度。
  • 它还创建了只能由shadow_control实体覆盖/控制的(buggy,不可配置)动态阴影
  • env_sun在天空盒中放置一个glow sprite来表示太阳在天空中的明显位置。

为了理解这些,只要确保在地图上只有这些实体中的每一个,并且为这三个实体的Pitch and Yaw <angles>设置为相同的值。(Pitch相当于太阳的仰角,而Yaw则类似于指南针轴承。)

天空列表文章提供了一些Valve的天空盒的设置。worldspawn实体定义了使用的天空盒。另外请注意,如果env_fog_controller设置与使用的特定天空盒不对应,则会显得不正确。

请与light_environment和env_sun一起使用。

键值

Angles:

Pitch Yaw Roll (Y Z X) <angle>
这个实体在世界的方向。Pitch是围绕Y轴旋转,Yaw是围绕Z轴的旋转,Roll是围绕X轴的旋转。
提示:Pitch相当于太阳的仰角,而Yaw则类似于指南针轴承。
Shadow Color <color255>
这是阴影的颜色。
Maximum Distance <float>
这是允许投射阴影的最大距离,以英寸为单位。
提示:缩短这个距离可以用来产生近似漫射光照的效果。
All Shadows Disabled <boolean>
此功能仅在半条命2中可用。[confirm]

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.

输入

color  <color255>
设置阴影颜色。
direction  <vector>
设置阴影方向。
SetDistance  <float>
设置最大阴影投射距离。
SetAngles  <string>
设置阴影角度。(译:原文为direction,意思为方向,但译者觉得翻译成角度更合理。)
SetShadowsDisabled  <integer>
设置阴影禁用状态。

Targetname:

Kill
Removes this entity and any entities parented to it from the world.
KillHierarchy
Functions the same as Kill, although entities with a large number of children are killed marginally faster.
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.
Note:This input is missing from some games FGD files.
SetLocalOrigin  <origin> (New with Alien Swarm) !FGD
Set this entity's origin in the map.
Note:This input is missing from some games FGD files.
SetLocalAngles  <angles> (New with Alien Swarm) !FGD
Set this entity's angles in the map.
Note:This input is missing from some games FGD files.

输出

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  (New with Left 4 Dead)
This Output fires when the entity is killed and removed from the game.