通用键值、输入与输出
< Zh
Jump to navigation
Jump to search

This page has not been fully translated.
You can help by finishing the translation.
If this page cannot be translated for some reason, or is left untranslated for an extended period of time after this notice is posted, the page should be requested to be deleted.
Also, please make sure the article complies with the alternate languages guide.
This notice is put here by LanguageBar template and if you want to remove it after updating the translation you can do so on this page.
You can help by finishing the translation.
If this page cannot be translated for some reason, or is left untranslated for an extended period of time after this notice is posted, the page should be requested to be deleted.
Also, please make sure the article complies with the alternate languages guide.
This notice is put here by LanguageBar template and if you want to remove it after updating the translation you can do so on this page.
以下是所有实体均可使用的通用键值(Keyvalues)、输入(Inputs)和输出(Outputs)。它们不一定出现在每个游戏/实体的FGD 中,但作为CBaseEntity 类的成员实际存在于每个实体。若FGD中未包含,可能是因为对该实体的使用不符合设计意图或效果不佳(例如让prop_physics建立父子关系),此类情况需通过测试验证并在对应实体页面记录。部分实体可能会覆写特定键值/输入/输出的功能,这些例外也将在对应页面说明。

键值(Keyvalues)
- Global Entity Name (globalname) <字符串 >
- 当实体转移到具有相同全局名称的另一地图时,属性将复制到目标实体。
- Model (model) <字符串 >
- 实体的游戏内表现形式。
- Origin (X Y Z) (origin) <coordinates >
- 实体中心在世界中的位置。
错误:在Hammer中手动编辑此值不会同步移动点实体。
- Pitch Yaw Roll (Y Z X) (angles) <angle >
- 实体的世界空间朝向。
- Damage Filter (damagefilter) <target_destination>
- 控制哪些实体可伤害此实体的过滤器名称。
父级关系
Vscript
- Entity Scripts (vscripts) <脚本列表 >
- 以空格分隔的VScript文件列表,在所有实体生成后执行。
- Think function (thinkfunction) <字符串 >
- 实体脚本中定期自动调用的函数名。
渲染
RenderFields:
- 渲染模式 (rendermode) <byte choices >
- 在此实体上设置非标准渲染模式。
Render Modes
- Render FX (renderfx) <byte choices >
- 各种有点遗留的阿尔法效果。请参见渲染效果
- Render Amount / Transparency (renderamt) <byte >
- Transparency amount, requires a Render Mode other than Normal. 0 is invisible, 255 is fully visible.
- Render Color (R G B) (rendercolor) <color255 >
- Color tint.
阴影:
- Disable Shadows (disableshadows) <布尔值 >
- 防止该实体生成廉价的渲染到纹理的阴影,或如果实体是 prop_static 的光照贴图阴影。不影响影子映射。
- 禁用接收阴影 (disablereceiveshadows) <布尔值 >
- 防止该实体接收动态阴影。
- Shadow Cast Distance (shadowcastdist) <整数 > 不存在于FGD!
- 设置实体投射动态阴影的距离。0 表示从 shadow_control 实体开始的默认距离。
- Disable Shadow Depth (disableshadowdepth) <布尔值 > (存在于自
以来)
- 用于禁用此实体的阴影深度(用于投影纹理)的渲染。
- Disable flashlight (disableflashlight) <布尔值 > (存在于自
以来)
- 用于禁用此实体的投影纹理照明和阴影。
- Projected Texture Cache (shadowdepthnocache) <integer choices > (存在于自
以来)
- 用于提示投影纹理系统缓存此实体的阴影体积是否足够,或改为强制每帧渲染。
选项 - 0 : 默认
- 1 : 无缓存 - 每帧渲染
- 2 : 缓存 - 只渲染一次
其他
|
输入
- AddOutput <字符串 >
- 为实体添加新的键值/输出。某些键值需要额外代码支持,仅通过此输入修改可能无效。
格式:<键名> <值>
格式:<输出名称> <目标实体>:<输入名称>:<参数>:<延迟>:<最大触发次数(-1表示无限)>
- Kill
- 从场景中移除该实体及其所有子实体。
- FireUser1 to FireUser4 <字符串 >
- 触发对应的
OnUser
输出;参见用户输入与输出 。 警告:此输入会接收但不处理字符串参数。若从可能发送值的输出触发此输入会导致问题,请确保指定虚拟字符串参数,否则控制台会报"错误的输入/输出链接"错误。
父子关系
- SetParent <目标名 >
- 支持!activator但不支持!caller
使实体跟随目标实体移动。参见实体层级(父子关系) 。
- SetParentAttachmentMaintainOffset <字符串 >
- 功能同上,但保持当前位置偏移。
- ClearParent
- 将实体从移动层级中移除,使其可独立移动。
- KillHierarchy
- 功能与
Kill
相同,但会同时移除所有子实体,执行效率略高。
VScript
- RunScriptCode <字符串 > (存在于自
以来) (也存在于
之中)
- 在接收实体的作用域中执行VScript代码。可使用
activator
、caller
、self
变量(同RunScriptFile)。 警告:在Hammer对象属性对话框 的任何文本字段中使用引号符号
"
会导致VMF 文件损坏,必须通过文本编辑器直接编辑VMF文件并删除额外添加的引号符号才能修复。提示:在
中反引号`会被转为引号"。如需字符串建议使用RunScriptFile或实体脚本 。
错误:在无脚本作用域的实体上使用此输入访问
activator
或caller
会导致错误。军团要塞2分支已修复此问题。
- TerminateScriptScope (仅存在于
之中) 不存在于FGD!
- 销毁接收实体的脚本作用域。
上下文
- ClearContext
- 清除实体的所有上下文。
警告:除非调试需要,否则不建议使用此输入,特别是对玩家实体,可能清除VScript模块存储的重要数据。
- RemoveContext <字符串 >
- 移除指定的上下文。
渲染
RenderFields:
- Alpha <整数 0-255 >
- Sets the entity's transparency to a number from 0 (invisible) to 255 (fully visible). Requires the entity to have its
rendermode
set to a number other than0
.
- Color <color255 >
- Sets an RGB color for the entity.
Shadow:
- DisableShadow
- Turn dynamic shadows off for this entity. Identical to applying EF_NOSHADOW.
- EnableShadow
- Turn dynamic shadows on for this entity.
- DisableReceivingFlashlight (存在于自
以来)
- This object will not receive light or shadows from projected textures.
- EnableReceivingFlashlight (存在于自
以来)
- This object may receive light or shadows from projected textures.
其他
|
输出
- OnUser1 to OnUser4
- !activator = FireUser1-4输入的触发者
!caller = this entity
这些输出会分别在对应的FireUser1至FireUser4输入触发时激活;参见用户输入与输出 。
另见