AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [L4D2] Client-sided Survivor Ragdolls (https://forums.alliedmods.net/showthread.php?t=319686)

Shadowysn 11-15-2019 05:19

[L4D2] Client-sided Survivor Ragdolls
 
13 Attachment(s)
First plugin released into the public.

This is like Mr. Zero's Restore Ragdoll plugin, except it functions on ALL deaths, including suicides.
You can also choose to make the static death model invisible, remove it, or do nothing to the body.

It also comes with manually spawning the ragdolls yourself, for funsies.
The plugin supports L4D1, but only has the feature to manual-spawn ragdolls.

There's a toggleable function to stop m_isFallingFromLedge deaths from removing the static model.
However, it uses the same method Zero used to know if a player will die, so it will not be able to detect suicides/slays.
But survivors that were falling are already going to die anyway, and it works for just falling to your death, so it shouldn't be much of a problem to keep this feature on.

-= ConVars/Commands =-
sm_custom_survivor_ragdoll 1 - min:0/max:1
^ Toggle usage of non-ledge based ragdoll deaths.

sm_c_survivor_ragdoll_staticbody 0 - min:0/max:2
^ 0 - Make static body invisible. 1 - Remove static body. 2 - Do nothing. 3 - Make static body transparent.

sm_c_survivor_ragdoll_ledge 1 - min:0/max:1
^ Toggle preventing ledge deaths from making victims unrevivable.

sm_c_survivor_ragdoll_nolimit 0 - min:0/max:1
^ 0 - Use game's preferred ragdoll limits. 1 - Use CI ragdoll limits. (Beware - this could wreak havoc on older computers!)

sm_c_survivor_ragdoll_dual_drop 1 - min:0/max:1
^ Toggle whether players should drop their extra pistol upon death.

sm_ragdoll = Spawn a client ragdoll on yourself.

-= Further Info =-

- The plugin automatically adds a function to the admin menu called 'Spawn ragdoll on' that lets you manually spawn a ragdoll on a chosen player from it's list.
- <BUG> Manually spawning a ragdoll on anyone has the chance to make them invisible on one or more client's ends. Could possibly be caused by the method of setting the ragdoll's player netprop to the chosen player.


-= Releases =-
Code:

Version 1.1.5
- Some optimization and refactoring of previous code ugliness, and removed useless commented code.
Version 1.1.4
- Preventing ledge-hanging fall deaths from removing the death model now uses the method Zero used to detect whether a survivor is going to die.
This lets survivors play the falling animation properly again, but also results in inaccuracies with slays/suicides whilst falling.
Version 1.1.3
- Fixed 'Spawn ragdoll on' not getting added to admin menu upon plugin's first load on a new map. Definitely.
Version 1.1.2
- Fixed a bug with sm_c_survivor_ragdoll_dual_drop that made non-dual wielding players drop an extra pistol after they die and get revived.
Version 1.1.1
- Added sm_c_survivor_ragdoll_dual_drop.
Version 1.1.0
- Attempt to fix 'Spawn ragdoll on' not getting added to admin menu upon plugin's first load on a new map.
Version 1.0.9
- Added sm_c_survivor_ragdoll_nolimit.
Version 1.0.7
- Used PostThinkPost hook instead of PreThink on Lux's suggestion.
- Edited code's replacement for falling-off-after-hanging deaths.
Version 1.0.6
- Usage of m_iDeathPose and m_iDeathFrame now results in (almost) proper ragdoll deaths.
Version 1.0.5
- Used a better system of checking whether the game spawned a ledge ragdoll as opposed to a boolean.
- Minor changes to the code.
Version 1.0.1
- Updated various text in the plugin.
Version 1.0.0
- Initial release.


Dreyson 11-18-2019 17:42

Re: [L4D2] Consistent Client-sided Survivor Ragdolls
 
Hi, i am new to the forums and i know how to install plugins just that do i click install plugin or get source? Thanks!

Dreyson 11-18-2019 20:43

Re: [L4D2] Consistent Client-sided Survivor Ragdolls
 
Thanks but the plugin does not work? i put it in plugins and no one will ragdoll and the sm_ragdoll wont work

Shadowysn 11-18-2019 21:59

Re: [L4D2] Consistent Client-sided Survivor Ragdolls
 
Quote:

Originally Posted by Dreyson (Post 2673394)
Thanks but the plugin does not work? i put it in plugins and no one will ragdoll and the sm_ragdoll wont work

Have you made sure it's loaded in? Put sm plugins list in the console to get the list of currently loaded plugins.

If it isn't then do sm plugins load L4D2CSRagdoll in the console.

Dreyson 11-18-2019 22:18

Re: [L4D2] Consistent Client-sided Survivor Ragdolls
 
when i tried to load it it gave me this console error


[SM] Plugin L4D2CSRagdoll.smx failed to load: Native "RemoveEntity" was not found.

Shadowysn 11-18-2019 22:27

Re: [L4D2] Consistent Client-sided Survivor Ragdolls
 
Quote:

Originally Posted by Dreyson (Post 2673408)
when i tried to load it it gave me this console error


[SM] Plugin L4D2CSRagdoll.smx failed to load: Native "RemoveEntity" was not found.

Eh? That shouldn't happen...
Are you using an older version of Sourcemod? The current version as of now is 1.10.
If you don't want to upgrade, you can download the source plugin file, go to the scripting folder in sourcemod, and drag-and-drop the .sp file onto compile.exe.
This should create an .smx in the scripting/compiled folder, compiled in the version of sourcemod you're using. All you need to do next is to move the smx to the plugins folder.

Dreyson 11-20-2019 22:38

Re: [L4D2] Consistent Client-sided Survivor Ragdolls
 
That worked, Thanks! :)

