diff --git a/README.md b/README.md index a7858bb..363af04 100644 --- a/README.md +++ b/README.md @@ -34,23 +34,17 @@ It is, however, not compatbile with: 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. +- Look into improving the unfake animation? Really scared to try and touch it again but it would be worthwhile 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 +- Generally improve stumbling (foot stepping) Post release ideas: - Localization support for other languages - ReaSFX integration would probably be nice. I mean there's so many SFX packs to choose from, so I don't even have to pack it in -- To be entirely honest Fedhoria isn't the best addon out there for euphoria physics. Maybe rebase to another addon (or alternatively build a new one?) \ No newline at end of file +- To be entirely honest Fedhoria isn't the best addon out there for euphoria physics. Maybe rebase to another addon (or alternatively build a new one?) +- NPC targeting works, but works really weirdly (sometimes it just. keeps targeting corpses when it shouldn't.) It actually isn't THAT much of an issue because it doesn't feel totally outlandish but I would still love to fix it. \ No newline at end of file diff --git a/lua/zcnpci.lua b/lua/zcnpci.lua index a50347e..c0f2094 100644 --- a/lua/zcnpci.lua +++ b/lua/zcnpci.lua @@ -57,6 +57,16 @@ local corpses = {} local last_corpse_tick = CurTime() local last_tick = CurTime() +-- We need to override the default homigrad damage hook so it doesn't cause damage to ragdolls we are tryign to fake +-- Don't particularly like doing this but you gotta do what you gotta do +local homigrad_damage_hook = hook.GetTable().EntityTakeDamage["homigrad-damage"] + +hook.Add("EntityTakeDamage", "homigrad-damage", function(ent, dmginfo) + if ent:IsNPC() and ent.organism_no_damage then return false end + + homigrad_damage_hook(ent, dmginfo) +end) + hook.Add("CreateEntityRagdoll", "zcnpci", function(ent, ragdoll) if !ent.organism then return end @@ -303,15 +313,16 @@ hook.Add("Tick", "zcnpci", function() end end - -- NPC faking is in a seperate area because we want NPCs to ragdoll as soon as they can + -- NPC faking is in a seperate area because we want NPCs to fake as soon as they can for i,ent in pairs(npcs_to_fake) do + ent.organism_no_damage = true + local damage_info = DamageInfo() - damage_info:SetDamage(0) + damage_info:SetDamage(999999) damage_info:SetAttacker(ent) - damage_info:SetDamageType( DMG_DIRECT ) damage_info:SetDamageForce(Vector(0, 0, 0)) - ent:BecomeRagdoll(damage_info) + ent:TakeDamageInfo(damage_info) table.remove(npcs_to_fake, 1) end