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

[L4D & L4D2] Survivor Utilities (API) (v 1.5.1) [19-Mar-23]


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Earendil
Senior Member
Join Date: Jan 2020
Location: Spain
Plugin ID:
7898
Plugin Version:
1.5
Plugin Category:
Gameplay
Plugin Game:
Left 4 Dead
Plugin Dependencies:
Servers with this Plugin:
12 
Plugin Description:
Modify survivor speeds and add custom effects.
Old 12-24-2021 , 23:23   [L4D & L4D2] Survivor Utilities (API) (v 1.5.1) [19-Mar-23]
Reply With Quote #1

About:
I’m making some plugins that changes survivor speeds and adds effects (better freeze, intoxication, bleeding, ect), to prevent multiple calls and bugs between plugins making the same effect, and to prevent redundancy, I have done this plugin that acts as an API, to allow plugins to work well together.
If you want to make plugins using this, you are free to do, also you can install this plugin in your server and change global player speeds with convars (to acces to other features you need to use other plugins, that I will upload too when I complete them).

Description:

Survivor movement speed modify:
This plugin modifies survivor moving speeds, jump and fall speed don't change, so the speed effect feels more realistic.
Current speeds that can be modified by ConVar:
  • Running speed.
  • Walking speed.
  • Crouch speed.
  • Moving speed on water.
  • Limping speed (when survivor health is lower than 40 by default).
  • Critical speed (probably will have other name, but this refers to the survivor speed when he has been incapacitated once and HP falls to 1).
  • Movement speed while using an sniper scope.
  • Exhaust speed (this is an API feature that will only be activated by other plugins).

Rules of how speeds are being assigned:
  • Run, walk or crouch speeds are independent, and won't restrict the others (you can set walk speed faster than run speed if you want).
  • If the survivor is having one or more conditions that decreases the main speed, it will set the most restrictive.
  • If a restrictive speed has a higher value than the main speed, it won't be applied, restrictive speeds don't boost main speeds.
  • Adrenaline will prevent survivors to lose speed due to restrictions, just like in the original game.
Other plugins can use the Natives provided in this plugin to change specific survivor speeds, for perks, RPG, or anything you can imagine.

IMPORTANT Changes in the speed system. The plugin now has 2 systems or kernels to modify survivor speeds:
  • 1 - Legacy kernel:
    It uses Left 4 DHooks forwards to change survivor speeds. It has a much lower chance to conflict with other plugins that change player speeds, since the method used is not very often used. But in the other hand speeds are restricted between 65 and 650 units. Any speed under 65 will make survivors stop moving, and values over 650 will have no effect. Moreover, when boosted players jump they will notice an strange push in the direction of their movement.
  • 2 - New kernel:
    This one doesn't require Left 4 DHooks, if you don't have that plugin installed, only this kernel will work. It uses the "m_flLaggedMovementValue" netprop to scale survivor speeds. This kernel will conflict with other plugins that uses the same system to scale speeds, but the limitations are removed, you can set speed value with this kernel without restrictions. This kernel works getting the mechanics from here.
  • What kernel should be used?
    It depends of the situation, by default the new kernel is enabled and is the most recomended option, but in case you start experiencing incompatibilities with other plugins, you should use the legacy kernel.
Survivor conditions accesible from natives and forwards:
  • Bleeding: Survivors will lose health over time, bleeding can be stopped if the survivor uses a medkit.
  • Intoxication: Survivors will lose health over time due to an intoxication, it can be stopped if the survivor uses pain pills or adrenaline.
  • Improved freeze: Survivor is unable to move, shoot, reload or shove, also a screen effect is displayed while the survivor is frozen.
  • Exhaustion, while exhausted the survivor will lose movement speed, maxed shove penalty and increased recoil, a screen effect is displayed (thanks to Silvers for the fog_volume and postprocess code). Exhaust can be cancelled with adrenaline, also if the survivor doesn’t move will recover faster.

Health, defib and revive hooks.
  • Detoured survivor healing, reviving and defibrillating game functions.
  • Survivor revive heal or defib duration can be override with GlobalForwards.
  • Functions can also be blocked to prevent survivors to revive or perform healing.


Natives
Spoiler
GlobalForwards
You can hook, change or even block plugin natives via GlobalForwards.
Spoiler
ConVars:
Spoiler
Dependences:by Silvers.


Test Plugin:
The plugin l4d_su_testplugin.smx includes admin commands and has all GlobalForwards and Natives tested.

Extension:
Also I have included a plugin extension l4d_su_notifications.smx that will notify to the survivors when effects start/end.

Thanks:
To Silvers for the help with the postprocess controller and fog_volume solutions and helping with Natives and Forwards.
Source Code

Changelog:
Spoiler
Attached Files
File Type: zip l4d_survivor_utilities.zip (60.5 KB, 600 views)
__________________
>>My plugins<<
>>GitHub<<

Last edited by Earendil; 03-18-2023 at 21:30. Reason: Updated to 1.5.1
Earendil is offline
Earendil
Senior Member
Join Date: Jan 2020
Location: Spain
Old 12-24-2021 , 23:23   Re: [L4D & L4D2] Surivor Utilities (API)
Reply With Quote #2

