这篇条目有关 Source引擎。如需详情,点击这里。

prop_dynamic

From Valve Developer Community
< Zh
Jump to navigation Jump to search
English (en)中文 (zh)Translate (Translate)
类层级
CDynamicProp
CBreakableProp
CBaseProp
CBaseAnimating
CBaseEntity
props.cpp

prop_dynamic是一个模型实体,可在所有的 起源 起源 游戏中使用。 用于放置可播放骨骼动画(en)模型实体(en)

Tip.png提示:若模型无需运动且需要精细光照,建议使用性能更优的prop_static
Note.png注意:默认禁止使用含内置物理数据(en)的模型。通过Hammer模型浏览器的信息标签检查兼容性。如需强制使用物理模型,请改用prop_dynamic_override
AltNames.pngAltNames: 此实体也绑定到 dynamic_prop。 生成时类名会自动转为prop_dynamic

典型应用

  • 按钮机关:将本实体与func_button笔刷绑定后,对模型按use键可触发按钮。通过SetAnimation输入实现交互动画

键值(Keyvalues)

参见:  Generic Keyvalues, Inputs and Outputs available to all entities
Name(en) (targetname) <target_source>
其他实体引用该实体的目标名称。
Default Animation (DefaultAnim) <字符串(en)>
空闲状态播放的动画

