Raised This Month: $51 Target: $400
 12% 

[TF2] Ragdoll Fix.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Benoist3012
Veteran Member
Join Date: Mar 2014
Location: CWave::ForceFinish()
Old 04-21-2016 , 15:22   [TF2] Ragdoll Fix.
Reply With Quote #1

Hi everyone,
So one of my friends made a good discovery:


This probably reminds you the glitched ragdoll, from the dead ringer, or when you use the Roll The Dice plugin and you get the frozen state.
Or if you have Slender Fortress 2 and someone get killed by Dr.trager.

Well all of this was caused because the hand/torso/head scale were set to 0.

So this little code forces the values to 1.

Code:
public void OnEntityCreated(int iEntity,const char[] strClassname) {     if(StrEqual(strClassname,"tf_ragdoll"))     {         SetEntPropFloat(iEntity, Prop_Send, "m_flHeadScale", 1.0);         SetEntPropFloat(iEntity, Prop_Send, "m_flTorsoScale", 1.0);         SetEntPropFloat(iEntity, Prop_Send, "m_flHandScale", 1.0);     } }

You can copy/paste this part of code in your plugins, or if you are a server owner compile this snippet and add it to your plugins to fix everything.
Attached Files
File Type: sp Get Plugin or Get Source (ragdodllfix.sp - 520 views - 557 Bytes)
__________________

Last edited by Benoist3012; 04-22-2016 at 08:19.
Benoist3012 is offline
ddhoward
Veteran Member
Join Date: May 2012
Location: California
Old 04-21-2016 , 15:34   Re: [TF2] Ragdoll Fix.
Reply With Quote #2

It would be much better if you grabbed the current values from the player.
__________________
ddhoward is offline
Benoist3012
Veteran Member
Join Date: Mar 2014
Location: CWave::ForceFinish()
Old 04-21-2016 , 15:39   Re: [TF2] Ragdoll Fix.
Reply With Quote #3

They are not overriden, I tested it with the resize plugin. I'm actually setting the values before the entity is dispatched.
__________________
Benoist3012 is offline
ddhoward
Veteran Member
Join Date: May 2012
Location: California
Old 04-21-2016 , 15:48   Re: [TF2] Ragdoll Fix.
Reply With Quote #4

You're setting them to 1.0. What if the player's torso size was 2.0? The ragdoll would not reflect his actual torso size. Right? @_@

Also, the plugin's filename is misspelled.
__________________

Last edited by ddhoward; 04-21-2016 at 16:24.
ddhoward is offline
StormishJustice
Member
Join Date: May 2015
Location: In a mysterious place.
Old 04-21-2016 , 17:09   Re: [TF2] Ragdoll Fix.
Reply With Quote #5

Quote:
Originally Posted by ddhoward View Post
Also, the plugin's filename is misspelled.
He's from france, what did you expect him to be? italian?
__________________

Last edited by StormishJustice; 04-21-2016 at 17:12.
StormishJustice is offline
Send a message via AIM to StormishJustice Send a message via Yahoo to StormishJustice Send a message via Skype™ to StormishJustice
Benoist3012
Veteran Member
Join Date: Mar 2014
Location: CWave::ForceFinish()
Old 04-22-2016 , 00:44   Re: [TF2] Ragdoll Fix.
Reply With Quote #6

Quote:
Originally Posted by ddhoward View Post
You're setting them to 1.0. What if the player's torso size was 2.0? The ragdoll would not reflect his actual torso size. Right? @_@

Also, the plugin's filename is misspelled.
As I said before I set them before the entity is dispatched, try byyourself with the resize plugin the values wont be overriden.
Quote:
Originally Posted by StormishJustice View Post
He's from france, what did you expect him to be? italian?
The problem is not to know if I'm french or not, you are insulting every frenchs by saying that, the problem is I'm not reading what I wrote, so I can have ragodllfix, but the plugin title thread is fine :\, this isn't a matter of origins, anyway I will change the plugin source's name soon.
__________________

