[L4D2] cs_ragdoll usage?
I wanted to attempt spawning survivor ragdolls without removing the original death model. So far, I got the ragdoll death to an extent.
I have no idea how to make cs_ragdoll: * use the position of the bones of it's owner. (Right now, it uses the t-pose.) * apply damage taken as force from it's owner. (Movement is solved.) I did see something about clientside ragdolls from the vtable dumper, but I have no idea how to use it. :| EDIT: Just realized this shouldn't include L4D1 at all. |
Re: [L4D2] cs_ragdoll usage?
You have to utilize the netprops of the CSRagdoll entity:
PHP Code:
The sdk utilizes this function to convert the bones in a matrix array into the int values here: https://github.com/ValveSoftware/sou...senpc.cpp#L159 https://github.com/ValveSoftware/sou...h_pose.cpp#L12 Setting the velocity you would use the m_vecForce and m_nForceBone to set the bone which sufferd the impact and then the force direction which will apply to the ragdoll. Also theres this for normal ragdolls velocity before impact m_vecRagdollVelocity (I think) |
Re: [L4D2] cs_ragdoll usage?
Quote:
Unfortunately, I seem to have run into a newbie problem. I have no idea how to convert float arrays to a vector. The sourcemod wiki doesn't help, it tends to be very confusing. |
Re: [L4D2] cs_ragdoll usage?
PHP Code:
|
Re: [L4D2] cs_ragdoll usage?
Quote:
HTML Code:
C:\Program Files (x86)\Steam\steamapps\common\Left 4 Dead 2\left4dead2\addons\sourcemod\scripting\L4D2CSRagdoll.sp(91) : error 008: must be a constant expression; assumed zero PHP Code:
I used seperate values to set the view_as values. Caused more problems. |
Re: [L4D2] cs_ragdoll usage?
If velfloat already has assigned values you can just pass it into SetEntPropVector directly.
|
Re: [L4D2] cs_ragdoll usage?
Quote:
I've gotten the velocity on player movement working. I'd like to get force from damage, but I don't know how. Here's my code that applied the velocity: PHP Code:
|
Re: [L4D2] cs_ragdoll usage?
Quote:
In L4D1 (not sure about L4d2) ragdoll entity is valid for a very small amount of time: "player_death" with EventHookMode_Pre and no more valid on Post-event. A trick is to kill it right there and create your own by reproducing original preperties, something like this: PHP Code:
This sample was for my tank plugin. |
Re: [L4D2] cs_ragdoll usage?
Quote:
Reasons: * I wanted to try out something (almost) on my own. * Death models created with CreateEntityByName aren't affected by gravity. Sorry if what I wanted wasn't all that clear with you. The problem was that the client ragdolls didn't automatically assume the velocity + bone positions of their owner. So far only velocity from owner itself was finished. And yes, in L4D2 cs_ragdoll behaves similarly like in L4D1. |
Re: [L4D2] cs_ragdoll usage?
Lux made many plugins related to ragdolls. See, if any could be useful for you.
|
All times are GMT -4. The time now is 13:48. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.