Garry's Mod

Garry's Mod

240 ratings
Stopping Power - Damage slows you down
2
   
Award
Favorite
Favorited
Unfavorite
Content Type: Addon
Addon Type: Effects
Addon Tags: Roleplay, Realism
File Size
Posted
Updated
8.344 KB
9 Mar, 2021 @ 11:40pm
17 Mar, 2021 @ 12:19pm
13 Change Notes ( view )

Subscribe to download
Stopping Power - Damage slows you down

In 1 collection by It's alxl! c:
ttt gubbins wot alxl likes
38 items
Description
What is this?
This is a simple, lightweight addon that makes players temporarily slow down when they take damage, similar to the movement of the Left 4 Dead or Counter-Strike games. This should make combat more realistic and immersive and visceral and all sorts of other buzzwords!

This addon is made in an uninvasive way, so it should be compatible with virtually every other addon.

If you want an addon that sets each player's max speed based on how much health they have, check out Crippling Damage!


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

stoppower_enable <0 or 1>
stoppower_enable 1
Enables or disables the addon

stoppower_dmg_mult <Mult>
stoppower_dmg_mult 0.05
Sets the base slowdown amount per damage taken. A value of 1.0 means the player is brought down to 0% speed after taking 1 damage.

The slowdown also receives a configurable multiplier based on what kind of damage was received. The defaults for each are listed below. A value of 2.0 for these means the slowdown is doubled; a value of 0.0 means the slowdown is negated.

stoppower_dmg_mult_armor 0.8 -- applied if the player has any armor
stoppower_dmg_mult_bullet 1.0 -- bullets
stoppower_dmg_mult_drown 0.0 -- drowning
stoppower_dmg_mult_energy 0.9 -- lasers, plasma, electricity, etc.
stoppower_dmg_mult_explosion 1.1 -- explosions
stoppower_dmg_mult_falling 0.25 -- falling
stoppower_dmg_mult_fire 0.9 -- fire
stoppower_dmg_mult_impact 1.1 -- props, vehicles, and blunt melee attacks
stoppower_dmg_mult_poison 0.1 -- poison (e.g. from poison headcrabs)
stoppower_dmg_mult_slash 1.0 -- slashes (includes almost all HL2 NPC melee attacks)
stoppower_dmg_mult_toxin 0.9 -- acid, radiation, etc

stoppower_minimum_speed_mult <SlowestAllowed>
stoppower_minimum_speed_mult 0.1
Sets the slowest multiplier allowed. A value of 0.0 means the player can be slowed to 0% speed.

stoppower_recovery_speed <RecovPerSec>
stoppower_recovery_speed 0.66
Sets the amount of speed recovered every second. A value of 1.0 means the player is brought up from 0% speed to 100% speed in 1 second.

stoppower_recovery_delay <DelaySecs>
stoppower_recovery_delay 0.5
Sets the number of seconds before recovery starts.

stoppower_autoreset_type <RespawnType>
stoppower_autoreset_type 1
0: Never auto-reset
1: Auto-reset on death
2: Auto-reset on spawn
Different values may work better for different gamemodes or preferences. Regardless of what you set, players' speeds should return to normal after dying.

stoppower_reset_all_players
Use this command to reset all players' slowdowns. This may be helpful if you run into bugs.

stoppower_tick_time <TickSecs>
stoppower_tick_time 0.05
Sets how frequently Stopping Power updates player speeds. 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]
Popular Discussions View All (1)
0
18 Dec, 2023 @ 3:43am
VIVO compatibility
رومان الحسام
27 Comments
It's alxl! c:  [author] 30 Apr, 2021 @ 12:53pm 
The Stopping Power tick time is unrelated to the server's tickrate. It's just a way to make the addon less resource-intensive, so rather than working every single server tick (which is unnecessary and laggy) it only works every 0.05 seconds (which is still really smooth but way better performance-wise).

I chose 0.05s because in my experience that's small enough that people will regard it as "smooth" but large enough that computers will have plenty of time to do work in it without lagging things up. But I also exposed it as a configuration in case people would want to change it, such as if they don't want a smooth player-speed recovery or if their server is doing a lot of things all the time and would like this to be less of a drain, even though Stopping Power doesn't have much of a performance hit.
>KB> >KEKSQUAD 30 Apr, 2021 @ 8:42am 
Is there a way I could determine the best tick time based on a server's tickrate? i.e. best ticktime for a server that uses 60
It's alxl! c:  [author] 22 Apr, 2021 @ 6:41pm 
@HalfEndyMion that's what Crippling Damage does
https://steamproxy.net/sharedfiles/filedetails/?id=2424087277
Halfendymion 22 Apr, 2021 @ 4:49pm 
is there an addon that, the less health you have; the slower you move?
Stoque 17 Mar, 2021 @ 4:36pm 
This is perfect, you even got the 5:1 armor health loss ratio down. Take my treasure.
It's alxl! c:  [author] 17 Mar, 2021 @ 12:33pm 
Just released an update that approximates that behavior; you can use stoppower_dmg_mult_armor <Mult> to change how much slowdown is received when the player has armor. The default is stoppower_dmg_mult_armor 0.8 , which means that wearing armor reduces slowdown received by 20%.

I couldn't see any simple way of differentiating between armor damage or HP damage, but hopefully this is close enough.
Stoque 16 Mar, 2021 @ 6:55pm 
Instead of calculating all of the total damage, is it possible to only calculate the health lost when using stoppower_dmg_mult? I don't think losing suit armor would affect my ability to move.
tonigutimar95[ESP] 16 Mar, 2021 @ 7:41am 
Perfect to campaing maps of the community.
ballsaSTEEL2001 16 Mar, 2021 @ 7:22am 
This is why you wear straps and suits of metal (in your playermodel) to realistically explain your hyperarmor. The ability to tank a hit without it physically affecting you too badly can mean the difference between getting hit and dying. And getting hit and getting away
Mannytko 16 Mar, 2021 @ 5:13am 
cs go