Also i found out that you can defib people with the invisible static model 1 or something, but the defib model is the static model just invisible but it does not follow with the ragdoll it just stays at where the player originally died

Shadowysn 11-21-2019 00:37

Re: [L4D2] Consistent Client-sided Survivor Ragdolls
 
Quote:

Originally Posted by Dreyson (Post 2673807)
That worked, Thanks! :)

Also i found out that you can defib people with the invisible static model 1 or something, but the defib model is the static model just invisible but it does not follow with the ragdoll it just stays at where the player originally died

Yeah, I made the plugin function like that by default. Why sacrifice one or the other when you can enjoy the visuals of a flailing body and also bring them back to life?

Unfortunately, I cannot remove the ragdoll. Once it's spawned for people, it's no longer tied to the server and cannot be interacted with the latter anymore.
It's also the reason I cannot make the static body follow the ragdoll.

Lux 11-22-2019 02:42

Re: [L4D2] Consistent Client-sided Survivor Ragdolls
 
Quote:

<BUG> Manually spawning a ragdoll on specific infected (like the hunter) makes them invisible. I have no idea why it does that.
Likely due to m_hRagdoll being transmitted to other clients causing prediction to hide infected player entity, should work fine if you set m_hRagdoll to -1, but will not have the owner as the client then.

UpdateLedgeHang is done in PostThink, so your prethink hook is 1tick behind on checks, it maybe slite better to use PostThinkPost hook, if you want the checking to be in the sameupdate as ledge release.

CTerrorPlayer::PostThink()
CTerrorPlayer::UpdateLedgeHang()

Spoiler

Shadowysn 11-22-2019 03:26

Re: [L4D2] Consistent Client-sided Survivor Ragdolls
 
Quote:

Originally Posted by Lux (Post 2673959)
Likely due to m_hRagdoll being transmitted to other clients causing prediction to hide infected player entity, should work fine if you set m_hRagdoll to -1, but will not have the owner as the client then.

UpdateLedgeHang is done in PostThink, so your prethink hook is 1tick behind on checks, it maybe slite better to use PostThinkPost hook, if you want the checking to be in the sameupdate as ledge release.

CTerrorPlayer::PostThink()
CTerrorPlayer::UpdateLedgeHang()

Spoiler

But the only instance I've ever set the newly-created ragdoll to the client's m_hRagdoll netprop is locked behind checks that only do their action if the player is dead and there isn't another ragdoll of the client.

I'm suspecting that the m_hPlayer netprop on the ragdoll is the most likely cause for this, as before that netprop was even used the Hunters didn't have the bug when I create a ragdoll on them.

Thanks for the info, I guess I'll try PostThinkPost sometime.
It sucks to not have a decompiler for IDA Free.


All times are GMT -4. The time now is 19:52.

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