Add capability to +USE serverside ragdolls and toggle cleanup of individual ragdolls #297
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds two new spawnflags to
prop_ragdoll
to enable +USE and prevent pickup, respectively. When a ragdoll has +USE enabled, the player will be able to grab a limb and drag it around. This uses the same framework as the mega physcannon, although pickup forces will only use the strength of the carried limb, rather than the strength of the entire bone hierarchy. The other spawnflag disables picking up the ragdoll even when +USE is enabled, and is intended for situations where a ragdoll should be useable but should not be picked up. AnOnPlayerUse
output is also included, and it fires every time the ragdoll is +USE'd regardless of whether it is picked up. A new cvar,ragdoll_always_allow_use
, allows all ragdolls to be +USE'd regardless of the spawnflag, which may be useful if you're making a game or mod centered around this mechanic. This cvar is disabled by default.This PR also includes two new inputs:
AddToLRU
andRemoveFromLRU
. "LRU" stands for "Least Recently Used", and in this case it's referring to Source's ragdoll cleanup system, which automatically removes ragdolls which haven't been used. Serverside ragdolls spawned by NPCs are automatically added to this system, whileprop_ragdoll
s spawned by the map are not. You can use theAddToLRU
input to add any ragdoll to this system, or theRemoveFromLRU
input to remove a ragdoll from this system. This is useful when you want a ragdoll created by a NPC to linger, or if you want a ragdoll created by the map to be treated as a regular NPC ragdoll.PR Checklist
develop
branch OR targets another branch with a specific goal in mind