This article's documentation is for anything that uses the Source engine. Click here for more information.

env_particlescript

From Valve Developer Community
Jump to: navigation, search
English (en)中文 (zh)
... Icon-Important.png

env_particlescript is a point entity available in all Source Source games.一个可以播放指定的特殊模型动画的实体。

In code, it is represented by theCEnvParticleScriptclass, defined in theenv_particlescript.cppfile.

键值

BaseAnimating:

World Model (model) <string简体中文> | 字符串
需要被使用的模型,限制128字符长度。
Skin (skin or ModelSkin Alien Swarm) <integer> | 整数
一些模型带有不同的皮肤,0为默认。
Collisions (solid) <choices>
该实体的碰撞方式。
Warning icon.png
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 hereIf 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.
Hitbox Set (hitboxset) <string简体中文> | 字符串 不存在于FGD!
设置使用的 $hboxset
Body Group (body or SetBodyGroup) <integer> | 整数 不存在于FGD!
设置模型的 $bodygroup
Model Index (modelindex) <short> 不存在于FGD!
给定转储cl_precacheinfo modelprecache表的数字索引将实体模型设置为索引的。
Warning.pngWarning:如果实体具有将要播放的动画,则设置模型也必须有自己的序列,否则游戏会崩溃。
Model Scale (modelscale) <float> | 浮点型 (存在于自 Half-Life 2: Episode Two 以来) (存在于 Portal Left 4 Dead series Source 2013 中) 不存在于FGD!
模型大小的乘数。接受负值。然而,在大多数情况下不会改变物理碰撞。
Warning.pngWarning:负值或极高值可能导致崩溃!

动画

Sequence (sequence) <integer> | 整数 不存在于FGD!
模型生成后播放的默认动画序列。
Playback Rate (playbackrate) <float> | 浮点型 不存在于FGD!
播放动画的 framerate 的乘数,接受负值。默认值为 1.0
Cycle (cycle) <float> | 浮点型 不存在于FGD!
当前动画的当前帧,范围为 0-1。
Texture Frame (texframeindex) <integer> | 整数 不存在于FGD!
此实体上所有动画纹理的初始帧编号。

效果——渲染

Start Fade Distance (fademindist) <float> | 浮点型
实体开始淡出的距离。如果为 0 或更小,实体将在结束淡入淡出时立即消失。如果实体位于三维天空盒中,该值将适当缩放。
End Fade Distance (fademaxdist) <float> | 浮点型
实体结束淡出的距离。如果为 0 或更小,则实体根本不会消失。如果实体位于三维天空盒中,该值将适当缩放。
Fade Scale (fadescale) <float> | 浮点型
如果在worldspawn中指定,或者如果引擎在 DirectX 8 下运行,即使没有指定上面的淡出距离,实体也会淡出。这个值可以更好地控制何时发生这种情况:小于 1 的数字会导致实体在更远的距离淡出,而大于 1 的数字会导致它在更近的距离淡出。使用 0 会完全关闭强制淡入淡出。另见$noforcedfade
Render FX / Transparency (0 - 255) (renderamt) <integer> | 整数
透明度数,需要正常以外的渲染模式。 0 是不可见的,255 是完全可见的。
Render Color (R G B) (rendercolor) <color255简体中文>
色调。
Render FX (renderfx) <choices>
外观效果的预设模式。


Render Mode (rendermode) <choices>
在此实体上设置非标准渲染模式。


效果——环境

