Garry's Mod

Garry's Mod

Stopping Power - Damage slows you down
29 則留言
aombi 7 月 17 日 上午 10:45 
finally, my friends stopped running and gunning and instead started moving like normal people
Pyroo77 7 月 14 日 下午 12:06 
This makes the game absolutely painful and unplayable, 10/10
It's alxl! c:  [作者] 2021 年 4 月 30 日 下午 12:53 
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 2021 年 4 月 30 日 上午 8:42 
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:  [作者] 2021 年 4 月 22 日 下午 6:41 
@HalfEndyMion that's what Crippling Damage does
https://gtm.steamproxy.vip/sharedfiles/filedetails/?id=2424087277
Halfendymion 2021 年 4 月 22 日 下午 4:49 
is there an addon that, the less health you have; the slower you move?
Stoque 2021 年 3 月 17 日 下午 4:36 
This is perfect, you even got the 5:1 armor health loss ratio down. Take my treasure.
It's alxl! c:  [作者] 2021 年 3 月 17 日 下午 12:33 
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 2021 年 3 月 16 日 下午 6:55 
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] 2021 年 3 月 16 日 上午 7:41 
Perfect to campaing maps of the community.
ballsaSTEEL2001 2021 年 3 月 16 日 上午 7:22 
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 2021 年 3 月 16 日 上午 5:13 
cs go
It's alxl! c:  [作者] 2021 年 3 月 15 日 下午 6:11 
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 2021 年 3 月 15 日 下午 5:01 
You could test it to see if it makes a difference or not
GHOST_ECHO 2021 年 3 月 15 日 下午 3:03 
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:  [作者] 2021 年 3 月 15 日 下午 2:44 
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 2021 年 3 月 15 日 上午 9:42 
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 2021 年 3 月 15 日 上午 12:26 
:2018bestaward::praisesun::wololo:
It's alxl! c:  [作者] 2021 年 3 月 14 日 下午 8:09 
Okay... this time, for real, it should work. Sorry about all this and thanks for bearing with me lol
Dornek 2021 年 3 月 14 日 下午 3:12 
I mean with this the crouching movement speed is same as if you were standing
Dornek 2021 年 3 月 14 日 下午 3:09 
bruh why is the walk speed of crouching so fast now otherwise everything else is fine
It's alxl! c:  [作者] 2021 年 3 月 14 日 下午 2:34 
Oh I must have undone something I didn't mean to. Should work now.
Dornek 2021 年 3 月 14 日 下午 2:05 
actually it doesn't slow anymore for some resaon with the error
Dornek 2021 年 3 月 14 日 下午 1:48 
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:  [作者] 2021 年 3 月 14 日 下午 1:16 
Thanks for bringing this to my attention, it should now work with the prone mod
Dornek 2021 年 3 月 14 日 上午 5:06 
and was compabitable with it :praisesun:
Dornek 2021 年 3 月 14 日 上午 5:01 
I wish this wasn't conflicting with prone mod
It's alxl! c:  [作者] 2021 年 3 月 13 日 下午 12:08 
I released an update that should fix most (if not all) of the inconsistencies. Lemme know if you still run into bugs!
CyberMassacre 2021 年 3 月 11 日 下午 8:18 
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.