I'm making some plugins to show how to take the benefit of this utility:

Survivor Sprint, Stamina and Exhaustion
Use this one as a guide of how to manipulate player speeds. Since Natives change player absolute speed, this plugins doesn't override permanently the survivor speed of other plugins.

Last edited by Earendil; 12-25-2021 at 07:55.
Earendil is offline
a2121858
Member
Join Date: Sep 2020
Old 12-26-2021 , 21:55   Re: [L4D & L4D2] Surivor Utilities (API) (v 1.0.3) [25-Dec-21]
Reply With Quote #3

Thank you for your gift.
a2121858 is offline
thewintersoldier97
Senior Member
Join Date: Aug 2021
Location: Vietnam
Old 12-27-2021 , 05:38   Re: [L4D & L4D2] Surivor Utilities (API) (v 1.0.3) [25-Dec-21]
Reply With Quote #4

Wow, very nice plugin Great work Earendil!
__________________

Looking for some fun!
thewintersoldier97 is offline
Earendil
Senior Member
Join Date: Jan 2020
Location: Spain
Old 12-30-2021 , 07:48   Re: [L4D & L4D2] Survivor Utilities (API) (v 1.1) [30-Dec-21]
Reply With Quote #5

New update to 1.1

Now you can add an exhaustion amount to survivors. Any plugin compiled with an older version will still work, exhaustion can be stacked just like the other effects. Also I fixed some bugs.
Earendil is offline
Earendil
Senior Member
Join Date: Jan 2020
Location: Spain
Old 01-01-2022 , 20:12   Re: [L4D & L4D2] Survivor Utilities (API) (v 1.1.1) [01-Jan-21]
Reply With Quote #6

Ok I was messing everything with timers. Now they are fixed and no Handle errors related to timers should appear.
Earendil is offline
Sev
Veteran Member
Join Date: May 2010
Old 01-04-2022 , 05:56   Re: [L4D & L4D2] Survivor Utilities (API) (v 1.1.1) [01-Jan-21]
Reply With Quote #7

L 01/03/2022 - 1734: [SM] Exception reported: SU_GetSpeed Error: Client 9 is not survivor.
L 01/03/2022 - 1734: [SM] Blaming: l4d_survivor_utilities.smx
L 01/03/2022 - 1734: [SM] Call stack trace:
L 01/03/2022 - 1734: [SM] [0] ThrowNativeError
L 01/03/2022 - 1734: [SM] [1] Line 1160, l4d_survivor_utilities.sp::Native_GetFreeze
L 01/03/2022 - 1734: [SM] [3] SU_IsFrozen
L 01/03/2022 - 1734: [SM] [4] Line 361, l4d_survivor_utilities.sp::Event_Player_Repla ced

Last edited by Sev; 01-04-2022 at 05:57.
Sev is offline
Earendil
Senior Member
Join Date: Jan 2020
Location: Spain
Old 01-06-2022 , 18:24   Re: [L4D & L4D2] Survivor Utilities (API) (v 1.1.1) [01-Jan-21]
Reply With Quote #8

Quote:
Originally Posted by Sev View Post
L 01/03/2022 - 1734: [SM] Exception reported: SU_GetSpeed Error: Client 9 is not survivor.
L 01/03/2022 - 1734: [SM] Blaming: l4d_survivor_utilities.smx
L 01/03/2022 - 1734: [SM] Call stack trace:
L 01/03/2022 - 1734: [SM] [0] ThrowNativeError
L 01/03/2022 - 1734: [SM] [1] Line 1160, l4d_survivor_utilities.sp::Native_GetFreeze
L 01/03/2022 - 1734: [SM] [3] SU_IsFrozen
L 01/03/2022 - 1734: [SM] [4] Line 361, l4d_survivor_utilities.sp::Event_Player_Repla ced
Did it happen in VS mode? I think it happened due to team change, I will take a look.
Earendil is offline
Sev
Veteran Member
Join Date: May 2010
Old 01-07-2022 , 05:03   Re: [L4D & L4D2] Survivor Utilities (API) (v 1.1.1) [01-Jan-21]
Reply With Quote #9

Quote:
Originally Posted by Earendil View Post
Did it happen in VS mode? I think it happened due to team change, I will take a look.
Probably. I admittedly only retrieved the error from my logs but I have noticed some VS games lately on my server, so it was probably in that mode.
Sev is offline
Earendil
Senior Member
Join Date: Jan 2020
Location: Spain
Old 01-09-2022 , 18:09   Re: [L4D & L4D2] Survivor Utilities (API) (v 1.1.1) [01-Jan-21]
Reply With Quote #10

Quote:
Originally Posted by Sev View Post
Probably. I admittedly only retrieved the error from my logs but I have noticed some VS games lately on my server, so it was probably in that mode.
I added a check when a player is replaced by a bot when survivors change teams. This error message was harmless, like some of them, but they are there to point when a plugin is trying to get incorrect data from players, like it happened with that message error.

EDIT: I'm adding a bigger update that will allow plugins to modify revive/heal/defib duration per player and also scale healing animations (the animation part is almost done).

Last edited by Earendil; 01-09-2022 at 18:11.
Earendil 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 03:10.


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