Garry's Mod

Garry's Mod

Ocen: 256
Stopping Power - Damage slows you down
2
   
Przyznaj nagrodę
Ulubione
Ulubione
Usuń z ulubionych
Content Type: Addon
Addon Type: Effects
Addon Tags: Roleplay, Realism
Rozmiar pliku
Zamieszczono
Zaktualizowano
8.344 KB
9 marca 2021 o 23:40
17 marca 2021 o 12:19
Listy zmian: 13 ( zobacz )

Zasubskrybuj, aby pobrać
Stopping Power - Damage slows you down

W 1 kolekcji stworzonej przez It's alxl! c:
ttt gubbins wot alxl likes
Przedmioty: 38
Opis
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]
Popularne dyskusje Zobacz wszystkie (1)
0
18 grudnia 2023 o 3:43
VIVO compatibility
رومان الأوسوري
Komentarzy: 29
aombi 17 lipca o 10:45 
finally, my friends stopped running and gunning and instead started moving like normal people
Pyroo77 14 lipca o 12:06 
This makes the game absolutely painful and unplayable, 10/10
It's alxl! c:  [autor] 30 kwietnia 2021 o 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 30 kwietnia 2021 o 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:  [autor] 22 kwietnia 2021 o 18:41 
@HalfEndyMion that's what Crippling Damage does
https://gtm.steamproxy.vip/sharedfiles/filedetails/?id=2424087277
Halfendymion 22 kwietnia 2021 o 16:49 
is there an addon that, the less health you have; the slower you move?
Stoque 17 marca 2021 o 16:36 
This is perfect, you even got the 5:1 armor health loss ratio down. Take my treasure.
It's alxl! c:  [autor] 17 marca 2021 o 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 16 marca 2021 o 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] 16 marca 2021 o 7:41 
Perfect to campaing maps of the community.