env_particlescript

From Valve Developer Community
Jump to: navigation, search
English

env_particlescript是一个点实体,可用于所有Source游戏。一个可以播放指定的特殊模型动画的实体。 在源代码中,它由classCEnvParticleScript代表,定义在env_particlescript.cpp

键值

Model:

World Model (model) <字符串>
需要被使用的模型,限制128字符长度。
Skin (skin or ModelSkin <Alien Swarm>) <整数型>
一些模型带有不同的皮肤,0为默认。
Collisions (solid) <choices>
该模型的碰撞方法。
Body Group (body or SetBodyGroup) <整数型> !FGD
设置模型的 $bodygroup.
Hitbox Set (hitboxset) <字符串> !FGD
设置使用的 $hboxset
Sequence (sequence) <整数型> !FGD
当模型生成后的默认播放动画。
Playback Rate (playbackrate) <浮点型> !FGD
播放帧数的倍率,默认1.0,接受负值。
Cycle (cycle) <浮点型> !FGD
当前播放动画的目前帧,范围0~1。
Lighting Origin (LightingOrigin) <targetname>
选择一个实体(非 info_lighting!) 作为光照采样代替此实体的坐标.
Lighting Origin Offset (LightingOriginHack) <targetname> !FGD
由实体info_lighting_relative 处采样而不是实体坐标,不存在于 <Left 4 Dead><Left 4 Dead 2>.
Damage Filter Name (damagefilter) <targetname>
仅限符合此过滤器的实体才会对此实体造成伤害。
Start Fade Distance (fademindist) <浮点型>
开始淡入淡出的范围,小于0会在end fade处立刻消失,在远景盒子会适当放大距离。
End Fade Distance (fademaxdist) <浮点型>
结束淡入淡出的范围。小于0则不会消失,在远景盒子会适当放大距离。
Fade Scale (fadescale) <浮点型>
If specified in the worldspawn, or if the engine is running below DirectX 8, entities will fade out even if the fade distances above aren't specified. This value gives more control over when this happens: numbers smaller than 1 cause the entity to fade out at further distances, and greater than 1 cause it to fade out at closer distances. Using 0 turns off the forced fade altogether. See also $noforcedfade.
Render Mode (rendermode) <choices>
渲染模式。
Render FX / Transparency (0 - 255) (renderamt) <整数型>
透明度,0为完全看不见,255为完全可见。
Render Color (R G B) (rendercolor) <color255>
颜色。
Render FX (renderfx) <choices>
外观渲染模式。
To do: 18-21, 25
Shadow Cast Distance (shadowcastdist) <整数型>
投射动态阴影的距离,0代表由实体shadow_control决定。
Disable Shadows (disableshadows) <布尔型>
关闭阴影。
Disable Receiving Shadows (disablereceiveshadows) <布尔型>
防止接收自身阴影。
Model Index (modelindex) <短型> !FGD
将实体模型改变为当前地图预缓存模型。
Warning: 用无效值会让游戏崩溃,包括0和1。
Texture Frame (texframeindex) <整数型>
The frame number for any animated textures on this entity.
Model Scale (modelscale) <float> (New with Half-Life 2: Episode Two / Source 2007) !FGD
改变模型缩放大小,不会修改碰撞体积。不存在于 [Portal], <Left 4 Dead>, <Left 4 Dead 2>, sdk 2013.
Warning: Negative or extremely high values can cause crashes!
Minimum CPU Level (mincpulevel) <choices> (New with Left 4 Dead)
A user with a CPU level lower than this will not see this object rendered in-game. It's unclear how the CPU level is decided, but most systems are classified as "high".
Maximum CPU Level (maxcpulevel) <choices> (New with Left 4 Dead)
  • 0: Default
  • 1: Low
  • 2: Medium
  • 3: High
Minimum GPU Level (mingpulevel) <choices> (New with Left 4 Dead)
Maximum GPU Level (maxgpulevel) <choices> (New with Left 4 Dead)
  • 0: Default
  • 1: Very low
  • 2: Low
  • 3: Medium
  • 4: High
Glow Backface Multiple (glowbackfacemult) <float> (New with Left 4 Dead 2) !FGD
If this object has a glow effect, multiply the effect by this much on the sides of the object that are facing away from the viewer.
Move Type (MoveType) <choices> (New with Alien Swarm) !FGD
Sets a movetype for this entity, which changes its movement behavior.
Collision Group (CollisionGroup) <choices> (New with Alien Swarm) !FGD
Sets a collision group for this entity, which changes its collision behavior.
No Animation Sounds (SuppressAnimSounds) <boolean> (New with Portal 2) !FGD
Silences sounds linked to animations.
Disable ShadowDepth (disableshadowdepth) <boolean> (New with Portal 2)
Makes this entity not cast a shadow from env_projectedtextures.
Projected Texture Cache (shadowdepthnocache) <choices> (New with Portal 2)
Used to hint projected texture system whether it is sufficient to cache shadow volume of this entity or to force render it every frame instead.
  • 0: Default
  • 1: No cache - render every frame
  • 2: Cache it - render only once
