Prop dynamic

From Valve Developer Community
Revision as of 09:37, 2 February 2008 by MrThompson (talk | contribs) (spam revert)

Jump to: navigation, search

Template:Wrongtitle

Entity Description

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

This entity cannot be moved on its own; however, it can be parented to a moving object such as a func_physbox.

...so 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.

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.

Levers can be used by covering a prop_dynamic with a func_rot_button. Parent the prop_dynamic to the func_rot_button.

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.

Keyvalues

  1. REDIRECT Template:KV DynamicProp
Global Entity Name <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.
<choices> Collisions.
Literal value Description
0 Not Solid
2 Use Bounding Box
6 Use VPhysics

Flags

  • BreakableProp:
  • 16: Break on Touch
  • 32: Break on Pressure
  • 64 : Use Hitboxes for Renderbox

Inputs

Skin <integer>
Changes the model's skin to the specified number.
SetBodyGroup <integer>
Set the model's body group.
AlternativeSorting <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 <string> (Only in Source 2013)
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.

Shadow:

DisableShadow
Turn dynamic shadows off for this entity.
EnableShadow
Turn dynamic shadows on for this entity.
DisableReceivingFlashlight  (New with Portal 2)
This object will not receive light or shadows from projected textures.
EnableReceivingFlashlight  (New with Portal 2)
This object may receive light or shadows from projected textures.

Reflection:

DisableDrawInFastReflection  (New with Portal 2)
Turns off rendering of this entity in reflections when using $reflectonlymarkedentities in water material.
EnableDrawInFastReflection  (New with Portal 2)
Turn on rendering of this entity in reflections when using $reflectonlymarkedentities in water material.

ToggleDraw:

DisableDraw  (New with 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  (New with 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.
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.

See Also

  • Prop Types Overview
  • Prop Footsteps - A tutorial that provides essential code for when players walk on entities like this, it's not ignored during footstep sound computation.