View Single Post
Author Message
404UserNotFound
BANNED
Join Date: Dec 2011
Old 03-26-2017 , 01:51   [TF2] tf_ragdoll -> issues with m_flModelScale, also general loadout change issues
Reply With Quote #1

I've been screwing around with ragdolls. I've got what I set out to create working beautifully, other than two issues (one minor, one major).

The minor issue is that I can't seem to set m_flModelScale on a tf_ragdoll entity I've created.
- SetEntPropFloat results in "tf_ragdoll doesn't have m_flModelScale" nonsense which Google has shown me may be a result of something to do with EntIndexToEntRef
- Using AcceptEntityInput to set SetModelScale results in "Entity is not a CBaseEntity"

The major issue is that for some reason, loadout changes completely stop functioning on my test server after a while. With a lot of help from Pelipoika, I figured out m_hRagWearables and have been successfully spawning ragdolls that have the same cosmetics as the player and also respect the player's current hand/torso/head scale (m_flModelScale was the last thing I wanted to get working).

So those are my 2 problems.

Spoiler below contains my testing plugin. I figure it'll potentially help someone out with something. For example, that "unused burning death animations" plugin that was created from a snippet I put out, the wearables stuff would be perfect for that plugin. Aside from the aforementioned 2 issues, the plugin works like a charm. I've already got plans for this code including using it to update the tf_ragdolls in my Roll The Dice to respect the player's wearables/scale for "Freeze" and my custom "Midas Touch" RTD perk. It'd also be useful for the sm_freeze command as a better alternative to "color the player blue" and it'd definitely be useful for this plugin.

Please don't be too harsh on my formatting style and how I did things. It's just a private testing plugin that is acting as the launchpad for a few ideas I have.

NOTE: The "sm_rag" command in the plugin below doesn't just create a ragdoll where you are with your cosmetics; it turns you entirely invisible, blocks all attacking and sets you to MOVETYPE_NONE. Think of it as a TF2 version of a Garry's Mod "Ragdoll a player" command. The firstperson view when you're "ragdolled" isn't the best (you're practically inside the ragdoll). Probably because of my stupid fuckin' usage of SetClientViewEntity and AcceptEntityInput on "SetForcedTauntCam" at the same time.

Spoiler

Last edited by 404UserNotFound; 04-02-2018 at 13:03.
404UserNotFound is offline