From 700bc981a9735864abb69bd4d6b72dacf8b2c55b Mon Sep 17 00:00:00 2001 From: WallopingEwe <53689141+WallopingEwe@users.noreply.github.com> Date: Sun, 28 Dec 2025 16:53:20 -0600 Subject: [PATCH] Remove the arbitrary 50x multiplier for the force input. It doesn't explain anywhere that it multiplies the force by 50. This hurts making precise forces unless you know to divide the force by 50. Even then it multiplies it after the check for the maximum force. On the regular thruster I removed some unnecessary WorldToLocalVectors to just apply the force globally instead of locally since we already have it global. I have tested it in game and it works for me. --- lua/entities/gmod_wire_thruster.lua | 10 +++++----- lua/entities/gmod_wire_vectorthruster.lua | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lua/entities/gmod_wire_thruster.lua b/lua/entities/gmod_wire_thruster.lua index 8bbf4fdafa..13f9ad389e 100644 --- a/lua/entities/gmod_wire_thruster.lua +++ b/lua/entities/gmod_wire_thruster.lua @@ -122,7 +122,7 @@ function ENT:SetForce( force, mul ) end if self.neteffect then - self.effectforce = self.ThrustOffset:Length() * self.force * self.mul * 50 + self.effectforce = self.ThrustOffset:Length() * self.force * self.mul self.updateeffect = true end @@ -134,13 +134,13 @@ function ENT:SetForce( force, mul ) end function ENT:CalcForce(phys) - local ThrusterWorldForce = phys:LocalToWorldVector( self.ThrustOffset ) * (self.force * self.mul * -50) + local ThrusterWorldForce = phys:LocalToWorldVector( self.ThrustOffset ) * (self.force * -self.mul) -- Calculate the velocity local ForceLinear, ForceAngular = phys:CalculateVelocityOffset(ThrusterWorldForce, phys:LocalToWorld( self.ThrustOffset )) - self.ForceLinear = phys:WorldToLocalVector(WireLib.clampForce(ForceLinear)) - self.ForceAngular = phys:WorldToLocalVector(WireLib.clampForce(ForceAngular)) + self.ForceLinear = WireLib.clampForce(ForceLinear) + self.ForceAngular = WireLib.clampForce(ForceAngular) end function ENT:SetDatEffect(uwater, owater, uweffect, oweffect) @@ -241,7 +241,7 @@ function ENT:PhysicsSimulate( phys, deltatime ) self:CalcForce(phys) - return self.ForceAngular, self.ForceLinear, SIM_LOCAL_ACCELERATION + return self.ForceAngular, self.ForceLinear, SIM_GLOBAL_ACCELERATION end function ENT:Switch( on, mul ) diff --git a/lua/entities/gmod_wire_vectorthruster.lua b/lua/entities/gmod_wire_vectorthruster.lua index ddb9c6da99..135c6bb73d 100644 --- a/lua/entities/gmod_wire_vectorthruster.lua +++ b/lua/entities/gmod_wire_vectorthruster.lua @@ -165,7 +165,7 @@ function ENT:CalcForce(phys) if ThrustLen>0 then local ThrustNormal = ThrusterWorldForce/ThrustLen self:SetNormal( -ThrustNormal ) - self.ForceLinear, self.ForceAngular = phys:CalculateVelocityOffset( ThrustNormal * ( math.min( self.force * self.mul, self.force_max ) * 50 ), phys:LocalToWorld( self.ThrustOffset ) ) + self.ForceLinear, self.ForceAngular = phys:CalculateVelocityOffset( ThrustNormal * ( math.min( self.force * self.mul, self.force_max ) ), phys:LocalToWorld( self.ThrustOffset ) ) self.ForceLinear = WireLib.clampForce(self.ForceLinear) self.ForceAngular = WireLib.clampForce(self.ForceAngular)