Garry's Mod

Garry's Mod

half-life 2 settings [reupload]
The Cat 3 Aug, 2024 @ 11:43am
Read if you are using this addon.
I found an anomaly with headshot damage when HL2 difficulty is selected (extra hard diff as well)

Here is the code part affecting damage multiplier to npc limbs :

function hl2s_NpcDamaged(npc, hitgroup, dmginfo)
if GetConVarNumber("hl2s_difficulty")>0 then
if #player.GetAll()>1 then
local hl2s_diff = (#player.GetAll()/12)
if ( hitgroup == HITGROUP_HEAD ) then
dmginfo:SetDamage(math.Clamp(2-hl2s_diff, 1, 2)*(dmginfo:GetDamage()/10))
elseif hitgroup == HITGROUP_LEFTARM or hitgroup == HITGROUP_RIGHTARM or hitgroup == HITGROUP_LEFTLEG or hitgroup == HITGROUP_RIGHTLEG or hitgroup == HITGROUP_GEAR then
dmginfo:ScaleDamage(math.Clamp(0.6-hl2s_diff, 0.4, 0.6))
else
dmginfo:ScaleDamage(math.Clamp(0.8-hl2s_diff, 0.4, 0.8))
end
else
if ( hitgroup == HITGROUP_HEAD ) then
dmginfo:SetDamage(2*(dmginfo:GetDamage()/10))
elseif hitgroup == HITGROUP_LEFTARM or hitgroup == HITGROUP_RIGHTARM or hitgroup == HITGROUP_LEFTLEG or hitgroup == HITGROUP_RIGHTLEG or hitgroup == HITGROUP_GEAR then
dmginfo:ScaleDamage(0.6)
else
dmginfo:ScaleDamage(0.8)
end
end
end
end


The two lines about HITGROUP_HEAD have a divider of 10 (wich mean it take 5 pistol shots in the torso for 10 in the head to kill a npc).

In conclusion, i suggest to replace the 10 value, with a 4 or even a 3, for more logical headshot damage.
Last edited by The Cat; 3 Aug, 2024 @ 11:57am
< >
Showing 1-2 of 2 comments
thank you!
The Cat 29 Apr @ 5:11am 
Originally posted by Manhattan:
thank you!
:steamhappy:
< >
Showing 1-2 of 2 comments
Per page: 1530 50