Ragdoll Corpses in Water

From The DarkMod Wiki
Revision as of 22:41, 18 April 2020 by Geep (talk | contribs) (Created from offline doc)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

By Geep, 2020

A humanoid ragdoll corpse in water is possible, but keep your expectations modest.

The Fully-Sunken Corpse

By default, a ragdoll will immediately floor itself to the underlying worldspawn surface (e.g., “seafloor”). In doing so, it will ignore static_funcs with “noclipmodel 1” (and their collision surfaces). This effect can be desirable (e.g., for sea plants) or not (for anchors, rocks, sunken crates). If not, you may apply gambits like:

  • Clearing the seafloor debris
  • Adding clip brushes
  • Changing the seafloor debris to “noclipmodel 0” (or reverting func_statics to worldspawn)
  • Setting the ragdoll’s hidden spawnarg “solid” to “1”. (Caveat: if the ragdoll is frobbable, after a frob/release, this effect seems less dependable.)

The Floating Corpse

Add the spawnarg “nodrop 1”. Place the corpse vertically exactly where you want it at the surface (or in the water column). If you place the corpse at the water surface, it won’t really float (i.e., bob), but if placed low in the water surface (“awash”), it looks not bad.

Corpse-Player Interaction

Unlike with a Movable entity, if you approach the cadaver closely, it will not move. It usually seems that you can swim through the body, but also sometimes climb atop it. The setting of the “solid” spawnargs doesn’t appear to have much effect.

If you want the player to not move the corpse.

Set inherited spawnarg "frobbable" to "0".

If you want the player to move the corpse

Leave "frobbable" at "1". There’s also “ground_when_dragged”, that you can toggle to see what water behavior you prefer. This latter may be of no concern, if the main reason to frob is to shoulder the corpse and bring it to dry land. Conversely, frob-and-drag by the selected body part provides some entertaining thrashing and splashing (particularly if some other body part is clipped into, say, a wall).

In any event, once released/unfrobbed, a corpse will quickly sink, typically beyond the default re-frob range unless you swim back down to it (or extend the frob range).

Avoid frobbable props

Keys and other attachable props seem to be problematic, because:

  • They often end up inside the cadaver
  • Frobbing them can cause the cadaver to sink (even if the ragdoll’s frobbable is 0)
  • There seem to be more general problems with functional keys on ragdolls

Other Issues

Corpse Pose

When you create and place a ragdoll in DR, the DR pose - hands at sides - may appear in the game as well. But sometimes, the in-game ragdoll will revert to a “T pose”, and as a result, an arm might clip into, for instance, a nearby wall. Position the ragdoll accordingly.

If the initial spawn pose is important to you (beyond facing up or down), consider using one of two in-game methods:

  • Drag around a frobable ragdoll into a favorable position with a mouse, then save that pose.
  • Use the Articulate Figure editor. Invoke it by “editAFs”, then select your ragdoll model.

For more about the difficulties and specialized techniques for controlling ragdoll spawn pose, see:

Sink Rate?

Ragdolls are not Movables, so the Entity inspector will not show inherited Movable spawnargs like “mass”, nor respond if “mass” is added. So post-frob sink/float rate and direction cannot be controlled; it is fixed at a rather rapid sink.

(If you use the in-game Articulated Figure editor on a ragdoll, note that “total mass” is exposed, as well as collision volumes and densities for individual body parts. Could these be used effectively for float control? Don’t know.)