这篇条目有关 Source引擎。如需详情,点击这里。

prop_ragdoll

From Valve Developer Community
< Zh
Revision as of 18:13, 6 August 2024 by Yakumo koishi (talk | contribs) (Created page with "<!-- When this page is updated to {{langsp}} or {{langsp}} instead of {{lang}}, please move {{this is a}} to the base page, as it is automatically translated. -->{{lang|Prop r...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
English (en)中文 (zh)Translate (Translate)
参见:  For details on creating a ragdoll, see $collisionjoints.
C++ 类层级
CRagdollProp
CBaseAnimating
CBaseEntity
C++ physics_prop_ragdoll.cpp
prop_ragdoll can interact with dynamic objects, unlike death ragdolls.

prop_ragdoll是一个点实体(en),可在所有的 起源 起源 游戏中使用。 It is a VPhysics ragdoll. Ragdolls are collections of physics objects constrained together to simulate a jointed object like a dead body. They are very expensive to simulate.

Warning.png警告:This entity generates server-side ragdolls, which collide with everything but produce very large amounts of network traffic. Network traffic can be significantly reduced by making the ragdoll start asleep, disabling motion and disabling collisions with dynamic objects (不存在于FGD! add "solid" keyvalue with value of 0) and only enabling motion when necessary.
Icon-Bug.png错误:Setting a custom pose via Hammer and making the ragdoll start asleep will make the rendering box fail to update. Making the ragdoll wake for a single frame when spawned and then sleeping it will fix this issue.  [todo tested in ?]
Icon-Bug.png错误:传送门2 传送门2 ragdolls cannot pass through portals. This often occurs in 传送门 传送门 as well.  [todo tested in ?]
Icon-Bug.png错误: Ragdolls are ignored in prediction, this causes lots of prediction errors when touching a ragdoll.  [todo tested in ?]
AltNames.pngAltNames: 此实体也绑定到 physics_prop_ragdoll
黑山 黑山 specific notices and bugs.
Note.png注意:Original entity version is available as prop_ragdoll_original. The difference is: prop_ragdoll_original can't be gibbed with explosions, crowbar can hit prop_ragdoll_original if [4] Debris spawnflag is unchecked (crowbar's raycast skips prop_ragdoll for some reason), prop_ragdoll_original doesn't bleed or have decals on it, prop_ragdoll_original can't be picked up, prop_ragdoll_original have realistic bullet push.
Icon-Bug.png错误:
  • server side ragdolls created by NPCs never gib before loading save since the first Steam version, the same for gibs created by gibbed ragdolls. Use the workshop addon if you want to use server side ragdolls in your mod.
  • crowbar's raycast skips/ignores server side ragdolls since the first Steam version.
  • Tripmines do not gib ragddols
  • In multiplayer ragdolls do not create hole decals and blood from bullets if [4] Debris spawnflag is enabled. If this flag is disabled - ragdolls still will not create blood effects and hand blood overlays.  [todo tested in ?]


Death Ragdolls/Ragdoll Transformation

When a NPC/player dies or an entity receives the BecomeRagdoll input, it normally creates a client-side ragdoll and copies most of its animation and visual data to it. Unlike server-side prop_ragdolls, these client-side ragdolls are handled completely on a per-client basis and are much cheaper and simpler than their server-side counterparts, at the expense of being virtually nonexistent on the server, being inconsistent across client perspectives, and only colliding with entities that have physics objects on the client (e.g. worldspawn).

However, a NPC will become a server-side ragdoll while it's under any of the following conditions:

These server-side death ragdolls will collide with physics objects and beyond, like any prop_ragdoll, but they are marked as debris and do not collide with each other. They do not collide with themselves either, unlike client-side ragdolls (fixed in Entropy : Zero 2 Entropy : Zero 2 and 黑山 黑山). This is believed to be intentional behavior to reduce performance/networking costs.

Icon-Bug.png错误:Server side ragdolls don't save blood decals. Fixed in Mapbase Mapbase and 黑山 黑山.  [todo tested in ?]
Note.png注意:Most of this list theoretically applies to players as well, although that hasn't been tested.
Warning.png警告:While most of the relevant animation/visual data is copied to ragdolls, some fields, like fade distances, are not transferred.
Cpp.png代码:This can be modified at CBaseAnimating::CopyAnimationDataFrom() in baseanimating.cpp for server-side ragdolls and C_BaseAnimating::CreateRagdollCopy() in c_baseanimating.cpp for client-side ragdolls.

Keyvalues

Name (目标名称) <target_source>[ Edit ]
这个名称是其他实体通过 输入/输出(en) 或其他 关键值(en)(如 parentnametarget) 来引用该实体时使用的标识符。
该名称也会显示在 Hammer 编辑器的 2D 视图和 实体报告(en) 中。
参见:  所有实体均可使用的 通用键值、输入与输出(en)

Override Animation (angleOverride) <字符串(en)>
Filled in by the engine via hammer_update_entity. Do not edit by hand except to clear.
Non-Valve game specific
Health (health) <整数(en)> (存在于 黑山 之中)
The amount of damage the ragdoll takes before gibbing.
Character Manifest Mimic Name (MimicName) <字符串(en)> (存在于 黑山 之中)
Choose a name or a classname from the character manifest to dress the ragdoll.

GMODSandbox:

Allow Physics Gun (gmod_allowphysgun) <布尔值(en)> (存在于 Garry's Mod 之中)
If set, players cannot use Physics Gun on this entity.
Sandbox Tool Whitelist (gmod_allowtools) <字符串(en)> (存在于 Garry's Mod 之中)
If set, only given tools can be used on this entity. You need to supply the tool class names, the names of the .lua files of those tools. This also includes the context menu properties!

Flags

Debris : [4]
Don't collide with the player or other debris
Use 'Least Recently Used' Retirement [澄清]  : [4096] 不存在于FGD!
Allow Dissolve : [8192]
Motion Disabled : [16384]
Allow stretch : [32768]
Start asleep : [65536]

Inputs

StartRagdollBoogie
Begins ragdoll boogie effect for 5 seconds.
Icon-Bug.png错误:This input is actually supposed to use a parameter for how long the ragdoll should boogie, but it uses the wrong field type in the data description.  [todo tested in ?]
Cpp.png代码修复:In CRagdollProp's data description, find DEFINE_INPUTFUNC( FIELD_VOID, "StartRagdollBoogie", InputStartRadgollBoogie ) and replace FIELD_VOID with FIELD_FLOAT.
EnableMotion / DisableMotion
Enable / disable physics simulation.
FadeAndRemove  (存在于自 半衰期2:第二章 以来)
Fade out then remove (kill) self. Parameter override = duration of fade.
AllowBloodPool  (存在于 黑山 之中) 不存在于FGD!
Сorpse once will create pool of blood (particle effect) if it is placed on brush.
Note.png注意:Not avaible for prop_ragdoll_original and prop_ragdoll_attached.

See Also