Disable Flashlight (disableflashlight) <boolean> (New with Portal 2)
Used to disable projected texture lighting and shadows on this entity.

Base:

Classname (classname) <string>
实体名称。实体名称可以用AddOutput来修改,有可能导致错误,影响引擎的处理方式。
Name (targetname) <string>
自己可定义的实体名字,注意,classname是实体名(如prop_static)而不是其名字!
Global Entity Name (globalname) <string>
实体链接到下一张图采用的名称,当玩家过度到下一张图的时候,会保持上一张图实体的状态。
Parent (parentname) <targetname>
实体的父级实体,该实体可以与父实体保持移动偏移。名称后面可以添加一个附属点,以逗号隔开。 任何实体都可以是父实体,甚至是点实体。 转换至下一张地图的实体关系会依然存在。例如 trigger_transition, 一些不适合做父实体的实体可能难以运行,利用 phys_constraint 可以解决。*注:翻译略有出入,请只在意第一句或查看原文(英文)。
Origin (X Y Z) (origin) <coordinates>
实体处于世界中的位置,旋转实体会以实体坐标原点旋转。
Pitch Yaw Roll (X Y Z) (angles) <angle>
实体在世界中的方位,Pitch围绕X轴旋转,可以称为俯仰角。Yaw围绕Z轴旋转,可以称为偏航角,roll围绕Y轴旋转,可以称为翻滚角。
注意:尽管Hammer不显示新角度,但其仍然适用于固实体。
Flags (spawnflags) <integer>
实体所具有的标志/标签,依实体所具有而定。
Response Contexts (ResponseContext) <string>
实体预定义的响应上下文(链接上下文)。格式:key:value,key:value,...。可以由filtered过滤。
Effects (effects) <integer> !FGD
效果标志,在hammer中不显示,但它确确存在。
Local Time (ltime) <float> !FGD
实体的本地时间,区别于全局时间,主要用于物理效果计算,在hammer中不显示。
Next Think (nextthink) <float> !FGD
实体再次 thinks 时间。在hammer中不显示。
Hammer ID (hammerid) <integer> !FGD
实体的Hammer ID。主要用于插件和debug指令,如ent_keyvalue. 可以用"hammerid" 或者 "id" 键值来手动分配. 在run-time时候生成的实体不会分配ID。在hammer中不显示。
Disable for Xbox 360 (disableX360) <boolean> (New with Left 4 Dead 2) !FGD
如果设置为"Yes",在XBOX360游戏机上不显示此实体。
Entity Scripts (vscripts) <scriptlist> (New with Left 4 Dead 2)
实体生成后可通过输出调用的VScript脚本文件,所有脚本都处于同一脚本域,会覆盖相同名称的变量和功能函数等。
Script think function (thinkfunction) <string> (New with Left 4 Dead 2)
脚本功能函数名,每秒自动会调用此函数10次,比较于logic_timer更方便。 请避免 expensive(昂贵)的效果操作,会损失性能。
Lag Compensation (LagCompensate) <boolean> (New with Left 4 Dead 2) !FGD
设置"Yes"会延迟补偿该实体,请谨慎使用。在hammer中不显示。
Is Automatic-Aim Target (is_autoaim_target) <boolean> (New with Counter-Strike: Global Offensive) !FGD
设置为"1"会减慢该实体在十字准心下方时,控制杆的瞄准运动。

输入

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

Model:

skin <integer>
Selects a skin from the model's index, starting with 0.
SetBodyGroup <integer>
Sets the the active $bodygroup.
Ignite
Makes the entity catch on fire indefinitely.
IgniteLifetime <float>
Makes the entity catch on fire for a given amount of time.
IgniteNumHitboxFires <integer>
Makes the entity catch on fire with a given number of hitbox fire particles. Does not function correctly in <Left 4 Dead 2> onward.
IgniteHitboxFireScale <float>
Makes the entity catch on fire with a given scale for hitbox fire particles. Does not function correctly in <Left 4 Dead 2> onward.
BecomeRagdoll
Kills the entity and creates a client-side ragdoll from the model. Input is only passed if the model contains $collisionjoints, for other models phys_convert can be used instead.
SetLightingOrigin <targetname>
Sets the entity's lighting origin to use this entity's position.
SetLightingOriginHack <targetname>
Offsets the entity's lighting origin by their distance from an info_lighting_relative.
Note:Not available in <Left 4 Dead><Left 4 Dead 2>.
fademindist <float>
Sets distance at which the entity starts fading. If <0, the entity will disappear instantly when end fade is hit. The value will scale appropriately if the entity is in a 3D Skybox.
fademaxdist <float>
Sets distance at which the entity ends fading. If <0, the entity won't disappear at all. The value will scale appropriately if the entity is in a 3D Skybox.
SetModelScale <vector>
Only available for <Team Fortress 2><Half-Life 2>. Multiplies the size of the model. Does not alter the physics collisions in most cases, however. Negative values are accepted. Takes two values separated by a space. The first is the target model scale. The second value is the number of seconds the change in scale will be spread over.
Tip:The modelscale keyvalue can be AddOutputed as a workaround for other games with this input missing.

