• calculating recoil difficulties with tfa base
    3 replies, posted
im trying to make the tfa base jumping spread modifier different, currently u jump and it has the spread effect of a scout in csgo (based on velocity), i dont want this and instead want to make the spread based on whether ur not on the ground ive figured how to make the spread increase when not touching the ground with [CODE] if dynacc and not self.Owner:IsOnGround() then ccon = ccon * self.JumpingFalling end[/CODE] but the part im finding difficult is making it actually dynamic like the other modifiers i.e. walking running crouching, these modifiers have a transition from small to large spread but mine currently instantly goes to full bloom i have the code of the for anyone who can help me with this [CODE]function SWEP:CalculateConeRecoil() tmpiron = self:GetIronSights() local dynacc = false isr = self.IronSightsProgress or 0 if dynacc_cvar:GetBool() and (self.Primary.NumShots <= 1) then dynacc = true end local isr_1 = l_mathClamp(isr * 2, 0, 1) local isr_2 = l_mathClamp((isr - 0.5) * 2, 0, 1) local acv = self.Primary.Spread or self.Primary.Accuracy local recv = self.Primary.Recoil * 5 if dynacc then ccon = l_Lerp(isr_2, l_Lerp(isr_1, acv, acv * self.ChangeStateAccuracyMultiplier), self.Primary.IronAccuracy) crec = l_Lerp(isr_2, l_Lerp(isr_1, recv, recv * self.ChangeStateRecoilMultiplier), recv * self.IronRecoilMultiplier) else ccon = l_Lerp(isr, acv, self.Primary.IronAccuracy) crec = l_Lerp(isr, recv, recv * self.IronRecoilMultiplier) end local crc_1 = l_mathClamp(self.CrouchingRatio * 2, 0, 1) local crc_2 = l_mathClamp((self.CrouchingRatio - 0.5) * 2, 0, 1) if dynacc then ccon = l_Lerp(crc_2, l_Lerp(crc_1, ccon, ccon * self.ChangeStateAccuracyMultiplier), ccon * self.CrouchAccuracyMultiplier) crec = l_Lerp(crc_2, l_Lerp(crc_1, crec, self.Primary.Recoil * self.ChangeStateRecoilMultiplier), crec * self.CrouchRecoilMultiplier) end local ovel = self.Owner:GetVelocity():Length2D() local vfc_1 = l_mathClamp(ovel / self.Owner:GetWalkSpeed(), 0, 2) if dynacc then ccon = l_Lerp(vfc_1, ccon, ccon * self.WalkAccuracyMultiplier) crec = l_Lerp(vfc_1, crec, crec * self.WallRecoilMultiplier) end if dynacc and not self.Owner:IsOnGround() then ccon = ccon * self.JumpingFalling end local jr = self.JumpRatio if dynacc then ccon = l_Lerp(jr, ccon, ccon * self.JumpAccuracyMultiplier) crec = l_Lerp(jr, crec, crec * self.JumpRecoilMultiplier) end ccon = ccon * self.SpreadRatio if mult_cvar then ccon = ccon * mult_cvar:GetFloat() end return ccon, crec end[/CODE] the entire sh_calc.lua code if it helps [url]https://pastebin.com/2xhAjaLX[/url] thanks for efforts
bump
bump
bump
Sorry, you need to Log In to post a reply to this thread.