Various fixings

This commit is contained in:
toasterpanic 2026-05-31 21:12:19 -04:00
parent 5af8fdc14a
commit 72c4515402
3 changed files with 30 additions and 10 deletions

View file

@ -32,6 +32,20 @@ It is, however, not compatbile with:
## Todo list
Urgent shit:
- Large amounts of damage (such as shotguns) fling NPC ragdolls to ridiculous lengths, sometimes severely injuring the player. While this is absolutely fucking hilarious, it also isn't the best experience.
Stuff to do:
- Facial expressions
- Actual specific reactions to being on fire / falling / lots of pain
- Wound holding
- NPCs should not stumble when dead
- Generally improve stumbling
Stuff to fix possibly:
- NPC targeting works, but works really weirdly (sometimes it just. keeps targeting corpses when it shouldn't.) Why? Who knows!!!!
- Look into improving the unfake animation? Really scared to try and touch it again but it would be worthwhile

View file

@ -121,6 +121,11 @@ hook.Add("CreateEntityRagdoll", "zcnpci", function(ent, ragdoll)
ragdoll:GetPhysicsObject():SetVelocity(ent.npcfakeknockback)
end
local velocity = ragdoll:GetPhysicsObject():GetVelocity()
print(velocity)
print(max_clamp)
-- For some reason, citizen types such as rebels, medics, refugees, etc. use a keyvalue.
-- That keyvalue does not transfer over to the ragdoll, despite it looking like the NPC,
-- and you have to manually save it to the ragdoll to be able to make it work.
@ -160,6 +165,12 @@ hook.Add("HomigradDamage", "zcnpci", function(ent, dmginfo)
if dmginfo:IsDamageType(DMG_BULLET + DMG_BUCKSHOT + DMG_BLAST) then
if dmginfo:GetDamage() > 3 then
table.insert(npcs_to_fake, ent)
local attacker_angle = dmginfo:GetAttacker():EyeAngles()
local normal = attacker_angle:Forward(normal)
ent.npcfakeknockback = normal * dmginfo:GetDamage() * 0
end
elseif dmginfo:IsDamageType(DMG_CLUB + DMG_SLASH) then
local attacker = dmginfo:GetAttacker()

View file

@ -293,6 +293,11 @@ function MODULE:PhysicsSimulate(phys, dt)
local st = stumble_time:GetFloat()
-- End stumbling if player is dead
if !target.organism or !target.organism.alive then
st = 0
end
if (st <= 0) then
self:Remove()
return false
@ -300,16 +305,6 @@ function MODULE:PhysicsSimulate(phys, dt)
local f = 1 - (CurTime() - self.Created) / st
--RagMod Reworked support
if ragmod and ragmod:IsRagmodRagdoll(target) then
local owner = target:GetOwningPlayer()
if !IsValid(owner) or !owner:Alive() then
f = 0
else
f = 1
end
end
if (f <= 0) then
self:Remove()
return false