Garry's Mod
Stopping Power - Damage slows you down
31 件のコメント
lxstxne 10月8日 14時06分 
Thanks a lot
Pan_Dombek 9月19日 8時55分 
can you make simmilar addon for npcs?
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日 18時41分 
Halfendymion 2021年4月22日 16時49分 
is there an addon that, the less health you have; the slower you move?
Stoque 2021年3月17日 16時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日 18時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日 18時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日 17時01分 
You could test it to see if it makes a difference or not
GHOST_ECHO 2021年3月15日 15時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日 14時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日 0時26分 
:2018bestaward::praisesun::wololo:
It's alxl! c:  [作成者] 2021年3月14日 20時09分 
Okay... this time, for real, it should work. Sorry about all this and thanks for bearing with me lol
Dornek 2021年3月14日 15時12分 
I mean with this the crouching movement speed is same as if you were standing
Dornek 2021年3月14日 15時09分 
bruh why is the walk speed of crouching so fast now otherwise everything else is fine
It's alxl! c:  [作成者] 2021年3月14日 14時34分 
Oh I must have undone something I didn't mean to. Should work now.
Dornek 2021年3月14日 14時05分 
actually it doesn't slow anymore for some resaon with the error
Dornek 2021年3月14日 13時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日 13時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日 20時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.