Basically, I want a model (prop_dynamic) to behave like a ragdoll for a limited time span.
Right now the prop_dynamic is substituted with a prop_ragdoll which has the same model. This substitution is barely recognizable. My problem is to switch back to the prop_dynamic without anyone noticing it.
Sometimes the ragdoll lies very distorted on the ground and when I just spawn the prop_dynamic_override on it (while killing the ragdoll), it looks odd... even if both entities have the same orientation and origin.
In the game the ragdolls (e.g. a knocked down npc, which stands up again) are able to revert to a firstframe of an animation which makes it easy to secretly substitute the entity types.
But I am unable to tell my ragdoll to play an animation or just revert to a certain posture.
I tried:
Code:
SetVariantString("StandUp_back(_firstframe)")
AcceptEntityInput(ragdoll, "SetAnimation")
.
.
Code:
SetEntProp(ragdoll,Prop_Data,"m_nOverlaySequence",anynumber)
.
.
Code:
DispatchKeyValue(ent1,"activity", "StandUp_back(_firstframe)")
.
.
Code:
SetEntPropString(ragdoll,Prop_Data,"m_anglesOverrideString","StandUp_back(_firstframe)")
and a lot more...
I found a few interesting lines in physics_prop_ragdoll.h :
void SetOverlaySequence( Activity activity );
and this:
allow underlying sequence to blend in with simulated bone positions (<- what I am trying to do.. i think)
CNetworkVar( float, m_flBlendWeight );
CNetworkVar( int, m_nOverlaySequence );
This somehow makes me think that it's possible to get a ragdoll into a certain posture (with a “blend sequence”) but right now I am at the end of my wit. Any ideas?