Raised This Month: $18 Target: $400
 4% 

[L4D & L4D2] Survivor Utilities (API) (v 1.4) [23-Sep-22]


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Earendil
Senior Member
Join Date: Jan 2020
Location: Spain
Plugin ID:
7898
Plugin Version:
1.4
Plugin Category:
Gameplay
Plugin Game:
Left 4 Dead
Plugin Dependencies:
Servers with this Plugin:
6 
Plugin Description:
Modify survivor speeds and add custom effects.
Old 12-25-2021 , 00:23   [L4D & L4D2] Survivor Utilities (API) (v 1.4) [23-Sep-22]
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:
If you only install this plugin, you will have only access to survivor speed control via ConVar.
This plugin modifies survivor moving speeds, but is not a speed scaler that accelerates player movements in all directions making them jump or fall unrealistically fast or slow, it modifies the max speed that the player can run or walk, it doesnít scale survivor movement.
Current speeds that can be modified by ConVar:
  • Running speed.
  • Walking speed.
  • Moving speed on water, should work in L4D.
  • 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).
  • Crouch speed.
  • Exhaust speed (this is an API feature that will only be activated by other plugins).
When the plugin has to choose different speeds in a situation, will choose the most restrictive one. (Lets say that your walk speed is higher than water speed, if a survivor tries to walk on water plugin will set his speed to the water speed to prevent to cheat speed on water).
Others plugins can use the Natives provided in this plugin to change specific survivor speeds, for perks, RPG, or anything you can imagine.
As an API this plugin has the next conditions for survivors:
  • 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.
NEW: 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 (51.8 KB, 127 views)

Last edited by Earendil; 09-23-2022 at 08:44. Reason: Updated to 1.4
Earendil is offline
Earendil
Senior Member
Join Date: Jan 2020
Location: Spain
Old 12-25-2021 , 00: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 08:55.
Earendil is offline
a2121858
Member
Join Date: Sep 2020
Old 12-26-2021 , 22: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 , 06: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 , 08: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 , 21: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 , 06: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 06:57.
Sev is offline
Earendil
Senior Member
Join Date: Jan 2020
Location: Spain
Old 01-06-2022 , 19: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 , 06: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 , 19: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 19:11.
Earendil is offline
Reply


Thread Tools
Display Modes

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 20:33.


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