|
|
(28 intermediate revisions by 3 users not shown) |
Line 1: |
Line 1: |
| {{CD|CDynamicProp|file1=props.cpp}}
| | <noinclude>{{delete|reason=deprecated}}</noinclude> |
| {{this is a|point entity|name=prop_dynamic}} It is used to add a [[model]] to the world that can [[Skeletal animation|animate]] itself.
| |
| | |
| {{tip|If your model is never going to move and/or requires more detailed lighting, consider using {{ent|prop_static}} (which is [[cheap]]er).}}
| |
| | |
| {{note|To enforce consistency, models with [[prop_data|embedded physics data]] cannot by default be used by <code>prop_dynamic</code>. Use the Hammer model browser's [[:Image:Model_info.gif|Info tab]] to check for support. If you intend to use a physics model in non-physics role, use {{ent|prop_dynamic_override}}.}}
| |
| | |
| {{altnames|name1=dynamic_prop|misc=The classname is always changed to <code>prop_dynamic</code> on spawn.}}
| |
| | |
| ==Uses==
| |
| *'''Buttons''' can be created by parenting a <code>prop_dynamic</code> to a {{ent|func_button}} brush. This will cause <code>+use</code> inputs on the prop to be forwarded to the {{ent|func_button}}, which can be placed anywhere in the map (or even outside the map, [[Leak|as long as the origin is inside]]). The <code>SetAnimation</code> input can then be used to make the prop animate when interacted with.
| |
| :* In {{mapbase|3.1}}, {{ent|prop_interactable}} combines these entities, making setup easier.
| |
| *Similarly, '''levers''' can be created by parenting a <code>prop_dynamic</code> to a {{ent|func_rot_button}} (or {{ent|momentary_rot_button}}) brush. No animation is needed for this - the brush will rotate the prop by itself. As before, the entity can be placed anywhere, as long as the origin is positioned at the point you want it to rotate around.
| |
| *A <code>prop_dynamic</code> can be configured to '''break apart''' after receiving damage or on cue by using the <code>Break</code> input. {{bug|Health set [[prop_data|inside the model]] will override health set in Hammer!}}
| |
| | |
| ==Keyvalues==
| |
| {{KV Targetname}}
| |
| | |
| {{KV|Default Animation|intn=DefaultAnim|string|The animation this prop will play when not doing a random or forced animation.}}
| |
| {{KV|Randomly Animate|intn=RandomAnimation|bool|Makes the prop randomly select and play animations at intervals defined by the '''Min/Max Random Anim Time''' KVs. In between the random animations, it will revert to playing '''Default Animation'''.{{note|Will only select from animation [[$sequence]]s linked with <code>ACT_IDLE</code> if they exist.}}}}
| |
| {{KV|Min Random Anim Time|intn=MinAnimTime|float|Minimum time between random animations.}}
| |
| {{KV|Max Random Anim Time|intn=MaxAnimTime|float|Maximum time between random animations.}}
| |
| {{KV|Update children|intn=updatechildren|bool|since={{l4d}}|Update touches for any children that are attached to attachment points as this prop animates. This allows SetParentAttached triggers or func_brushes to touch properly.}}
| |
| {{KV|Disable Bone Followers|intn=DisableBoneFollowers|boolean|since=2009|Disables generation of {{ent|phys_bone_follower}}s for each convex piece the model has in its [[collision model]]. <code>phys_bone_follower</code>s can quickly eat up the [[entity limit|edict count]], so this keyvalue can be very helpful in freeing resources. This will however make the collision model no longer function ({{confirm}} As in become non-solid?), and the model will not be able to ragdoll anymore.}}
| |
| {{KV|Hold Animation|intn=HoldAnimation|boolean|since=AS|If set, the prop will not loop its animation, but hold the last frame.}}
| |
| {{KV|Animate Every Frame|intn=AnimateEveryFrame|boolean|since=P2|Force this prop to animate every frame. Usually this doesn't need to be touched.}}
| |
| {{KV|Glow State|intn=glowstate|choices|What is allowed to activate the glow effect on this prop.
| |
| :*0: OFF (must be activated through inputs)
| |
| :*1: {{ent|+use}}
| |
| :*2: when looked at
| |
| :*3: ON (starts activated)|only=l4d2}}
| |
| {{KV|Glow Range|intn=glowrange|integer|Range at which the glow becomes visible. 0 means always visible.|only=l4d2}} | |
| {{KV|Glow Range Min|intn=glowrangemin|integer|Range at which glow stops being visible. 0 means always visible.|only=l4d2}}
| |
| {{KV|Glow Color Override (R G B)|intn=glowcolor|color255|Color of the glow.|only=l4d2}}
| |
| {{Expand|title=Non-Valve games {{gmod}}{{bms}}|
| |
| {{KV|Ignore NPC Collisions|intn=IgnoreNPCCollisions|choices|Disable collisions for [[NPC|NPCs]] if yes.
| |
| :*0: No
| |
| :*1: Yes
| |
| |only={{bms}}
| |
| }}
| |
| {{KV GMOD}}
| |
| }}
| |
| {{KV BreakableProp}}
| |
| {{KV Studiomodel|noscroll=1|no sequence=1}}
| |
| | |
| ==Flags==
| |
| {{Fl BreakableProp}}
| |
| {{minititle|DynamicProp}}
| |
| {{Fl|64|Use Hitboxes for Renderbox{{elaborate}}}}
| |
| {{Fl|256|Start with collision disabled}}
| |
| | |
| ==Inputs==
| |
| {{IO|SetAnimation|param=string|Forces the prop to play the named animation.}}
| |
| {{IO|SetDefaultAnimation|param=string|Changes the animation played when not in a random/forced sequence.}}
| |
| {{IO|SetPlaybackRate|param=float|Sets the framerate at which animations are played.}}
| |
| {{IO|TurnOff|Hides the prop through {{ent|EF_NODRAW}}. The <code>Disable</code> input does the exact same thing.}}
| |
| {{IO|TurnOn|Shows the prop (by removing {{ent|EF_NODRAW}}). The <code>Enable</code> input does the exact same thing.}}
| |
| {{IO|DisableCollision|Tells the prop to no longer be solid.}}
| |
| {{IO|EnableCollision|Tells the prop to become solid again.}}
| |
| {{IO|SetAnimationNoReset|param=string|since=AS|Force the prop to play an animation unless the prop is already playing the animation. The parameter should be the name of the animation.}}
| |
| {{IO|FadeAndKill|since=P2|Fade out then remove this prop.}}|}}
| |
| {{IO|StartGlowing|Enable any set glow effects on this prop.|only=l4d2}}
| |
| {{IO|StopGlowing|Disable any glow effects on this prop.|only=l4d2}}
| |
| {{I BreakableProp}}
| |
| | |
| ==Outputs==
| |
| {{IO|OnAnimationBegun|Fired when an animation begins.}}
| |
| {{IO|OnAnimationDone|Fired when an animation finishes.}}
| |
| {{O Breakable|prop=1}}
| |
| | |
| ==See also==
| |
| *[[Prop Types Overview]]
| |
| * {{ent|prop_dynamic_ornament}}
| |
| * {{ent|prop_dynamic_override}}
| |
| * {{ent|prop_physics}}
| |