Warning: Negative or extremely high values can cause crashes!

Alpha <integer>
设置模型透明的。0为完全不可见,255为完全可见。
AlternativeSorting <boolean>
设置模型渲染序列,防止在半透明材质前不渲染。
Color <color255>
颜色。
SetDamageFilter <targetname>
设置过滤器 for this entity for when it receives damage.
EnableDamageForces
允许受到伤害.
DisableDamageForces
防止受到伤害。
EnableShadow
开启阴影。
DisableShadow
防止阴影。
EnableDraw  (New with Portal 2)
Removes EF_NODRAW from the entity.
DisableDraw  (New with Portal 2)
应用EF_NODRAW,那么客户端不会接收任何有关此实体的信息,但服务器仍存在此实体。
EnableReceivingFlashlight  (New with Portal 2)
Makes it so that the entity is lit by env_projectedtextures.
DisableReceivingFlashlight  (New with Portal 2)
Prevents the entity from being lit by env_projectedtextures. The shadow made by the texture will still cast.
EnableDrawInFastReflection  (New with Portal 2)
Makes the entity be rendered in reflections from water materials using $reflectonlymarkedentities.
DisableDrawInFastReflection  (New with Portal 2)
Prevents the entity from rendering in fast reflections.

基础:

Kill
从这个世界中删除此实体。
KillHierarchy
功能类似于Kill,尽管此实体与其父实体都被删除了,但比Kill快一点。
SetParent  <字符串>
跟随此实体移动,详见Entity Hierarchy (parenting).
SetParentAttachment  <字符串>
修改此实体到父实体的特定附属点。实体会传送,以至于其骨骼方位与附属匹配。在使用此输入前必须设置好实体的父实体。
SetParentAttachmentMaintainOffset  <字符串>
同上,但不传送。实体接受到此输出后保留与父级的相对位置。
ClearParent
取消绑定父实体,以至于此实体可以自由行动。
AddOutput  <字符串>
评估此实体的输出/键值(类似于增加输出给某实体)。
格式: <key/键> <value/值>
格式: <output name/输出名> <targetname/目标名>:<inputname/输入名>:<parameter/参数>:<delay/延迟>:<最大触发数,-1代表无限。>
FireUser1 to FireUser4
触发OnUser输出; 详见 User Inputs and Outputs
Use  !FGD
类似于玩家按 +use(使用,默认E按钮); 也许不会做什么事! 也可以通过创建未指定的输入来调用输出。
这个输入不存在于Valve的 FGD中。
DispatchEffect  <字符串> !FGD
在实体的原点坐标设置一个特定效果。自从<Left 4 Dead>后由粒子系统取代。
DispatchResponse  <字符串> !FGD
向实体发送一个上下文。 详见 ResponseConcept.
AddContext  <字符串>
添加到实体的response contexts/响应上下文列表。格式<key/键>:<value/值>.
RemoveContext  <字符串>
从实体列表删除一个上下文。名字应与现有上下文进行匹配。
ClearContext  <字符串>
删除实体的所有上下文。
RunScriptFile  <script> (New with Left 4 Dead 2)
从硬盘执行一个VScript脚本文件,不带文件后缀名。会合并接收实体的脚本域。
RunScriptCode  <字符串> (New with Left 4 Dead 2)
(执行脚本代码。)执行一段接收实体域的脚本源代码。通过控制台触发,可能需要英文双引号。
Bug: <Left 4 Dead 2>中,该代码是触发输出的实体的脚本域中执行, 接受输入的实体。
警告:切勿在此输入的元素内使用字符串!它将破坏VMF ,由嵌套引号引起!你必须用文本编辑器手动删除来修复!
CallScriptFunction  <字符串> (New with Left 4 Dead 2) !FGD
在接受实体脚本域上执行一段vscript函数。
SetLocalOrigin  <坐标> (New with Alien Swarm) !FGD
将此实体设置到地图上某点。如果此实体是某实体父级,那么它的子级也会随着偏移。
SetLocalAngles  <角度> (New with Alien Swarm) !FGD
设置实体的角度(朝向)。

Outputs

Model:

OnIgnite
Fired when the entity catches fire, such as from an env_entity_igniter or the Ignite inputs.
OnFizzled  (New with Portal 2)
Fired when this entity is fizzled by a fizzler or any other means. (Except the Dissolve input. Use SilentDissolve instead.)

基础:

OnUser1 to OnUser4
这些输出将分别响应于FireUser1 to FireUser4 输入。 详见 User Inputs and Outputs.
OnKilled  (Only in the Left 4 Dead series)
当实体被Kill输入时响应此输出。