Disable Shadows (disableshadows) <boolean> | 布尔值
防止实体创建廉价的渲染到纹理阴影。不影响阴影贴图
Disable Receiving Shadows (disablereceiveshadows) <boolean> | 布尔值
防止实体接收自身的阴影。
Shadow Cast Distance (shadowcastdist) <integer> | 整数
设置实体投射动态阴影的距离。 0 表示与 shadow_control 实体的默认距离。
Lighting Origin (LightingOrigin) <targetname> | 目标名
选择一个实体(不是info_lighting实体!)从这个点采样照明而不是实体的原点
Lighting Origin Offset (LightingOriginHack) <targetname> | 目标名 (存在于 Left 4 Dead series 中) 不存在于FGD!
info_lighting_relative从这个点采样照明而不是实体的原点。
Disable Flashlight (disableflashlight) <boolean> | 布尔值 (in all games since Portal 2)
用于禁用该实体上的投影纹理的光照和阴影。
Disable ShadowDepth (disableshadowdepth) <boolean> | 布尔值 (in all games since Portal 2)
使该实体不会从env_projectedtexture实体投射阴影。
Projected Texture Cache (shadowdepthnocache) <choices> (in all games since Portal 2)
用于提示投影纹理系统是否足以缓存该实体的阴影体积或强制每帧渲染它。
  • 0: Default
  • 1: No cache - render every frame
  • 2: Cache it - render only once

其他

Move Type (MoveType) <choices> (存在于自 Alien Swarm 以来) 不存在于FGD!
为这个实体设置一个移动类型,这会改变它的移动行为。


Collision Group (CollisionGroup) <choices> (存在于自 Alien Swarm 以来) 不存在于FGD!
为这个实体设置一个碰撞组,这会改变它的碰撞行为。


No Animation Sounds (SuppressAnimSounds) <boolean> | 布尔值 (in all games since Portal 2) 不存在于FGD!
静音与动画相关的声音。

SystemLevelChoice:

Minimum CPU Level (mincpulevel) <choices> (in all games since Left 4 Dead)
CPU级别低于此级别的将不在游戏内呈现此对象,级别由视频设置内的效果细节决定。
Maximum CPU Level (maxcpulevel) <choices> (in all games since Left 4 Dead)


Note.pngNote:键值的名称是因为cpu_level命令;效果详细信息使用的命令。
Minimum GPU Level (mingpulevel) <choices> (in all games since Left 4 Dead)
GPU级别低于此级别的将不在游戏内呈现此对象,级别由视频设置内的Shader细节决定。
Maximum GPU Level (maxgpulevel) <choices> (in all games since Left 4 Dead)


Note.pngNote:键值的名字是因为gpu_level命令; Shader Details 使用的命令。

