Prop ragdoll: Difference between revisions
m (Changed parameters of {{this is a}} to comply with the updated version. This action was performed by a bot.) |
(-added class hierarchy, cleanup) |
||
Line 1: | Line 1: | ||
<!-- 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 ragdoll}}{{seealso|For details on creating a ragdoll, see {{ent|mode=name|$collisionjoints}}.}} | <!-- 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 ragdoll}}{{seealso|For details on creating a ragdoll, see {{ent|mode=name|$collisionjoints}}.}} | ||
{{CD|CRagdollProp|file1=1}} | |||
[[File:prop_ragdoll.jpg|thumb|prop_ragdoll can interact with dynamic objects, unlike death ragdolls.]] | [[File:prop_ragdoll.jpg|thumb|prop_ragdoll can interact with dynamic objects, unlike death ragdolls.]] | ||
Line 8: | Line 8: | ||
{{warning|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 ({{not in FGD}} add "solid" keyvalue with value of 0) and only enabling motion when necessary.}} | {{warning|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 ({{not in FGD}} add "solid" keyvalue with value of 0) and only enabling motion when necessary.}} | ||
{{bug|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.}} | {{bug|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.}} | ||
{{bug|{{Portal2}} ragdolls cannot pass through portals. This often occurs in {{Portal}} as well.}} | {{bug|{{Portal2|4}} ragdolls cannot pass through portals. This often occurs in {{Portal|4}} as well.}} | ||
{{bug| Ragdolls are ignored in prediction, this causes lots of prediction errors when touching a ragdoll.}} | {{bug| Ragdolls are ignored in prediction, this causes lots of prediction errors when touching a ragdoll.}} | ||
{{bug|In {{Bms|4}} 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 [https://community.lambdageneration.com/black-mesa/post/efesc2f8cyf the workshop addon] if you want to use server side ragdolls in your mod. | {{bug|In {{Bms|4}}: | ||
* 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 [https://community.lambdageneration.com/black-mesa/post/efesc2f8cyf 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 <code>[4] Debris</code> spawnflag is enabled. If this flag is disabled - ragdolls still will not create blood effects and hand blood overlays.}} | |||
{{altnames|name1=physics_prop_ragdoll}} | {{altnames|name1=physics_prop_ragdoll}} | ||
==Death Ragdolls/Ragdoll Transformation== | ==Death Ragdolls/Ragdoll Transformation== | ||
Line 39: | Line 35: | ||
==Keyvalues== | ==Keyvalues== | ||
{{KV Targetname}} | |||
{{KV|sequence|int|The ragdoll will be moved to the first frame of this animation before VPhysics takes over.|nofgd=1}} {{bug|Doesn't function.}} | {{KV|sequence|int|The ragdoll will be moved to the first frame of this animation before VPhysics takes over.|nofgd=1}} {{bug|Doesn't function.}} | ||
{{KV|Body|intn=body|int|Specifies which [[$bodygroup|body group]] should be used.|nofgd=1}} | {{KV|Body|intn=body|int|Specifies which [[$bodygroup|body group]] should be used.|nofgd=1}} | ||
Line 45: | Line 42: | ||
{{KV|Character Manifest Mimic Name|intn=MimicName|string|Choose a name or a classname from the character manifest to dress the ragdoll.|only=BMS}} | {{KV|Character Manifest Mimic Name|intn=MimicName|string|Choose a name or a classname from the character manifest to dress the ragdoll.|only=BMS}} | ||
{{KV GMOD}} | {{KV GMOD}} | ||
==Flags== | ==Flags== | ||
{{fl|4|Debris|Don't collide with the player or other debris}} | {{fl|4|Debris|Don't collide with the player or other debris}} | ||
Line 56: | Line 52: | ||
==Inputs== | ==Inputs== | ||
{{IO|StartRagdollBoogie|Begins ragdoll boogie effect for 5 seconds.{{bugfix|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.|In <code>CRagdollProp</code>'s data description, find <code>DEFINE_INPUTFUNC( FIELD_VOID, "StartRagdollBoogie", InputStartRadgollBoogie )</code> and replace <code>FIELD_VOID</code> with <code>FIELD_FLOAT</code>.|code}}}} | {{IO|StartRagdollBoogie|Begins ragdoll boogie effect for 5 seconds.{{bugfix|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.|In <code>CRagdollProp</code>'s data description, find <code>DEFINE_INPUTFUNC( FIELD_VOID, "StartRagdollBoogie", InputStartRadgollBoogie )</code> and replace <code>FIELD_VOID</code> with <code>FIELD_FLOAT</code>.|code}}}} | ||
{{IO|EnableMotion, DisableMotion|Enable/disable physics simulation.}} | {{IO|EnableMotion, DisableMotion|Enable/disable physics simulation.}} | ||
{{IO|FadeAndRemove|Fade out then remove (kill) self. Parameter override <nowiki>=</nowiki> duration of fade.|since={{hl2ep2}}}} | {{IO|FadeAndRemove|Fade out then remove (kill) self. Parameter override <nowiki>=</nowiki> duration of fade.|since={{hl2ep2}}}} | ||
{{ | {{IO|AllowBloodPool|Сorpse once will create pool of blood (particle effect) if it is placed on brush. {{note|Not avaible for <code>prop_ragdoll_original</code> and <code>prop_ragdoll_attached</code>.}}|only=BMS|nofgd=1}} | ||
== | == See Also == | ||
* [[Prop Types Overview]] | |||
Revision as of 09:39, 30 June 2024
![]() |
---|
CRagdollProp |
![]() |
prop_ragdoll
is a point entity available in all Source games. 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.


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.




- 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 ?]

physics_prop_ragdoll
. 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:
- The NPC is inside the volume of a trigger_serverragdoll
- The NPC is killed by a vehicle in singleplayer
- The gravity gun is supercharged
- The NPC dies on fire while in Alyx darkness mode
- The NPC is a vital ally (e.g., npc_alyx)
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 and
Black Mesa). This is believed to be intentional behavior to reduce performance/networking costs.





Code:This can be modified at
CBaseAnimating::CopyAnimationDataFrom()
inbaseanimating.cpp
for server-side ragdolls andC_BaseAnimating::CreateRagdollCopy()
inc_baseanimating.cpp
for client-side ragdolls.
Keyvalues
- Name (targetname) <string>[ Edit ]
- The name that other entities refer to this entity by, via Inputs/Outputs or other keyvalues (e.g.
parentname
ortarget
).
Also displayed in Hammer's 2D views and Entity Report.See also: Generic Keyvalues, Inputs and Outputs available to all entities
- sequence ([todo internal name (i)]) <integer> !FGD
- The ragdoll will be moved to the first frame of this animation before VPhysics takes over.
Bug:Doesn't function. [todo tested in ?]
- Body (body) <integer> !FGD
- Specifies which body group should be used.
- Override Animation (angleOverride) <string>
- Filled in by the engine via wc_update_entity. Do not edit by hand except to clear.
- Health (health) <integer> (only in
)
- The amount of damage the ragdoll takes before gibbing.
- Character Manifest Mimic Name (MimicName) <string> (only in
)
- Choose a name or a classname from the character manifest to dress the ragdoll.
GMODSandbox:
- Allow Physics Gun (gmod_allowphysgun) <boolean> (only in
)
- If set, players cannot use Physics Gun on this entity.
- Sandbox Tool Whitelist (gmod_allowtools) <string> (only in
)
- 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.
Bug: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 ?]
Code Fix:In
CRagdollProp
's data description, findDEFINE_INPUTFUNC( FIELD_VOID, "StartRagdollBoogie", InputStartRadgollBoogie )
and replaceFIELD_VOID
withFIELD_FLOAT
.
- EnableMotion, DisableMotion
- Enable/disable physics simulation.
- FadeAndRemove (in all games since
)
- Fade out then remove (kill) self. Parameter override = duration of fade.
- AllowBloodPool (only in
) !FGD
- Сorpse once will create pool of blood (particle effect) if it is placed on brush.
Note:Not avaible for
prop_ragdoll_original
andprop_ragdoll_attached
.