Garry's Mod

Garry's Mod

148 ratings
Crippling Damage
2
   
Award
Favorite
Favorited
Unfavorite
Content Type: Addon
Addon Type: Effects
Addon Tags: Roleplay, Realism
File Size
Posted
Updated
6.820 KB
13 Mar, 2021 @ 5:34pm
20 Mar, 2021 @ 3:48pm
6 Change Notes ( view )

Subscribe to download
Crippling Damage

Description
What is this?
This is a simple, lightweight addon that changes players' max speeds when they reach configurable health thresholds, similar to the movement of the Left 4 Dead games. This should make combat more realistic and immersive and visceral and all sorts of other buzzwords!

Although I didn't even look at the code from it, I have to mention Sninctbur's "Damage Slow" addon, which clearly inspired this addon's functionality. However, Crippling Damage is more flexible for customization and should be more compatible (e.g. it won't interfere with any other addons that change player speeds, works regardless of the player's normal max speed, etc). In addition to making players slower at certain thresholds, you can also use this addon to make players speed up when they hit a given health threshold.

By default, the addon sets 66% max speed at 40% health and 33% max speed at 15% health. These numbers are inspired by Left 4 Dead, so they should feel pretty familiar. If you prefer to use raw health instead of percentages (e.g. 66% max speed at 40 hp instead of at 40% hp), or if you want to add, remove, or change thresholds, see "Customizing" below.

If you're looking for an addon that will temporarily slow players down whenever they take damage, check out Stopping Power!


Customizing
If you want to tinker with the numbers, it is easily configured using the in-game console:

crippledmg_enable <0 or 1>
crippledmg_enable 1
Enables/disables the addon

crippledmg_as_percentage <0 or 1>
crippledmg_as_percentage 1
When 1, thresholds are set as a % of the player's max HP; otherwise just the raw HP value

crippledmg_thresholds_list
This command prints the current thresholds to the console (server-side)

crippledmg_thresholds_set <HP> <SpeedMult>
crippledmg_thresholds_set 40 0.66
crippledmg_thresholds_set 15 0.33

Sets or creates a threshold at the given hp with the given speed multiplier

crippledmg_thresholds_remove <HP>
Removes the threshold at the given hp

crippledmg_file <FileName>
crippledmg_file crippledmg_thresholds.txt
Sets the name of the config file to use for save/load (located in garrysmod/data/). The file is automatically generated and saved to when making changes to thresholds.

crippledmg_thresholds_reload
Forces a reload from the file specified by crippledmg_file. An initial load happens automatically when Lua starts. Use this command after crippledmg_file if you are switching files.

crippledmg_reset_all_players
Reset all players' current speeds. This may be helpful if you encounter bugs.

crippledmg_tick_time <TickSecs>
crippledmg_tick_time 0.05
Sets how frequently Crippling Damage will check player HP. Increase this value if the addon is too taxing on your server.


Source Code
Want to look at the code? Well, it's dedicated to the public domain, and you can find it here:
GitHub repo[github.com]
22 Comments
Penser 26 May, 2023 @ 5:59am 
The guy below gave me an idea how to use this in my movement pack... NICE
It's alxl! c:  [author] 1 Feb, 2023 @ 5:43pm 
No, it only affects players. I'm not sure GMod supports a good way to modify NPC movement speed on the fly (it's probably a limitation with the Source engine).
CybeRonin 1 Feb, 2023 @ 5:21pm 
does this effect npcs?
CUP 6 Jul, 2022 @ 6:08pm 
no pick no walter
Apis 6 Jun, 2022 @ 6:10pm 
I got this to use it as the opposite.
What doesn't kill me......


Makes. Me. STRONGER.
Awakened NPC. 31 Mar, 2022 @ 1:41pm 
no pic no clicc
marples 12 Feb, 2022 @ 3:30pm 
people are saying no pick no click when what is does is slow you down when you get to a point of health how are you meant to show that in a image
782 14 Jan, 2022 @ 10:50am 
same
Bob 31 Dec, 2021 @ 8:27pm 
2022 coment
FloppaFloppowicz 17 Oct, 2021 @ 9:36am 
Crippling Damage...


I have crippling depression