Base/基础:
Name (targetname) <string简体中文> | 字符串
其他实体用来指代该实体的名称。
Parent简体中文 (parentname) <targetname> | 目标名
实体的父级实体,该实体可以与父实体保持移动偏移。名称后面可以添加一个附属点,以逗号隔开。 (parentname [targetname],[attachment]
Tip.pngTip:转换至下一张地图的实体关系会依然存在。
Tip.pngTip:一些不适合做父实体的实体可能难以运行,利用phys_constraint可以解决。
Origin (X Y Z) (origin) <coordinates>
实体处于世界中的位置,旋转实体会以实体坐标原点旋转。
Note.pngNote:Hammer 不会仅在编辑器中相应地移动实体。
Pitch Yaw Roll (X Y Z) (angles) <angle>
实体在世界中的方位,Pitch围绕X轴旋转,可以称为俯仰角。Yaw围绕Z轴旋转,可以称为偏航角,roll围绕Y轴旋转。
Note.pngNote:尽管 Hammer 不显示新角度,但其仍然适用于固实体。
Classname (classname) <string简体中文> | 字符串 不存在于FGD!
确定实体之前它生成的特征。
Tip.pngTip:使用AddOutput输入更改 Classname 仍然会影响游戏的代码,例如使类名与 S_PreserveEnts 列表中的一个元素匹配将使实体在新一轮中持续存在!
Flags (spawnflags) <integer> | 整数 不存在于FGD!
实体所具有的标志/标签,依实体所具有而定。
Effects (effects) <integer> | 整数 不存在于FGD!
要使用的效果标志的组合。
Entity Scripts简体中文 (vscripts) <scriptlist> | 脚本列表 (存在于自 Left 4 Dead 2 以来)
在所有实体生成后执行的 VScript简体中文 文件(无文件扩展名)的空格分隔列表。这些脚本都在同一个脚本范围内执行,以后的脚本会覆盖任何相同的变量和函数。
Thinker Function简体中文 (thinkfunction) <string简体中文> | 字符串 (存在于自 Left 4 Dead 2 以来)
此实体脚本中的函数名称,该函数将在脚本持续时间内每 100 毫秒(每秒 10 次)自动调用一次。它可用于创建计时器或模拟自主行为。返回值(如果存在)将设置下一次调用之前的时间。尽量避免在此函数中进行昂贵的操作,因为它可能会导致性能问题。
Lag Compensation (LagCompensate) <boolean> | 布尔值 (存在于自 Left 4 Dead 2 以来) 不存在于FGD!
设置为以延迟补偿此实体。应该非常谨慎地使用!
Is Automatic-Aim Target (is_autoaim_target) <boolean> | 布尔值 (in all games since Counter-Strike: Global Offensive) 不存在于FGD!
如果设置为 1,当实体位于十字准线下方时,该实体将减慢控制台和操纵杆控制器的瞄准移动速度。


输入

SetSequence <字符串>
设置模型动画序列。

Model:
skin<integer> | 整数
从模型的索引中选择一个 skin English,从 0 开始。
SetBodyGroup<integer> | 整数
设置激活的 $bodygroup English
Ignite
使实体无限期着火。
IgniteLifetime<float> | 浮点型
使实体在给定时间内着火。
BecomeRagdoll
杀死实体并从模型中创建一个客户端范围的布娃娃。仅当模型包含 $collisionjoints English 时才传递输入。对于其他模型,可以使用 phys_convert English 代替。
SetLightingOrigin<targetname> | 目标名
将实体的照明原点设置为指定实体的位置。
fademindist<float> | 浮点型
设置实体开始淡出的距离。如果 <0,实体将在结束淡入淡出时立即消失。如果实体在3D天空盒中,该值将适当缩放。
fademaxdist<float> | 浮点型
设置实体结束淡出的距离。如果 <0,则实体根本不会消失。如果实体在 3D天空盒 中,该值将适当缩放。
SetCycle<float> | 浮点型 (仅存在于 Team Fortress 2 中)
跳到当前动画中的特定点。
SetModel<string简体中文> | 字符串 (仅存在于 Team Fortress 2 中)
将模型更改为指定的路径。格式:models/ammo/ammo_us.mdl
Important template.gif 重要: 绝对没有引号!确保使用正斜杠“/”。Merasmus English 说要听从这个建议,否则你会破坏 VMF 的结构。
SetPlayBackRate<float> | 浮点型 (仅存在于 Team Fortress 2 中)
更改动画速度倍数。
Alpha<integer> | 整数
将实体的透明度设置为从 0(不可见)到 255(完全可见)的数字。要求实体将其键值 Render Mode (rendermode) 设置为0以外的数字。
AlternativeSorting<boolean> | 布尔值
交换实体的渲染顺序。用于在渲染时尝试修复排序问题,例如在半透明材质前渲染对象。
Color<color255简体中文>
为实体设置 RGB 颜色。
SetDamageFilter<targetname> | 目标名
为该实体设置一个过滤器,用于当它受到伤害时。
EnableDamageForces
允许实体因对其造成的伤害而被推动(通常力的大小与造成的伤害相关)。
DisableDamageForces
防止实体受到对其造成的伤害而被推动。

Reflection:
DisableDrawInFastReflection (in all games since Portal 2)
在水材质中使用$reflectonlymarkedentities时,在反射中关闭此实体的渲染。
EnableDrawInFastReflection (in all games since Portal 2)
在水材质中使用$reflectonlymarkedentities时,在反射中打开此实体的渲染。

Shadow:
DisableShadow
为该实体关闭动态阴影
EnableShadow
为该实体开启\动态阴影。
DisableReceivingFlashlight (存在于自 Portal 2 以来)
该对象不会接收来自投影纹理的光或阴影。
EnableReceivingFlashlight (存在于自 Portal 2 以来)
该对象可能会从投影纹理接收光或阴影。

Base:
AddContext<string简体中文> | 字符串
添加到实体的 Response Contexts/响应上下文列表。格式是<key>:<value>
AddOutput<string简体中文> | 字符串
在此实体上分配新的键值/输出。对于键值,有些依赖于额外的必要代码来运行,如果它只是通过这个输入改变就行不通。必须遵循严格的格式:
语法:

ClearContext
从此实体的列表中删除所有上下文。
ClearParent
从移动层次结构中删除该实体,使其可以自由移动。
FireUser1FireUser4
触发相应的OnUser输出;详见 User Inputs and OutputsEnglish
Kill
从这个世界中删除此实体。
KillHierarchy
功能类似Kill,尽管此实体与其父实体都被删除了,但比Kill快一点。
RemoveContext
从实体列表删除一个上下文。名字应与现有上下文进行匹配。
SetParent<string简体中文> | 字符串
跟随此实体移动,详见 实体层级(依赖关系)
SetParentAttachment<string简体中文> | 字符串
更改此实体到其父级上的特定附属English点。实体将传送,以至于其骨骼方位English与附属匹配。在使用此输入前必须设置好实体的父实体。
SetParentAttachmentMaintainOffset<string简体中文> | 字符串
同上,但没有传送。在接收到输入时,实体保持其相对于附件的位置。
Use 不存在于FGD!
与调用 +use English 的玩家相同[玩家按 +use(使用,默认E按钮)];大多数情况下没有影响。
DispatchResponse<string简体中文> | 字符串 不存在于FGD!
向实体发送一个上下文。 详见 ResponseEnglishConceptEnglish.
DispatchEffect<string简体中文> | 字符串 (自从 Left 4 Dead移除) 不存在于FGD!
在实体的原点坐标设置一个特定效果;参见 List of Client EffectsEnglish。自从Left 4 Dead Left 4 Dead后由粒子系统取代。
RunScriptFile<script> | 脚本 (存在于自 Left 4 Dead 2 以来)
从硬盘执行一个 VScript 脚本文件,不带文件后缀名。会合并接收实体的脚本域。
RunScriptCode<string简体中文> | 字符串 (存在于自 Left 4 Dead 2 以来)
在接收输入的实体范围内执行一串 VScript 源代码。通过控制台触发时可能需要字符串引用。
Icon-Bug.pngBug:在 Hammer 中,使用带有字符串的参数会破坏 VMFEnglish 文件的结构,使下一个 Hammer 会话无法查看该文件。
Fix: 使用文本编辑器手动删除带有字符串的参数。
CallScriptFunction<string简体中文> | 字符串 (存在于自 Left 4 Dead 2 以来) 不存在于FGD!
在接受实体脚本域上执行一段 VScript 函数。
SetLocalOrigin<coordinates> (存在于自 Alien Swarm 以来) 不存在于FGD!
将此实体设置到地图中的某个位置。如果此实体是某实体父级,那么它的子级也会随着移动。
SetLocalAngles<angles> (存在于自 Alien Swarm 以来) 不存在于FGD!
设置该实体的角度。

Outputs

Model:

OnIgnite  !FGD
Fired when the entity catches fire, such as from an env_entity_igniter or the Ignite inputs.
OnFizzled  (only in Portal 2)
Fired when this entity is fizzled by a trigger_portal_cleanser or, for prop_weighted_cube, the Dissolve or SilentDissolve inputs.
Icon-Bug.pngBug:It does not fire when the object is fizzled by other means such as env_entity_dissolver.

Base/基础:

OnUser1OnUser4
这些输出将分别响应于 FireUser1FireUser4 输入。 详见 User Inputs and Outputs
OnKilled (only in Left 4 Dead series)
当实体被Kill输入时响应此输出。