Prop dynamic: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (Robot: Automated text replacement (-\{\|\r +{| class=standard-table))
No edit summary
Line 1: Line 1:
{{wrongtitle|title=prop_dynamic}}
{{toc-right}}
{{base_point}}


== Entity description ==
'''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 that can be placed in hierarchy and can play animations. It can also be configured to break when it takes enough damage. Note that the health of the object will be overridden by the health inside the model, to ensure consistent health game-wide. If the model used by the prop is configured to be used as a [[prop_physics]] (i.e. it should be physically simulated) then it ''can not'' be used as a [[prop_dynamic]]. Upon level load it will display a warning in the console and remove itself. Use a prop_physics or [[prop_dynamic_override]] instead.


=== Notes ===
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).
This entity cannot be moved on its own. However, it can be parented to a moving object such as a [[func_physbox]].


For example, if you wanted to make the butcher knife in the ''props_lab'' folder into a knife you can actually pick up, you can create it as a prop_dynamic entity and parent it to an invisible func_physbox.
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!


Modelled buttons can be used by covering a prop_dynamic button with a [[func_button]], and then targeting the prop_dynamic with the '''SetAnimation''' input.
{{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.}}


Levers can be used by covering a prop_dynamic with a [[func_rot_button]]. Parent the prop_dynamic to the func_rot_button.
== Tips ==


Valves can be created by using a prop_dynamic with a valve model and covering the prop_dynamic with [[momentary_rot_button]]. Parent the prop_dynamic to the momentary_rot_button.
*'''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 ==


* See also [[Prop Types Overview]]
* [[Prop Types Overview]]
* See also [[Prop Footsteps]] - A tutorial that provides essential code for when players walk on entities like this, it's not ignored during footstep sound computation.
** [[prop_static]]
** [[prop_physics]]
** [[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 ==
Line 64: Line 66:
*'''OnOutOfWorld'''
*'''OnOutOfWorld'''
:Fired whenever the entity leaves map boundaries.
:Fired whenever the entity leaves map boundaries.
{{wrongtitle|title=prop_dynamic}}
[[Category:Entities]]

Revision as of 12:05, 14 March 2009

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!

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