Prop dynamic

From Valve Developer Community
Revision as of 12:31, 14 March 2009 by TomEdwards (talk | contribs)
Jump to navigation Jump to search

prop_dynamic is a core Source engine entity used to add a moving model to a map. "Moving" can mean either animating, or literally travelling between positions within the world. A prop_dynamic will not move around of its own accord however: it must be parented to another entity. For instance, to create a functional Razortrain you would parent the various engines and carriages (as prop_dynamic) to an invisible func_tracktrain.

Dynamic props receive "point lighting": one value, refreshed every frame, is applied to the entire model. Exceptions to this are point_spotlights (per-vertex) and env_projectedtextures (per-pixel).

Dynamic props can be configured to break apart after receiving a given amount of damage. But health set inside the model will override health set in Hammer!

Tip.pngTip:If your model is never going to move, consider using prop_static instead.
Note.pngNote:To enforce consistency, models with embedded physics data cannot by default be used by prop_dynamic. Use the Hammer model browser's Info tab to check for support.

Tips

  • Buttons can be created by enveloping a prop_dynamic button inside an invisible func_button, then using the SetAnimation input.
  • Similarly, levers can be created by enveloping a prop_dynamic lever inside a func_rot_button (or momentary_rot_button). No animations needed this time!

See also

Keyvalues

Parentname:
Parent (parentname) <targetname>
Specifies a movement parent. An entity will maintain its initial offset from its parent. An attachment point can be added to the end of the name, separated by a comma.
Global:
Global Entity Name (globalname) <string>
Name by which this entity is linked to another entity in a different map. When the player transitions to a new map, entities in the new map with globalnames matching entities in the previous map will have the previous map's state copied over their state.
Start Disabled (StartDisabled) <boolean>
Stay dormant until activated (with theEnableinput).
  • solid
<choices> Collisions.
Literal value Description
0 Not Solid
2 Use Bounding Box
6 Use VPhysics

Flags

  • BreakableProp:
Break on Touch : [16]
Break on Pressure : [32]
Will break after being stood on for PressureDelay seconds.
Note.pngNote:Some models will break instantly if this is or isn't set. (e.g. militiawindow02_breakable.mdl, window_industrial.mdl)
  • 64 : Use Hitboxes for Renderbox

Inputs

Parentname:
SetParent <stringRedirectInput/string>
Move with this entity. See Entity Hierarchy (parenting).
SetParentAttachment <stringRedirectInput/string>
Change this entity to attach to a specific attachment point on its parent. The entity will teleport so that the position of its root bone matches that of the attachment. Entities must be parented before being sent this input.
SetParentAttachmentMaintainOffset <stringRedirectInput/string>
As above, but without teleporting. The entity retains its position relative to the attachment at the time of the input being received.
ClearParent
Removes this entity from the the movement hierarchy, leaving it free to move independently.
  • Studiomodel:
Skin <integerRedirectInput/integer>
Changes the model's skin to the specified number.
SetBodyGroup <integerRedirectInput/integer>
Set the model's body group.
AlternativeSorting <booleanRedirectInput/boolean>
Uses an alternative method for telling which objects are in front of others. Use if this object draws incorrectly when seen through transparent things.
SetModelScale <stringRedirectInput/string> (in all games since Alien Swarm) (also in Source 2013)
Sets the model scale. 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. If there is no second value, the model will scale instantly.
Warning.pngWarning:Negative or extremely high values can cause crashes!

Shadow:

DisableShadow
Turn dynamic shadows off for this entity. Identical to applying  EF_NOSHADOW.
EnableShadow
Turn dynamic shadows on for this entity.
DisableReceivingFlashlight  (in all games since Portal 2)
This object will not receive light or shadows from projected textures.
EnableReceivingFlashlight  (in all games since Portal 2)
This object may receive light or shadows from projected textures.

Reflection:

DisableDrawInFastReflection  (in all games since Portal 2)
Turns off rendering of this entity in reflections when using $reflectonlymarkedentities in water material.
EnableDrawInFastReflection  (in all games since Portal 2)
Turn on rendering of this entity in reflections when using $reflectonlymarkedentities in water material.
ToggleDraw:
DisableDraw  (in all games since Portal 2)
Add the EF_NODRAW flag to this entity. Some entities manage this on their own so be aware you can override that value.
EnableDraw  (in all games since Portal 2)
Remove the EF_NODRAW flag from this entity. Some entities manage this on their own so be aware you can override that value.
  • EnableDisable:
Enable / Disable
Enable/disable this entity from performing its task. It might also disappear from view.
  • SetAnimation <string>
Force the prop to play an animation. The parameter should be the name of the animation.
  • SetDefaultAnimation <string>
Set the default animation (DefaultAnim) to the one specified in the parameter."
  • SetBodyGroup <integer>
Set the visible bodygroup, by index.
  • TurnOn
Make the prop visible.
  • TurnOff
Make the prop invisible.

Outputs

  • Studiomodel:
OnIgnite
Fired when this object catches fire.
  • OnAnimationBegun
Fired whenever a new animation has begun playing.
  • OnAnimationDone
Fired whenever an animation is complete.
  • OnOutOfWorld
Fired whenever the entity leaves map boundaries.

Template:Wrongtitle