Last edited by Benoist3012; 04-22-2016 at 00:50.
Benoist3012 is offline
ddhoward
Veteran Member
Join Date: May 2012
Location: California
Old 04-22-2016 , 00:58   Re: [TF2] Ragdoll Fix.
Reply With Quote #7

I did try it. The torso size of the ragdoll was set to 1, rather than 4. It did fix the weirdness with the 0 size, though. I'll try to post a video of my experiences in a second.

EDIT: https://www.youtube.com/watch?v=8GP4dQq7v3s

Code:
] sm plugins list
 "Admin File Reader" (1.7.3-dev+5301) by AlliedModders LLC
 "[TF2] Glitched Ragdoll Fix!" (0.1) by Benoist3012
 "Basic Commands" (1.7.3-dev+5301) by AlliedModders LLC
 "Resize Players" (1.5.1) by 11530
 "TF2: Roll the Dice" (0.4.4.2) by linux_lover ([email protected])
 "[TF2] Thirdperson" (2.1.0) by DarthNinja
Forcing the "frozen" perk on myself, while sm_resizetorso-ing myself to 4.0, had the following results.

Without your plugin, the ragdoll body part sizes have about a small chance of being 0-size'd, and a large chance of being the same size that the actual player had.

With your plugin, the ragdoll body part sizes have about a small chance of being 1-size'd, and a large chance of being the same size that the actual player had.
__________________

Last edited by ddhoward; 04-22-2016 at 02:26.
ddhoward is offline
Benoist3012
Veteran Member
Join Date: Mar 2014
Location: CWave::ForceFinish()
Old 04-22-2016 , 08:23   Re: [TF2] Ragdoll Fix.
Reply With Quote #8

Quote:
Originally Posted by ddhoward View Post
I did try it. The torso size of the ragdoll was set to 1, rather than 4. It did fix the weirdness with the 0 size, though. I'll try to post a video of my experiences in a second.

EDIT: https://www.youtube.com/watch?v=8GP4dQq7v3s

Code:
] sm plugins list
 "Admin File Reader" (1.7.3-dev+5301) by AlliedModders LLC
 "[TF2] Glitched Ragdoll Fix!" (0.1) by Benoist3012
 "Basic Commands" (1.7.3-dev+5301) by AlliedModders LLC
 "Resize Players" (1.5.1) by 11530
 "TF2: Roll the Dice" (0.4.4.2) by linux_lover ([email protected])
 "[TF2] Thirdperson" (2.1.0) by DarthNinja
Forcing the "frozen" perk on myself, while sm_resizetorso-ing myself to 4.0, had the following results.

Without your plugin, the ragdoll body part sizes have about a small chance of being 0-size'd, and a large chance of being the same size that the actual player had.

With your plugin, the ragdoll body part sizes have about a small chance of being 1-size'd, and a large chance of being the same size that the actual player had.
I see, thanks for the tests, I think I could get the hand/torso/head scale of the dead player and set them on the ragdoll unless it's too late :\

Well at least we don't have squashed ragdolls now ^^
__________________

Last edited by Benoist3012; 04-22-2016 at 08:24.
Benoist3012 is offline
Chdata
Veteran Member
Join Date: Aug 2012
Location: Computer Chair, Illinois
Old 04-22-2016 , 08:56   Re: [TF2] Ragdoll Fix.
Reply With Quote #9

Instead of OnEntityCreated I tend to use event_player_death, requestframe, and grab m_hRagDoll.

Dunno if that's really better or worse, but maybe it'll effect something.
__________________
Chdata is offline
Benoist3012
Veteran Member
Join Date: Mar 2014
Location: CWave::ForceFinish()
Old 04-22-2016 , 13:10   Re: [TF2] Ragdoll Fix.
Reply With Quote #10

Quote:
Originally Posted by Chdata View Post
Dunno if that's really better or worse, but maybe it'll effect something.
Probably both, actually for RTD it would make the code not working.
__________________
Benoist3012 is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 18:47.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode