env_sprite
本页面的译者及创建时间为大康 (talk) 19:13, 11 September 2022 (PDT)。欢迎任何人补充新内容或者修改其中的错误。
env_sprite
是一个点实体存在于所有的 起源 游戏。它在世界中创建了一个 sprite。Sprite 总是面向玩家。
注意:这个实体也可以使用
env_glow
作为类名。注意:在 中,这是一个保留实体(preserved entity)。
- 在新一轮中,它不会故意将自己重置为其默认属性(包括位置)。解决方案: 如果这是一个问题,你可以采用 logic_auto 实体模拟重置它。
- 通过
Kill
杀死它会永远移除它,因为它不会在新一轮重生。 - 它不能用 point_template 生成。
- 把这个实体与非保留实体绑定可能会导致不良影响。
注意:渲染 Sprite 透明度的唯一渲染模式是 Glow、Additive、Additive Fractional Frame、World Space Glow 和 Alpha Add 不存在于FGD!。
待完善: This template is currently using deprecated
suf
or {{Lang}}-based translations. Please use the main {{Code class}} instead, which uses {{Autolang}}.
在源代码中,它由 class CSprite
代表,定义于 Sprite.cpp
。
标志
Sprite:
- 1: Start on 开始时启用
- 2: Play Once (只播放一次) - 用于动画 Sprite;纹理将播放动画一次,然后 Sprite 将关闭。
键值
Sprite:
- Sprite Name
(model)
<string
> | 字符串 - 应绘制的材质。
- Scale
(scale)
<float>
| 浮点型 - Sprite 的缩放倍数。
This article has been marked as a candidate for speedy deletion because it has been deprecated.
If you object to this decision, then please discuss why here. 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 - Remember to check if anything links here and the page history (last edit) before deleting.
If you object to this decision, then please discuss why here. 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 - Remember to check if anything links here and the page history (last edit) before deleting.
- Framerate
(framerate)
<string
> | 字符串 - Sprite 应该使用的动画速率,如果有(动画)的话。
- Size of Glow Proxy Geometry
(GlowProxySize)
<float>
| 浮点型 - 为可见性测试而渲染的光晕的大小。只要这个半径的球体可见(穿过任何附近的几何体),就会渲染发光。
DXLevelChoice:
- 最低DX水平
(mindxlevel)
<choices>
- 如果引擎在给定的DirectX Versions 范围之外运行,该实体将不存在。从 求生之路开始,被SystemLevelChoice取代。
- 警告:如果使用这些,当用户切换他们的DirectX设置时,该对象可能会中断。
SystemLevelChoice:
- Minimum CPU Level (mincpulevel)
<choices>
(in all games since ) - CPU级别低于此级别的将不在游戏内呈现此对象,级别由视频设置内的效果细节决定。
注意:键值的名称是因为
cpu_level
命令;效果详细信息使用的命令。- Minimum GPU Level (mingpulevel)
<choices>
(in all games since ) - GPU级别低于此级别的将不在游戏内呈现此对象,级别由视频设置内的Shader细节决定。
注意:键值的名字是因为
gpu_level
命令; Shader Details 使用的命令。RenderFields:
提示:有相应参考渲染请参见Render_Modes
- Render Mode
(rendermode)
<choices>
- 在该实体上设置非标准渲染模式。
- Render FX / Transparency (0 - 255)
(renderamt)
<integer>
| 整数 - 透明的,0是不可见,255为完全可见。
- Render Color (R G B)
(rendercolor)
<color255>
- 着色器。
- Disable Receiving Shadows
(disablereceiveshadows)
<boolean>
| 布尔值 - 是否防止实体接收自身阴影。
RenderFXChoices:
- Render FX
(renderfx)
<choices>
- 指定一种渲染绘制方式。
This article has been marked as a candidate for speedy deletion because it has been deprecated.
If you object to this decision, then please discuss why here. 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 - Remember to check if anything links here and the page history (last edit) before deleting.
If you object to this decision, then please discuss why here. 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 - Remember to check if anything links here and the page history (last edit) before deleting.
Base/基础:
- Parent
(parentname)
<targetname>
| 目标名 - 实体的父级实体,该实体可以与父实体保持移动偏移。名称后面可以添加一个附属点,以逗号隔开。 (
parentname [targetname],[attachment]
)提示:转换至下一张地图的实体关系会依然存在。提示:一些不适合做父实体的实体可能难以运行,利用phys_constraint
可以解决。
- Origin (X Y Z)
(origin)
<coordinates>
- 实体处于世界中的位置,旋转实体会以实体坐标原点旋转。注意:Hammer 不会仅在编辑器中相应地移动实体。
- Pitch Yaw Roll (X Y Z)
(angles)
<angle>
- 实体在世界中的方位,Pitch围绕X轴旋转,可以称为俯仰角。Yaw围绕Z轴旋转,可以称为偏航角,roll围绕Y轴旋转。注意:尽管 Hammer 不显示新角度,但其仍然适用于固实体。
- Classname
(classname)
<string
> | 字符串 不存在于FGD! - 确定实体之前它生成的特征。提示:使用
AddOutput
输入更改 Classname 仍然会影响游戏的代码,例如使类名与 S_PreserveEnts 列表中的一个元素匹配将使实体在新一轮中持续存在!
- Entity Scripts
(vscripts)
<scriptlist>
| 脚本列表 (存在于自 以来) - 在所有实体生成后执行的 VScript 文件(无文件扩展名)的空格分隔列表。这些脚本都在同一个脚本范围内执行,以后的脚本会覆盖任何相同的变量和函数。
- Thinker Function
(thinkfunction)
<string
> | 字符串 (存在于自 以来) - 此实体脚本中的函数名称,该函数将在脚本持续时间内每 100 毫秒(每秒 10 次)自动调用一次。它可用于创建计时器或模拟自主行为。返回值(如果存在)将设置下一次调用之前的时间。尽量避免在此函数中进行昂贵的操作,因为它可能会导致性能问题。
- Lag Compensation
(LagCompensate)
<boolean>
| 布尔值 (存在于自 以来) 不存在于FGD! - 设置为是以延迟补偿此实体。应该非常谨慎地使用!
输入
Sprite:
SetScale
<float>
| 浮点型- 顾名思义。
HideSprite
- 使 Sprite 不可见。
ShowSprite
- 与上反之。
ToggleSprite
- 根据当前状态使 Sprite 不可见或可见。
ColorRedValue
<float>
| 浮点型- 更改红色通道的强度 (0-255)。
ColorGreenValue
<float>
| 浮点型- 更改绿色通道的强度 (0-255)。
ColorBlueValue
<float>
| 浮点型- 更改蓝色通道的强度 (0-255)。
RenderFields:
Alpha
<integer>
| 整数- 设置实体的透明度0~255,0为不可见,255为完全可见。要求Render Mode (渲染模式) 设置为非
0
。
Color
<color255>
- 设置实体颜色(RGB)。
Base:
AddContext
<string
> | 字符串- 添加到实体的 Response Contexts/响应上下文列表。格式是
<key>:<value>
。
语法:
ClearContext
- 从此实体的列表中删除所有上下文。
ClearParent
- 从移动层次结构中删除该实体,使其可以自由移动。
FireUser1
到FireUser4
- 触发相应的
OnUser
输出;详见 User Inputs and Outputs。
Kill
- 从这个世界中删除此实体。
KillHierarchy
- 功能类似
Kill
,尽管此实体与其父实体都被删除了,但比Kill
快一点。
RemoveContext
- 从实体列表删除一个上下文。名字应与现有上下文进行匹配。
SetParent
<string
> | 字符串- 跟随此实体移动,详见 实体层级(依赖关系)。
SetParentAttachmentMaintainOffset
<string
> | 字符串- 同上,但没有传送。在接收到输入时,实体保持其相对于附件的位置。
DispatchResponse
<string
> | 字符串 不存在于FGD!- 向实体发送一个上下文。 详见 Response 和 Concept.
DispatchEffect
<string
> | 字符串 (自从 被移除) 不存在于FGD!- 在实体的原点坐标设置一个特定效果;参见 List of Client Effects。自从 求生之路后由粒子系统取代。
RunScriptCode
<string
> | 字符串 (存在于自 以来)- 在接收输入的实体范围内执行一串 VScript 源代码。通过控制台触发时可能需要字符串引用。错误:在 Hammer 中,使用带有字符串的参数会破坏 VMF 文件的结构,使下一个 Hammer 会话无法查看该文件。
- 修复: 使用文本编辑器手动删除带有字符串的参数。
SetLocalOrigin
<coordinates>
(存在于自 以来) 不存在于FGD!- 将此实体设置到地图中的某个位置。如果此实体是某实体父级,那么它的子级也会随着移动。
输出
Base/基础:
OnUser1
到OnUser4
- 这些输出将分别响应于
FireUser1
到FireUser4
输入。 详见 User Inputs and Outputs。 OnKilled
(only in )- 当实体被Kill输入时响应此输出。