Compare commits

..

No commits in common. "e8112ffd8ac4ec27552e9a5dc2084b02ab4a7236" and "72c451540218b065e7b818d4e488688670c9ade5" have entirely different histories.

3 changed files with 45 additions and 52 deletions

View file

@ -32,19 +32,25 @@ It is, however, not compatbile with:
## Todo list
MUST BE DONE BEFORE RELEASE:
Urgent shit:
- NPCs should not unfake when moved around
- Actual specific reactions to being on fire / falling / lots of pain
- 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
- Generally improve stumbling (foot stepping)
- 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
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?)
- 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.
- 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?)

View file

@ -57,16 +57,6 @@ 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
@ -313,16 +303,15 @@ hook.Add("Tick", "zcnpci", function()
end
end
-- NPC faking is in a seperate area because we want NPCs to fake as soon as they can
-- NPC faking is in a seperate area because we want NPCs to ragdoll 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(999999)
damage_info:SetDamage(0)
damage_info:SetAttacker(ent)
damage_info:SetDamageType( DMG_DIRECT )
damage_info:SetDamageForce(Vector(0, 0, 0))
ent:TakeDamageInfo(damage_info)
ent:BecomeRagdoll(damage_info)
table.remove(npcs_to_fake, 1)
end

View file

@ -42,20 +42,20 @@ local twitchable_bone_names = {
local fakeup_bone_names = {
"ValveBiped.Bip01_Pelvis",
"ValveBiped.Bip01_Spine2",
--[[]"ValveBiped.Bip01_Spine2",]]
"ValveBiped.Bip01_Head1",
"ValveBiped.Bip01_R_Thigh",
--[[]"ValveBiped.Bip01_R_Thigh",
"ValveBiped.Bip01_L_Thigh",
"ValveBiped.Bip01_L_Calf",
"ValveBiped.Bip01_R_Calf",
"ValveBiped.Bip01_R_Foot",
"ValveBiped.Bip01_L_Foot",
"ValveBiped.Bip01_R_Upperarm",
"ValveBiped.Bip01_L_Upperarm",
--[["ValveBiped.Bip01_R_Upperarm",
--[["ValveBiped.Bip01_L_Upperarm",
"ValveBiped.Bip01_R_Forearm",
"ValveBiped.Bip01_L_Forearm",
"ValveBiped.Bip01_R_Hand",
"ValveBiped.Bip01_L_Hand",
"ValveBiped.Bip01_L_Hand",]]
}
local fakeup_bone_down_names = {
@ -237,15 +237,7 @@ function MODULE:Think()
local parent = self.FakeParent
if !IsValid(parent) then return end
if !self.ModelBoneList then return end
--[[for i,v in pairs(self.ModelBoneList) do
local object = target:GetPhysicsObjectNum(target:TranslateBoneToPhysBone(target:LookupBone(v)))
if !IsValid(object) then continue end
object:EnableCollisions(false)
end]]
--parent:FrameAdvance(FrameTime())
end
if !IsValid(phys) or !phys:IsAsleep() then return end
@ -312,23 +304,28 @@ function MODULE:PhysicsSimulate(phys, dt)
local i = 0
while i < target:GetBoneCount() do
local name = target:GetBoneName(i)
local object = target:LookupBone(name)
if object == -1 then i = i + 1; continue end
self.ModelBoneList[name] = target:GetBoneMatrix(object)
table.insert(self.ModelBoneList, target:GetBoneName(i))
i = i + 1
end
end
local animation_progress = (CurTime() - self.FakeUpStart) / (self.FakeUpEnd - self.FakeUpStart)
for i, name in pairs(fakeup_bone_names) do
print(name)
local object = target:GetPhysicsObjectNum(target:TranslateBoneToPhysBone(target:LookupBone(name)))
local parent_bone = parent:LookupBone(name)
--[[util.TraceLine({
start = parent:GetPos() + Vector(0, 128, 0),
endpos = parent:GetPos(),
collisiongroup = COLLISION_GROUP_NPC
})]]
for i,v in pairs(fakeup_bone_down_names) do
local object = target:GetPhysicsObjectNum(target:TranslateBoneToPhysBone(target:LookupBone(v)))
object:SetMass(0.5)
end
for i,v in pairs(fakeup_bone_names) do
local object = target:GetPhysicsObjectNum(target:TranslateBoneToPhysBone(target:LookupBone(v)))
local parent_bone = parent:LookupBone(v)
if parent_bone == -1 then continue end
@ -336,13 +333,12 @@ function MODULE:PhysicsSimulate(phys, dt)
if !parent_bone_matrix then continue end
local parent_bone_pos, parent_bone_angle = parent_bone_matrix:GetTranslation(), parent_bone_matrix:GetAngles()
local old_bone_pos, old_bone_angle = object:GetPos(), object:GetAngles()
--parent_bone_angle.y = parent_bone_angle.y + 90
parent_bone_angle.y = parent_bone_angle.y + 90
local shadow_data = {
secondstoarrive = 0.01,
pos = LerpVector(animation_progress, old_bone_pos, parent_bone_pos),
angle = LerpAngle(animation_progress, old_bone_angle, parent_bone_angle),
pos = LerpVector(animation_progress, object:GetPos(), parent_bone_pos),
angle = LerpAngle(animation_progress, object:GetAngles(), parent_bone_angle),
maxspeed = 400,
maxangular = 2000,
maxspeeddamp = 60,
@ -352,10 +348,12 @@ function MODULE:PhysicsSimulate(phys, dt)
-- Can't set position inside physics tick, crashes the game instantly.
-- Instead, send a shadow for it to follow (I think? I don't know GMod is kinda funky)
object:ComputeShadowControl(shadow_data)
object:Wake()
object:EnableGravity(false)
object:Wake()
--i = i + 1
i = i + 1
end
return false