Prop dynamic: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
(cleanup)
Line 1: Line 1:
{{toc-right}}
__NOTOC__{{base point|prop_dynamic}} It is used to add an arbitrary  [[model]] to the world that can [[Skeletal animation|animate]] itself and move between positions.


'''prop_dynamic''' is a core Source engine [[entity]] used to add a moving [[model]] to a map. "Moving" can mean either [[Animation|animating]], or literally travelling between positions within the [[world]]. A prop_dynamic will not move around of its own accord however: it must be [[parent]]ed 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]].
A prop_dynamic cannot move around on its own however: it must be [[parent]]ed to an entity that can. For instance, to create a functional [[Razortrain]] you would parent the various engines and carriages, as prop_dynamic, to an invisible [[func_tracktrain]] brush entity.


Dynamic props receive "point lighting": one value, refreshed every frame, is applied to the entire model. Exceptions to this are [[point_spotlight]]s (per-vertex) and [[env_projectedtexture]]s (per-pixel).
Dynamic props receive "point lighting": one value, re-sampled every frame, is applied to the entire model. [[point_spotlight]]s (per-vertex) and [[env_projectedtexture]]s (per-pixel) can overcome this.


Dynamic props can be configured to break apart after receiving a given amount of damage. But health set [[prop_data|inside the model]] will override health set in Hammer!
{{tip|If your model is never going to move and/or requires detailed lighting, consider using [[prop_static]] (which is [[cheaper]]).}}
 
{{tip|If your model is never going to move, consider using [[prop_static]] instead.}}


{{note|To enforce consistency, models with [[prop_data|embedded physics data]] cannot by default be used by prop_dynamic. Use the Hammer model browser's [[:Image:Model_info.gif|Info tab]] to check for support.}}
{{note|To enforce consistency, models with [[prop_data|embedded physics data]] cannot by default be used by prop_dynamic. Use the Hammer model browser's [[:Image:Model_info.gif|Info tab]] to check for support.}}


== Tips ==
== Uses ==


*'''Buttons''' can be created by enveloping a prop_dynamic button inside an invisible [[func_button]], then using the ''SetAnimation'' input.
* '''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!
* 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!
* A prop_dynamic can be configured to '''break apart''' after receiving damage. {{bug|Health set [[prop_data|inside the model]] will override health set in Hammer!}}


== See also ==
== See also ==
Line 22: Line 21:
** [[prop_physics]]
** [[prop_physics]]
** [[prop_detail]]
** [[prop_detail]]
* [[Prop Footsteps]] - A tutorial that provides essential code for when players walk on entities like this, it's not ignored during footstep sound computation.


== Keyvalues ==
== Keyvalues ==
*{{KV PropDynamicBase}}
 
*{{KV Parentname}}
{{KV PropDynamicBase}}
*{{KV Global}}
*{{KV EnableDisable}}
*'''solid'''
:<choices> Collisions.
:{| class=standard-table
! Literal value || Description
|-
| 0 || Not Solid
|-
| 2 || Use Bounding Box
|-
| 6 || Use VPhysics
|}


== Flags ==
== Flags ==
*{{fl BreakableProp}}
 
*64 : Use Hitboxes for Renderbox
* {{fl PropDynamicBase}}


== Inputs ==
== Inputs ==
*{{I Parentname}}
 
*{{I Studiomodel}}
{{I PropDynamicBase}}
*{{I EnableDisable}}
*'''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 [[Body Groups|bodygroup]], by index.
*'''TurnOn'''
:Make the prop visible.
*'''TurnOff'''
:Make the prop invisible.


== Outputs ==
== Outputs ==
*{{O Studiomodel}}
*'''OnAnimationBegun'''
:Fired whenever a new animation has begun playing.
*'''OnAnimationDone'''
:Fired whenever an animation is complete.
*'''OnOutOfWorld'''
:Fired whenever the entity leaves map boundaries.
{{wrongtitle|title=prop_dynamic}}


[[Category:Entities]]
{{O PropDynamicBase}}

Revision as of 04:40, 18 September 2009

Template:Base point It is used to add an arbitrary model to the world that can animate itself and move between positions.

A prop_dynamic cannot move around on its own however: it must be parented to an entity that can. For instance, to create a functional Razortrain you would parent the various engines and carriages, as prop_dynamic, to an invisible func_tracktrain brush entity.

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

Tip.pngTip:If your model is never going to move and/or requires detailed lighting, consider using prop_static (which is cheaper).
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.

Uses

  • 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!
  • A prop_dynamic can be configured to break apart after receiving damage.
    Icon-Bug.pngBug:Health set inside the model will override health set in Hammer!  [todo tested in ?]

See also

Keyvalues

Template:KV PropDynamicBase

Flags

Inputs

Template:I PropDynamicBase

Outputs

Template:O PropDynamicBase