{{KV|Randomly Animate|intn=RandomAnimation|bool|在最小/最大随机间隔间随机播放动画{{note|仅选择标记为ACT_IDLE的[[$sequence|动画序列}}}}

Min Random Anim Time (MinAnimTime) <浮点型(en)>
随机动画最短间隔(秒)
Max Random Anim Time (MaxAnimTime) <浮点型(en)>
随机动画最长间隔(秒)
Collisions (solid) <integer choices(en)>
物理交互方式:
  • 0 - 无碰撞
  • 2 - 使用包围盒
  • 6 - 启用物理引擎(默认)
Update children (updatechildren) <布尔值(en)> (存在于自 求生之路 以来)
实时更新附着点子项的碰撞检测
Disable Bone Followers (DisableBoneFollowers) <布尔值(en)> (存在于自 起源2009 以来)
禁用phys_bone_follower生成以节省资源
Tip.png提示:无此选项时可改用prop_dynamic_override设置无碰撞
Hold Animation (HoldAnimation) <布尔值(en)> (存在于自 异形丛生 以来)
动画播放完后定格在最后一帧
Animate Every Frame (AnimateEveryFrame) <布尔值(en)> (存在于自 传送门2 以来)
强制每帧更新动画
Ignore NPC Collisions (IgnoreNPCCollisions) <choices> (存在于 黑山 之中)
禁用与生物实体的碰撞检测
  • 0: 否
  • 1: 是

BaseFadeProp:

Start Fade Dist (fademindist) <浮点型(en)>
Distance at which the entity starts to fade.
End Fade Dist (fademaxdist) <浮点型(en)>
Max fade distance at which the entity is visible.
  • If start fade is <0, the entity will disappear instantly when end fade is hit.
  • If end fade is <0, the entity won't disappear at all. (This is the default behavior.)
The values will scale appropriately if the entity is in a 3D Skybox.
Fade Scale (fadescale) <浮点型(en)>
If you specify so in worldspawn, or if the engine is running below DirectX 8 (DX7 in 起源2006), props will fade out even if the fade distances above aren't specified. This value gives you some control over when this happens: numbers smaller than 1 cause the prop to fade out at further distances, while those greater than 1 cause it to fade out at closer distances. Using 0 turns off the forced fade altogether. See also the QC command $noforcedfade.


渲染模式(en) (rendermode) <byte choices(en)>
在此实体上设置非标准渲染模式。
Render Modes
  • 0: 正常
  • 1: 颜色
  • 2: 纹理
  • 3: 发光
  • 4: 实体/阿尔法测试 Obsolete
  • 5: 叠加
  • 6: 已移除,无作用 Obsolete
  • 7: 叠加分数帧
  • 8: 阿尔法叠加
  • 9: 世界空间发光
  • 10: 不渲染
Render FX(en) (renderfx) <byte choices(en)>
各种有点遗留的阿尔法效果。请参见渲染效果(en)
Render Amount / Transparency (0–255) (renderamt) <整数 0-255 (en)>
需配合非Normal渲染模式
Render Color (R G B) (rendercolor) <color255(en)>
RGB颜色值

Glow:

Glow State (glowstate) <choices> (存在于 求生之路2 之中)
  • OFF
  • +use
  • look-at
  • ON
Glow Range (glowrange) <整数(en)> (存在于 求生之路2 之中)
Range at which the glow becomes visible. 0 means always visible.
Glow Range Min (glowrangemin) <整数(en)> (存在于 求生之路2 之中)
Range at which the glow stops being visible. 0 means always visible.
Glow Color Override (R G B) (glowcolor) <color255(en)> (存在于 求生之路2 之中)
Change the render color of the glow.

BreakableProp:

Explosion Damage (ExplodeDamage) <浮点型(en)>
If non-zero, when this entity breaks it will create an explosion that causes the specified amount of damage. See also Explosion Radius.
Explosion Radius (ExplodeRadius) <浮点型(en)>
If non-zero, when this entity breaks it will create an explosion with a radius of the specified amount. See also Explosion Damage.
Sound to make when punted (puntsound) <sound(en)> (存在于自 半衰期2:第一章 以来)
Sound to make when punted by gravity gun.
Break Model Message (BreakModelMessage) <字符串(en)> (存在于 起源2013 之中)
"If set, will use this break model message instead of the normal break behavior."

Breakable (common):

Performance Mode (PerformanceMode) <choices>
Used to limit the amount of gibs produced when this entity breaks, for performance reasons.
Choices
  • 0: Normal
  • 1: No Gibs
  • 2: Full Gibs on All Platforms (Xbox 360, PS3, etc)
  • 3: Reduced gibs
Min Damage to Hurt (minhealthdmg) <整数(en)>
If a single hit to the object doesn't do at least this much damage, the prop won't take any of the damage it attempted to give.
Pressure Delay (PressureDelay) <浮点型(en)>
Seconds to delay breaking from pressure. Allows creaking/groaning sounds to play.
Health (health) <整数(en)>
How close to breaking the object is.
Maximum Health (max_health) <整数(en)>
Health cannot exceed this amount.
Physics Impact Damage Scale (physdamagescale) <浮点型(en)>
Multiplier for damage amount when this entity is hit by a physics object. With a value of 0 the entity will take no damage from physics.
Breakable By (BreakableType) <choices> (存在于 求生之路系列求生之路系列 之中)
Who can break this?
  • 0: Everyone
  • 1: All Infected
  • 2: Only Tanks

CBaseAnimating:

World Model (model) <model(en)>
The model this entity should appear as. 128-character limit.
Skin (skin) <整数(en)>
Some models have multiple skins. This value selects from the index, starting with 0. May be overridden by game code.
Tip.png提示:Hammer's model browser automatically updates this value if you use it to view different skins.
Model Scale (modelscale) <浮点型(en)> (存在于自 异形丛生 以来) (也存在于 起源2013 之中)
A multiplier for the size of the model.
Tip.png提示:In Hammer++ Hammer++ with a prop selected in 3D view, hold Ctrl and scroll the mouse wheel to change the modelscale in increments of 0.5. Holding Shift will scale it in smaller increments of 0.05.
Bodygroup (body / SetBodyGroup) <整数(en)>
Some models have multiple submodels. This value selects from the index, starting with 0. May be overridden by animations and/or game code.
Note.png注意:If both body and SetBodyGroup are present (even if set to 0), body will be prioritized.


Lighting Origin (lightingorigin) <target_destination>
Select an entity (not info_lighting!) from which to sample lighting and cubemaps instead of the entity's $illumposition.

阴影:

Disable Shadows (disableshadows) <布尔值(en)>
防止该实体生成廉价的渲染到纹理的阴影,或如果实体是 prop_static 的光照贴图阴影。不影响影子映射。
禁用接收阴影 (disablereceiveshadows) <布尔值(en)>
防止该实体接收动态阴影。
Shadow Cast Distance (shadowcastdist) <整数(en)> 不存在于FGD!
设置实体投射动态阴影的距离。0 表示从 shadow_control 实体开始的默认距离。
Disable Shadow Depth (disableshadowdepth) <布尔值(en)> (存在于自 传送门2 以来)
用于禁用此实体的阴影深度(用于投影纹理)的渲染。
Disable flashlight (disableflashlight) <布尔值(en)> (存在于自 传送门2 以来)
用于禁用此实体的投影纹理照明和阴影。
Projected Texture Cache (shadowdepthnocache) <integer choices(en)> (存在于自 传送门2 以来)
用于提示投影纹理系统缓存此实体的阴影体积是否足够,或改为强制每帧渲染。
选项
  • 0 : 默认
  • 1 : 无缓存 - 每帧渲染
  • 2 : 缓存 - 只渲染一次
Render in Fast Reflections (drawinfastreflection) <布尔值(en)> (存在于自 传送门2 以来)
If enabled, this entity will render in fast water reflections (i.e. when a water material specifies $reflectonlymarkedentities) and in the world impostor pass.

GMODSandbox:

Allow Physics Gun (gmod_allowphysgun) <布尔值(en)> (存在于 Garry's Mod 之中)
If set, players cannot use Physics Gun on this entity.
Sandbox Tool Whitelist (gmod_allowtools) <字符串(en)> (存在于 Garry's Mod 之中)
If set, only given tools can be used on this entity. You need to supply the tool class names, the names of the .lua files of those tools. This also includes the context menu properties!

实体属性(Flags)

DynamicProp:

Use Hitboxes for Renderbox : [64]
[Elaborate?]
Disable 物理碰撞 : [128] 不存在于FGD!
Start with collision disabled : [256]

BreakableProp:

Break on Touch : [16]
Break on Pressure : [32]
Will break after being stood on for PressureDelay seconds.
Note.png注意:Some models will break instantly if this is or isn't set. (e.g. militiawindow02_breakable.mdl, window_industrial.mdl)

输入

SetAnimation <字符串(en)>
立即强制播放指定动画
SetDefaultAnimation <字符串(en)>
修改空闲状态动画
SetPlaybackRate <浮点型(en)>
调整动画帧率
TurnOff
通过EF_NODRAW隐藏模型
TurnOn
取消隐藏状态
DisableCollision
设为非固体状态
EnableCollision
恢复碰撞检测
SetAnimationNoReset <字符串(en)> (存在于自 异形丛生 以来)
仅当未播放该动画时触发
FadeAndKill  (存在于自 传送门2 以来)
渐隐后移除实体

Glow:

StartGlowing  (存在于 求生之路2 之中)
Turn on glow effect for this prop.
StopGlowing  (存在于 求生之路2 之中)
Turn off this prop's glow effect.

BreakableProp:

Break
Breaks the breakable.
SetHealth <整数(en)>
Sets a new value for the breakable's health. If the breakable's health reaches zero it will break.
AddHealth <整数(en)>
Adds health to the breakable.
RemoveHealth <整数(en)>
Removes health from the breakable.
physdamagescale <浮点型(en)>
Sets Physics Impact Damage Scale. 0 means this feature is disabled for backwards compatibility.
EnablePhyscannonPickup
Makes the breakable able to picked up by the gravity gun.
DisablePhyscannonPickup
Makes the breakable not able to picked up by the gravity gun.
EnablePuntSound  (存在于自 半衰期2:第一章 以来)
Allow this prop from playing its Punt Sound sound when punted by the gravity gun.
DisablePuntSound  (存在于自 半衰期2:第一章 以来)
Prevent this prop from playing its Punt Sound sound when punted by the gravity gun.

输出

OnAnimationBegun
!activator = none
!caller = this entity
动画起始时触发
OnAnimationDone
!activator = none
!caller = this entity
动画完成时触发

BreakableProp:

OnBreak
!activator = entity that breaks the object
!caller = this entity
Fired when this object breaks.
OnHealthChanged <浮点型(en)>
!activator = entity that caused the health change
!caller = this entity
Fired whenever the health of the breakable has increased or decreased. This output automatically puts the new health amount as a decimal percent (e.g. 45% = 0.45) into the parameter box for inputs, if the mapper does not override the parameter with something else.
OnTakeDamage
!activator = entity that caused the damage
!caller = this entity
Fired when damage is taken.
OnPhysCannonAnimatePreStarted
!activator = none
!caller = this entity
Fired when prop starts its ACT_PHYSCANNON_ANIMATE_PRE activity. Caused by the object being picked up by the gravity gun.
OnPhysCannonAnimatePullStarted
!activator = none
!caller = this entity
Fired when prop has started its ACT_PHYSCANNON_ANIMATE activity. ACT_PHYSCANNON_ANIMATE_PRE plays once, then ACT_PHYSCANNON_ANIMATE starts looping.
OnPhysCannonDetach
!activator = none
!caller = this entity
Fired when prop has started its ACT_PHYSCANNON_DETACH activity (caused by the gravity gun ripping it from a wall).
OnPhysCannonAnimatePostStarted
!activator = none
!caller = this entity
Fired when prop has started its ACT_PHYSCANNON_ANIMATE_POST activity (caused by the player letting the prop go from the gravity gun).
OnPhysCannonPullAnimFinished
!activator = none
!caller = this entity
Fired when prop has finished all gravity gun-related animations.

另请参见