Npc puppet: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
(-added class hierarchy, concise page)
 
(6 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{wrongtitle|title=npc_puppet}}
{{CD|CNPC_Puppet|file1=1}}
{{this is a|model entity|name=npc_puppet|game=Half-Life 2}} It is a puppet entity that mimics the animations of a target NPC.


A npc_puppet is used in all singleplayer Source games (maybe all Source games). it copies an npc's animation and allows you to copy from another npc.
For example, place a combine soldier then an npc_puppet and edit the npc_puppet to follow the soldier and it will mimic whatever the soldier does.


For example, place a combine soldier then an npc_puppet and edit the npc_puppet to follow the soldier and it will mimic whatever the soilder does.
== Keyvalues ==
{{KV Targetname}}
{{KV|Animation target|intn=animationtarget|target_source|NPC entity to mimic.}}
{{KV|Target attachment point name|intn=attachmentname|string}}
 
== Inputs ==
{{I|SetAnimationTarget|Set the animation target to use. An empty string will disable the puppet.|param=string}}




[[Category:Entities]]
[[Category:NPCs]]
[[Category:NPCs]]

Latest revision as of 05:13, 19 May 2025

C++ Class hierarchy
CNPC_Puppet
CAI_BaseNPC
CBaseCombatCharacter
CBaseFlex
CBaseAnimatingOverlay
CBaseAnimating
CBaseEntity
C++ npc_puppet.cpp

npc_puppet is a model entity available in Half-Life 2 Half-Life 2. It is a puppet entity that mimics the animations of a target NPC.

For example, place a combine soldier then an npc_puppet and edit the npc_puppet to follow the soldier and it will mimic whatever the soldier does.

Keyvalues

Name (targetname) <string>[ Edit ]
The name that other entities refer to this entity by, via Inputs/Outputs or other keyvalues (e.g. parentname or target).
Also displayed in Hammer's 2D views and Entity Report.
See also:  Generic Keyvalues, Inputs and Outputs available to all entities

Animation target (animationtarget) <string>
NPC entity to mimic.
Target attachment point name (attachmentname) <string>

Inputs

SetAnimationTarget <stringRedirectInput/string>
Set the animation target to use. An empty string will disable the puppet.