AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [L4D & L4D2] Stagger Animation - Gravity Allowed (1.5) [30-Apr-2024] (https://forums.alliedmods.net/showthread.php?t=344297)

Silvers 10-24-2023 23:39

[L4D & L4D2] Stagger Animation - Gravity Allowed (1.5) [30-Apr-2024]
 
13 Attachment(s)
About:
  • Allows gravity when players are staggering, otherwise they would float in the air until the animation completes.
  • Also allows staggering over a ledge and falling.
  • Works for all players.

Thanks:
  • ForgeTest - For the idea, helping with code and testing.


Cvars:

Saved to l4d_stagger_gravity.cfg in your servers \cfg\sourcemod\ folder.

PHP Code:

// Allow staggering when in the air for these types: 1=Survivors, 2=Smoker, 4=Boomer, 8=Hunter, 16=Spitter, 32=Jockey, 64=Charger, 128=Tank, 255=All.
l4d_stagger_gravity_air "255"

// 0=Plugin off, 1=Plugin on.
l4d_stagger_gravity_allow "1"

// Turn on the plugin in these game modes, separate by commas (no spaces). (Empty = all).
l4d_stagger_gravity_modes ""

// Turn off the plugin in these game modes, separate by commas (no spaces). (Empty = none).
l4d_stagger_gravity_modes_off ""

// Turn on the plugin in these game modes. 0=All, 1=Coop, 2=Survival, 4=Versus, 8=Scavenge. Add numbers together.
l4d_stagger_gravity_modes_tog "0"

// When using the command should players: 1=Stagger backwards. 2=Stagger forwards. 3=Stagger in random direction.
l4d_stagger_gravity_cmd "1"

// Stop staggering after falling off a ledge for these types: 1=Survivors, 2=Smoker, 4=Boomer, 8=Hunter, 16=Spitter, 32=Jockey, 64=Charger, 128=Tank, 255=All.
l4d_stagger_gravity_stop "0"

// Enable gravity when staggering for these types: 1=Survivors, 2=Smoker, 4=Boomer, 8=Hunter, 16=Spitter, 32=Jockey, 64=Charger, 128=Tank, 255=All.
l4d_stagger_gravity_type "255"

// Plugin version
l4d_stagger_gravity_version 



Changes:
Code:

1.5 (30-Apr-2024)
    - Fixed not resetting a variable which could cause subsequent staggers to not be blocked.

1.4 (10-Jan-2024)
    - Changed the plugins on/off/mode cvars to use the "Left 4 DHooks" method instead of creating an entity.

1.3 (24-Nov-2023)
    - Changes to prevent shoving and shooting/shoving/moving whilst stumbling. Thanks to "ProjectSky" for reporting.
    - Fixed possibly creating the "info_gamemode" entity before map start, depending on cvars.
    - Fixed unhook event errors when turning the plugin off.

1.2 (23-Nov-2023)
    - Fixed the plugin sometimes crashing the server on map change. Thanks to "chungocanh12" for reporting.

1.1 (07-Nov-2023)
    - Changed method of getting stagger duration. Reading memory was from the old test version, better to use GetEntDataFloat.

1.0 (25-Oct-2023)
    - Initial release.

0.1 (08-Dec-2022)
    - Initial creation.



Requirements:
  1. Left 4 DHooks Direct plugin version 1.139 or newer.
  2. SourceMod version 1.11 or newer.


Installation:
DO NOT click 'Get Plugin' or it will fail to compile because this plugin requires Left 4 DHooks Direct!
  1. Download the .smx file and put into your servers \addons\sourcemod\plugins folder.

chungocanh12 11-09-2023 21:42

Re: [L4D & L4D2] Stagger Animation - Gravity Allowed (1.1) [07-Nov-2023]
 
i'm using it in my dedicated and crash my server alot. test around 3 hours.
ex: playgame -> chapter 1 ( play normal) -> complete chapter 1 -> loading next chapter (crash my server).
without your plugin my server play normal and no crash or error.

i'm not good in english, sorry

Silvers 11-23-2023 04:38

Re: [L4D & L4D2] Stagger Animation - Gravity Allowed (1.2) [23-Nov-2023]
 
Code:

1.2 (23-Nov-2023)
    - Fixed the plugin sometimes crashing the server on map change. Thanks to "chungocanh12" for reporting.


chungocanh12 11-24-2023 01:50

Re: [L4D & L4D2] Stagger Animation - Gravity Allowed (1.2) [23-Nov-2023]
 
Quote:

Originally Posted by Silvers (Post 2813413)
Code:

1.2 (23-Nov-2023)
    - Fixed the plugin sometimes crashing the server on map change. Thanks to "chungocanh12" for reporting.


thank mate

ProjectSky 11-24-2023 06:47

Re: [L4D & L4D2] Stagger Animation - Gravity Allowed (1.2) [23-Nov-2023]
 
stagger distance in the air seem farther than on the ground?
stagger player can still perform action (WASD, attack...)

https://imgur.com/BWI7Mjw

Silvers 11-24-2023 17:34

Re: [L4D & L4D2] Stagger Animation - Gravity Allowed (1.3) [24-Nov-2023]
 
Code:

1.3 (24-Nov-2023)
    - Changes to prevent shoving and shooting/shoving/moving whilst stumbling. Thanks to "ProjectSky" for reporting.
    - Fixed possibly creating the "info_gamemode" entity before map start, depending on cvars.
    - Fixed unhook event errors when turning the plugin off.


HarryPotter 11-26-2023 08:30

Re: [L4D & L4D2] Stagger Animation - Gravity Allowed (1.3) [24-Nov-2023]
 
Test in l4d1 windows/linux

left4dhooks: 1.39
Stagger Animation - Gravity Allowed: 1.3

PHP Code:

L 11/26/2023 21:28:32: [SMException reportedInvalid Handle 94e00dd6 (error 2). It looks like you've chosen the wrong hook callback signature for your setup and you're trying to access the wrong handle.
L 11/26/2023 21:28:32: [SMBlamingleft4dhooks.smx
L 11
/26/2023 21:28:32: [SMCall stack trace:
L 11/26/2023 21:28:32: [SM]   [0DHookParam.Get
L 11
/26/2023 21:28:32: [SM]   [1Line 2988l4dd\l4dd_forwards.sp::DTR_CTerrorPlayer_OnShovedByPounceLanding
L 11
/26/2023 21:28:32: [SMException reportedInvalid Handle 95b00dd6 (error 2). It looks like you've chosen the wrong hook callback signature for your setup and you're trying to access the wrong handle.
L 11/26/2023 21:28:32: [SMBlamingleft4dhooks.smx
L 11
/26/2023 21:28:32: [SMCall stack trace:
L 11/26/2023 21:28:32: [SM]   [0DHookParam.Get
L 11
/26/2023 21:28:32: [SM]   [1Line 3011l4dd\l4dd_forwards.sp::DTR_CTerrorPlayer_OnShovedByPounceLanding_Post
L 11
/26/2023 21:29:26: [SMException reportedInvalid Handle c4900ac1 (error 2). It looks like you've chosen the wrong hook callback signature for your setup and you're trying to access the wrong handle.
L 11/26/2023 21:29:26: [SMBlamingleft4dhooks.smx
L 11
/26/2023 21:29:26: [SMCall stack trace:
L 11/26/2023 21:29:26: [SM]   [0DHookParam.Get
L 11
/26/2023 21:29:26: [SM]   [1Line 2988l4dd\l4dd_forwards.sp::DTR_CTerrorPlayer_OnShovedByPounceLanding
L 11
/26/2023 21:29:26: [SMException reportedInvalid Handle c4c00dd2 (error 2). It looks like you've chosen the wrong hook callback signature for your setup and you're trying to access the wrong handle.
L 11/26/2023 21:29:26: [SMBlamingleft4dhooks.smx
L 11
/26/2023 21:29:26: [SMCall stack trace:
L 11/26/2023 21:29:26: [SM]   [0DHookParam.Get
L 11
/26/2023 21:29:26: [SM]   [1Line 3011l4dd\l4dd_forwards.sp::DTR_CTerrorPlayer_OnShovedByPounceLanding_Post
L 11
/26/2023 21:29:26: [SMException reportedInvalid Handle c4e00ac1 (error 2). It looks like you've chosen the wrong hook callback signature for your setup and you're trying to access the wrong handle.
L 11/26/2023 21:29:26: [SMBlamingleft4dhooks.smx
L 11
/26/2023 21:29:26: [SMCall stack trace:
L 11/26/2023 21:29:26: [SM]   [0DHookParam.Get
L 11
/26/2023 21:29:26: [SM]   [1Line 2988l4dd\l4dd_forwards.sp::DTR_CTerrorPlayer_OnShovedByPounceLanding
L 11
/26/2023 21:29:26: [SMException reportedInvalid Handle c5b00ac1 (error 2). It looks like you've chosen the wrong hook callback signature for your setup and you're trying to access the wrong handle.
L 11/26/2023 21:29:26: [SMBlamingleft4dhooks.smx
L 11
/26/2023 21:29:26: [SMCall stack trace:
L 11/26/2023 21:29:26: [SM]   [0DHookParam.Get
L 11
/26/2023 21:29:26: [SM]   [1Line 3011l4dd\l4dd_forwards.sp::DTR_CTerrorPlayer_OnShovedByPounceLanding_Post 


soda3000 04-15-2024 12:41

Re: [L4D & L4D2] Stagger Animation - Gravity Allowed (1.4) [10-Jan-2024]
 
I really like this plugin and the quality of life it brings.

I have noticed some complications while using it for some time now on my server.

FYI - I typically run the server at 100 tick rate.

Some things I noticed:

1. Occasionally chargers will crash into a wall and stumble, and in doing so will move extremely fast in a seemingly random direction, about 10ft or meters away.
- It almost looks like they are teleporting, but I think it's more like the plugin is perhaps trying to align them on the ground and unintentionally increasing their velocity very quickly.
- Sometimes I believe this applies to survivors who are stumbled by the charger as well, when he hits the wall near them.

2. Stumbling off ledge, instead of getting 'ledged'.
- During a stumble animation, if the survivor happens to stumble off of a hang-spot, they will not hang, but rather fall to their death.
- This is quite annoying if it happens to you, since you are not expecting to be fully dead, just ledged.

Besides these couple things, the plugin seems to work exactly as expected.

Please let me know if you want me to get some footage, and I will try to capture these things on video and post here.

Thanks for your work :)

Silvers 04-16-2024 03:17

Re: [L4D & L4D2] Stagger Animation - Gravity Allowed (1.4) [10-Jan-2024]
 
Quote:

Originally Posted by soda3000 (Post 2820987)
I have noticed some complications while using it for some time now on my server.

These issues are most likely because the animation when triggered would push players in a specific direction and expect them to be at a certain position when the animation finishes, but because this plugin interrupts the animation they are in a different position then what the game is expecting so they get teleported. I thought I had fixed these issues, I noticed them when making the plugin. I guess that still happens in specific circumstances.

I hope this is being caused by detecting the wrong animation number, or possibly a missing animation number, which would have to be fixed in Left4DHooks. I'll verify them when I get time.

Otherwise I'm not sure what else I could do, especially for ledge hanging, that whole system looks messy. Does it happen every time you stumble off a ledge? I remember testing and it worked fine, but if that always happens then again I'm not sure what could be done. Edit: tested and it would always cause me to ledge hang.

A short video of this happening in either instance or both could be useful, if you have time and capture it.

Maybe I can send you a debug version of Left4DHooks to log animation numbers, do you have discord? PM me.

soda3000 04-25-2024 13:28

Re: [L4D & L4D2] Stagger Animation - Gravity Allowed (1.4) [10-Jan-2024]
 
Quote:

Originally Posted by Silvers (Post 2821011)
These issues are most likely because the animation when triggered would push players in a specific direction and expect them to be at a certain position when the animation finishes, but because this plugin interrupts the animation they are in a different position then what the game is expecting so they get teleported. I thought I had fixed these issues, I noticed them when making the plugin. I guess that still happens in specific circumstances.

I hope this is being caused by detecting the wrong animation number, or possibly a missing animation number, which would have to be fixed in Left4DHooks. I'll verify them when I get time.

Otherwise I'm not sure what else I could do, especially for ledge hanging, that whole system looks messy. Does it happen every time you stumble off a ledge? I remember testing and it worked fine, but if that always happens then again I'm not sure what could be done. Edit: tested and it would always cause me to ledge hang.

A short video of this happening in either instance or both could be useful, if you have time and capture it.

Maybe I can send you a debug version of Left4DHooks to log animation numbers, do you have discord? PM me.

Okay not gonna lie, I might have been totally buggin.

I went to go retest thinking I would be able to capture footage to provide, but I wasn't able to replicate either the ledging issue, nor the charger teleport issue...

Not really sure how, but as far as I'm concerned, it seemed to be working perfectly when I retested.
Very strange, considering I was nearly certain nothing changed since I last experienced these issues..

Regardless, apologies!
It appears all is working from what I can tell.

If I notice anything again regarding this plugin, I shall update you!

BTW, I do have discord @xxnoobslayer
I'm an amateur L4D2 plugin dev and spend a lot of time checking out the cool stuff people make for the game :D


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

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