Garry's Mod

Garry's Mod

Stopping Power - Damage slows you down
29 Comments
aombi 17 Jul @ 10:45am 
finally, my friends stopped running and gunning and instead started moving like normal people
Pyroo77 14 Jul @ 12:06pm 
This makes the game absolutely painful and unplayable, 10/10
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://gtm.steamproxy.vip/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
It's alxl! c:  [author] 15 Mar, 2021 @ 6:11pm 
I did some benchmarking and it looks like it'd save about 1 microsecond each call (regardless of the number of players), which is pretty minuscule considering by default this addon makes at most 20 calls in a second (so e.g. we'd bring a tick time of 0.050002 seconds down to 0.050001 seconds). This makes me think GMod is probably caching under-the-hood, and in my opinion it'd be wasteful if every addon cached players to save 1 microsecond, so I won't
>KB> >KEKSQUAD 15 Mar, 2021 @ 5:01pm 
You could test it to see if it makes a difference or not
GHOST_ECHO 15 Mar, 2021 @ 3:03pm 
Awesome addon,makes combat less spam jump and sprint based.amy chance you do a bhop cancelling one too? rabbit players reaching objectives in 2.3 seconds suck...
It's alxl! c:  [author] 15 Mar, 2021 @ 2:44pm 
Does caching player.GetAll() work? Wouldn't I need to re-run it whenever a player joins or leaves? And doesn't GMod probably already do that under-the-hood?
>KB> >KEKSQUAD 15 Mar, 2021 @ 9:42am 
Hey so the pull request feature on GitHub is faded out for me, so here's something that can make the last 21 lines of code more optimized, as it was doing 10 calls/second.

local lastRecovTick = 0.0
local plys = player.GetAll()
hook.Add("Tick", "StoppingPowerRecovery", function()
if enabled then
local delta = CurTime() - lastRecovTick

if delta >= tickTime then
lastRecovTick = CurTime()
local recov = delta * recovAmt

for _, ply in ipairs(plys) do
if ply:Alive() then
local pRecovTick = ply:GetStopPowerRecoveryTime()
if pRecovTick and lastRecovTick >= pRecovTick then
ply:ChangeStopPowerSlowdownMult(recov, multMin)
end
end
end
end
end
end)
Dornek 15 Mar, 2021 @ 12:26am 
:2018bestaward::praisesun::wololo:
It's alxl! c:  [author] 14 Mar, 2021 @ 8:09pm 
Okay... this time, for real, it should work. Sorry about all this and thanks for bearing with me lol
Dornek 14 Mar, 2021 @ 3:12pm 
I mean with this the crouching movement speed is same as if you were standing
Dornek 14 Mar, 2021 @ 3:09pm 
bruh why is the walk speed of crouching so fast now otherwise everything else is fine
It's alxl! c:  [author] 14 Mar, 2021 @ 2:34pm 
Oh I must have undone something I didn't mean to. Should work now.
Dornek 14 Mar, 2021 @ 2:05pm 
actually it doesn't slow anymore for some resaon with the error
Dornek 14 Mar, 2021 @ 1:48pm 
yes it works, but it spams the console with this lua error now

[Stopping Power - Damage slows you down] lua/autorun/sh_stoppower.lua:13: attempt to index global 'Math' (a nil value)
1. fn - lua/autorun/sh_stoppower.lua:13
2. unknown - lua/ulib/shared/hook.lua:109


[Stopping Power - Damage slows you down] lua/autorun/sh_stoppower.lua:13: attempt to index global 'Math' (a nil value)
1. fn - lua/autorun/sh_stoppower.lua:13
2. unknown - lua/ulib/shared/hook.lua:109 (x2)
It's alxl! c:  [author] 14 Mar, 2021 @ 1:16pm 
Thanks for bringing this to my attention, it should now work with the prone mod
Dornek 14 Mar, 2021 @ 5:06am 
and was compabitable with it :praisesun:
Dornek 14 Mar, 2021 @ 5:01am 
I wish this wasn't conflicting with prone mod
It's alxl! c:  [author] 13 Mar, 2021 @ 12:08pm 
I released an update that should fix most (if not all) of the inconsistencies. Lemme know if you still run into bugs!
CyberMassacre 11 Mar, 2021 @ 8:18pm 
For some reason, upon death it occasionally causes my friends and i to go super-speed, but is reset once you die again or are ragdolled.