func_brush
本页面的译者及时间为大康 (talk) 08:08, 6 January 2022 (PST)。部分内容由机器翻译。
Todo: 已弃用模板
{{Base brush}}
、{{Brush ent}}
或 {{Tf2 brush}}
(以及相似的) 正在使用。请更新并使用模板 {{Entity}}
替代。
func_brush
是一个存在于所有的 Source 游戏的固实体。它是具有各种功能的通用笔刷实体。
它结合了来自 Goldsource 的func_wall
、func_illusionary
和func_wall_toggle
的功能。上述实体现在仍然可以使用,但对内存的节省非常有限。
Note:This is a preserved entity in .
- On a new round, its properties including its position will intentionally not reset. You can use logic_auto to emulate resetting it.
- Killing it removes it forever, as it is not respawned on a new round.
- It cannot be spawned with a point_template.
- Parenting this with non preserved entities may have undesirable effects.
Todo: This template is currently using deprecated
suf
or {{Lang}}-based translations. Please use the main {{Code class}} instead, which uses {{Autolang}}.
在源代码中,它由 class CFuncBrush
代表,定义于 modelentities.cpp
。
键值
- Solidity
(Solidity)
<choices>
- 用于控制这个笔刷的坚固性/碰撞。
- 0: Toggle(切换)- 碰撞随其可见性一起切换。
- 1: Never Solid(从不碰撞)
- 2: Always Solid(始终碰撞)
- NPC class excluded from collisions
(excludednpc)
<classname>
- 如果在此处指定了 NPC 类型名称(classname)(例如
npc_zombie
),则该类型的 NPC 不会与这些笔刷发生碰撞。
- Invert NPC class exclusion
(invert_exclusion)
<boolean>
| 布尔值 - 如果启用,则会将上述“NPC class excluded from collisions”属性的含义变成“仅该类型的 NPC 会与这些笔刷发生碰撞”
EnableDisable/启动禁用:
- Start Disabled
(StartDisabled)
<boolean>
| 布尔值 - 保持休眠状态,直到被唤醒。(利用
Enable
输入)。 - Tip:如果 Solidity 是 Toggle,禁用也会使实体没有碰撞。
Visible Brush:
- Minimum Light
(_minlight)
<float>
| 浮点型 - 击中此画笔的最小光量。 0 表示无,1 表示正常,2 表示加倍。
- Damage Filter Name
(damagefilter)
<targetname>
| 目标名 - 当这个实体受到伤害时,它会被这个实体过滤。
- Render Mode
(rendermode)
<choices>
- 在该实体上设置非标准渲染模式。
- 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.
- Render FX / Transparency (0 - 255)
(renderamt)
<integer>
| 整数 - 透明度量,需要正常(Normal)以外的渲染模式。 0 是不可见的,255 是完全可见的。
- Render Color (R G B)
(rendercolor)
<color255>
- 色调。
- Shadow Cast Distance
(shadowcastdist)
<integer>
| 整数 不存在于FGD! - 设置实体投射动态阴影的距离。 0 表示与
shadow_control
实体相同的默认距离。
- Shadows
(vrad_brush_cast_shadows)
<integer>
| 整数 不存在于FGD! - 确定该实体是否会投射光照贴图阴影。
- 0: No shadows
- 1: Cast shadows
- Disable Receiving Shadows
(disablereceiveshadows)
<boolean>
| 布尔值 - 防止实体接收自身的阴影。
- Texture Frame
(texframeindex)
<integer>
| 整数 不存在于FGD! - 此实体上任何动画纹理的帧数。
- Minimum CPU Level
(mincpulevel)
<choices>
(in all games since ) - CPU 级别低于此值的用户将无法在游戏中看到此对象。目前还不清楚 CPU 级别是如何决定的,但大多数系统都被归类为“高”。
- Maximum CPU Level
(maxcpulevel)
<choices>
(in all games since ) -
- 0: Default(默认)
- 1: Low(低)
- 2: Medium(中)
- 3: High(高)
- Maximum GPU Level
(maxgpulevel)
<choices>
(in all games since ) -
- 0: Default
- 1: Very low(非常低)
- 2: Low
- 3: Medium
- 4: High
Base/基础:
- Collisions
(solid)
<choices>
- 该实体的碰撞方式。
- 0: 无
- 1: BSP (QPhysics) 不存在于FGD! Bug:在 中,如果使用 QPhysics 碰撞的实体被 Gel 击中,游戏将崩溃!
- 2: Bounding Box|边界框
- 3: Oriented Bounding Box|定向边界框 (用于运行时生成的要旋转的笔刷实体) 不存在于FGD!
- 4: Oriented Bounding Box|定向边界框,仅限于 Yaw 不存在于FGD!
- 5: Custom/Test|自定义/测试(通常不会与任何东西发生碰撞) 不存在于FGD!
- 6: VPhysics
- Parent
(parentname)
<targetname>
| 目标名 - 实体的父级实体,该实体可以与父实体保持移动偏移。名称后面可以添加一个附属点,以逗号隔开。 (
parentname [targetname],[attachment]
)Tip:转换至下一张地图的实体关系会依然存在。Tip:一些不适合做父实体的实体可能难以运行,利用phys_constraint
可以解决。
- Origin (X Y Z)
(origin)
<coordinates>
- 实体处于世界中的位置,旋转实体会以实体坐标原点旋转。Note:Hammer 不会仅在编辑器中相应地移动实体。
- Pitch Yaw Roll (X Y Z)
(angles)
<angle>
- 实体在世界中的方位,Pitch围绕X轴旋转,可以称为俯仰角。Yaw围绕Z轴旋转,可以称为偏航角,roll围绕Y轴旋转。Note:尽管 Hammer 不显示新角度,但其仍然适用于固实体。
- Classname
(classname)
<string
> | 字符串 不存在于FGD! - 确定实体之前它生成的特征。Tip:使用
AddOutput
输入更改 Classname 仍然会影响游戏的代码,例如使类名与 S_PreserveEnts 列表中的一个元素匹配将使实体在新一轮中持续存在!
- Entity Scripts
(vscripts)
<scriptlist>
| 脚本列表 (存在于自 以来) - 在所有实体生成后执行的 VScript 文件(无文件扩展名)的空格分隔列表。这些脚本都在同一个脚本范围内执行,以后的脚本会覆盖任何相同的变量和函数。
- Thinker Function
(thinkfunction)
<string
> | 字符串 (存在于自 以来) - 此实体脚本中的函数名称,该函数将在脚本持续时间内每 100 毫秒(每秒 10 次)自动调用一次。它可用于创建计时器或模拟自主行为。返回值(如果存在)将设置下一次调用之前的时间。尽量避免在此函数中进行昂贵的操作,因为它可能会导致性能问题。
- Lag Compensation
(LagCompensate)
<boolean>
| 布尔值 (存在于自 以来) 不存在于FGD! - 设置为是以延迟补偿此实体。应该非常谨慎地使用!
标志
- 2: Ignore player +USE——实体将忽略所有
Use
输入,包括来自玩家的输入(译者注:+USE即你按E键的作用)。
输入
SetExcluded
- 更改不与画笔碰撞的NPC类。
SetInvert
- 是否反转NPC类排除规则。
Toggle
不存在于FGD!- 切换实体的启用状态
EnableDisable/启动禁用:
Enable
Disable
- 启动/禁用此实体所具备的效果。同样会使实体消失。
Visible Brush:
AlternativeSorting
<boolean>
| 布尔值- 交换实体的渲染顺序。用于尝试修复渲染时的排序问题,例如在半透明材质前渲染对象。
Color
<color255>
- 为实体设置 RGB 颜色。
SetDamageFilter
<targetname>
| 目标名- 为该实体设置一个过滤器以在它受到伤害时使用。
EnableDamageForces
- 允许实体被对其造成的伤害推动(通常力度与造成的伤害相关)。
DisableDamageForces
- 防止实体被对其造成的伤害推动。
EnableShadow
- 允许实体绘制渲染目标阴影。
DisableDraw
(in all games since )- 将
EF_NODRAW
应用于实体。请注意,这与rendermode 10
不同。
EnableReceivingFlashlight
(in all games since )- 使实体被
env_projectedtexture
照亮。
DisableReceivingFlashlight
(in all games since )- 防止实体被
env_projectedtexture
照亮。纹理产生的阴影仍然会投射。
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。自从 Left 4 Dead后由粒子系统取代。
RunScriptCode
<string
> | 字符串 (存在于自 以来)- 在接收输入的实体范围内执行一串 VScript 源代码。通过控制台触发时可能需要字符串引用。Bug:在 Hammer 中,使用带有字符串的参数会破坏 VMF 文件的结构,使下一个 Hammer 会话无法查看该文件。
- Fix: 使用文本编辑器手动删除带有字符串的参数。
SetLocalOrigin
<coordinates>
(存在于自 以来) 不存在于FGD!- 将此实体设置到地图中的某个位置。如果此实体是某实体父级,那么它的子级也会随着移动。
输出
Base/基础:
OnUser1
到OnUser4
- 这些输出将分别响应于
FireUser1
到FireUser4
输入。 详见 User Inputs and Outputs。 OnKilled
(only in )- 当实体被Kill输入时响应此输出。