Prop dynamic

From Valve Developer Community
Revision as of 08:31, 24 February 2006 by Giles (talk | contribs) (Typo correction: func_button_rot is presumably meant to be func_rot_button)
Jump to navigation Jump to 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.

Keyvalues

<choices> Collisions
Literal Value Description
0 Not Solid
2 Use Bounding Box
6 Use VPhysics
  • DefaultAnim
<string> The name of the idle animation that this prop will revert to whenever it finishes a random or forced animation.
  • RandomAnimation
<choices>
Literal Value Description
0 No
1 Yes
  • MinAnimTime
<float> Minimum time between random animations.
  • MaxAnimTime
<float> Maximum time between random animations.
  • fademindist
<float> Distance at which the prop starts to fade. (<0 = use fademaxdist)
  • fademaxdist
<float> Max fade distance at which the prop is visible. (0 = don't fade out)
  • fadescale
<float> If you specify a fade in the worldspawn, or if the engine is running under DX7, then the engine will forcibly fade out props even if fademindist/fademaxdist isn't specified. This scale factor gives you some control over the fade. Using 0 here turns off the forcible fades. Numbers smaller than 1 cause the prop to fade out at further distances, and greater than 1 cause it to fade out at closer distances."

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

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

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

See Also