AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Snippets and Tutorials (https://forums.alliedmods.net/forumdisplay.php?f=112)
-   -   [TF2] Ragdoll Fix. (https://forums.alliedmods.net/showthread.php?t=281819)

Benoist3012 04-21-2016 15:22

[TF2] Ragdoll Fix.
 
1 Attachment(s)
Hi everyone,
So one of my friends made a good discovery:
https://photos-2.dropbox.com/t/2/AAC...&size=1280x960

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.

ddhoward 04-21-2016 15:34

Re: [TF2] Ragdoll Fix.
 
It would be much better if you grabbed the current values from the player.

Benoist3012 04-21-2016 15:39

Re: [TF2] Ragdoll Fix.
 
They are not overriden, I tested it with the resize plugin. I'm actually setting the values before the entity is dispatched.

ddhoward 04-21-2016 15:48

Re: [TF2] Ragdoll Fix.
 
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.

StormishJustice 04-21-2016 17:09

Re: [TF2] Ragdoll Fix.
 
Quote:

Originally Posted by ddhoward (Post 2412980)
Also, the plugin's filename is misspelled.

He's from france, what did you expect him to be? italian?

Benoist3012 04-22-2016 00:44

Re: [TF2] Ragdoll Fix.
 
Quote:

Originally Posted by ddhoward (Post 2412980)
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 (Post 2412989)
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.

ddhoward 04-22-2016 00:58

Re: [TF2] Ragdoll Fix.
 
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.

Benoist3012 04-22-2016 08:23

Re: [TF2] Ragdoll Fix.
 
Quote:

Originally Posted by ddhoward (Post 2413056)
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 ^^

Chdata 04-22-2016 08:56

Re: [TF2] Ragdoll Fix.
 
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.

Benoist3012 04-22-2016 13:10

Re: [TF2] Ragdoll Fix.
 
Quote:

Originally Posted by Chdata (Post 2413144)
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.


All times are GMT -4. The time now is 21:12.

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