Advertisement
Guest User

Cdid Script cosmiczura#0001

a guest
May 17th, 2022
730
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 9.77 KB | None | 0 0
  1. --[[
  2. ___      _______                _    
  3.   / _ |____/ ___/ /  ___ ____ ___ (_)__
  4.  / __ /___/ /__/ _ \/ _ `(_-<(_-</ (_-<
  5. /_/ |_|   \___/_//_/\_,_/___/___/_/___/
  6. SecondLogic @ Inspare
  7. gajking#5065
  8. ]]
  9.  
  10. local Tune = {}
  11.  
  12. --[[Misc]]
  13. Tune.LoadDelay = .1 -- Delay before initializing chassis (in seconds)
  14. Tune.AutoStart = false -- Set to false if using manual ignition plugin
  15. Tune.AutoFlip = true -- Set to false if using manual flip plugin
  16.  
  17. --[[Wheel Alignment]]
  18. --[Don't physically apply alignment to wheels]
  19. --[Values are in degrees]
  20. Tune.FCamber = -2
  21. Tune.RCamber = -2
  22. Tune.FToe = 0
  23. Tune.RToe = 0
  24.  
  25. --[[Weight and CG]]
  26. Tune.Weight = 3472 -- Total weight (in pounds)
  27. Tune.WeightBSize = { -- Size of weight brick (dimmensions in studs ; larger = more stable)
  28. --[[Width]] 6 ,
  29. --[[Height]] 3 ,
  30. --[[Length]] 14 }
  31. Tune.WeightDist = 50 -- Weight distribution (0 - on rear wheels, 100 - on front wheels, can be <0 or >100)
  32. Tune.CGHeight = 1 -- Center of gravity height (studs relative to median of all wheels)
  33. Tune.WBVisible = false -- Makes the weight brick visible
  34.  
  35. --Unsprung Weight
  36. Tune.FWheelDensity = .45 -- Front Wheel Density
  37. Tune.RWheelDensity = .45 -- Rear Wheel Density
  38. Tune.FWLgcyDensity = 1 -- Front Wheel Density [PGS OFF]
  39. Tune.RWLgcyDensity = 1 -- Rear Wheel Density [PGS OFF]
  40.  
  41. Tune.AxleSize = 2 -- Size of structural members (larger = more stable/carry more weight)
  42. Tune.AxleDensity = .1 -- Density of structural members
  43.  
  44. --[[Susupension]]
  45. Tune.SusEnabled = true -- works only in with PGSPhysicsSolverEnabled, defaults to false when PGS is disabled
  46.  
  47. --Front Suspension
  48. Tune.FSusDamping = 1500 -- Spring Dampening
  49. Tune.FSusStiffness = 9000 -- Spring Force
  50. Tune.FAntiRoll = 50000 -- Anti-Roll (Gyro Dampening)
  51.  
  52. Tune.FSusLength = 2.00 -- Suspension length (in studs)
  53. Tune.FPreCompress = .2 -- Pre-compression adds resting length force
  54. Tune.FExtensionLim = .3 -- Max Extension Travel (in studs)
  55. Tune.FCompressLim = 0 -- Max Compression Travel (in studs)
  56. Tune.FSusAngle = 80 -- Suspension Angle (degrees from horizontal)
  57.  
  58. Tune.FWsBoneLen = 5 -- Wishbone Length
  59. Tune.FWsBoneAngle = 0 -- Wishbone angle (degrees from horizontal)
  60. Tune.FAnchorOffset = { -- Suspension anchor point offset (relative to center of wheel)
  61. --[[Lateral]] -.4 , -- positive = outward
  62. --[[Vertical]] -.5 , -- positive = upward
  63. --[[Forward]] 0 } -- positive = forward
  64.  
  65. --Rear Suspension
  66. Tune.RSusDamping = 1500 -- Spring Dampening
  67. Tune.RSusStiffness = 9000 -- Spring Force
  68. Tune.FAntiRoll = 50000 -- Anti-Roll (Gyro Dampening)
  69.  
  70. Tune.RSusLength = 2.00 -- Suspension length (in studs)
  71. Tune.RPreCompress = -0.3 -- Pre-compression adds resting length force
  72. Tune.RExtensionLim = .3 -- Max Extension Travel (in studs)
  73. Tune.RCompressLim = 0 -- Max Compression Travel (in studs)
  74. Tune.RSusAngle = 80 -- Suspension Angle (degrees from horizontal)
  75.  
  76. Tune.RWsBoneLen = 5 -- Wishbone Length
  77. Tune.RWsBoneAngle = 0 -- Wishbone angle (degrees from horizontal)
  78. Tune.RAnchorOffset = { -- Suspension anchor point offset (relative to center of wheel)
  79. --[[Lateral]] -.4 , -- positive = outward
  80. --[[Vertical]] -.5 , -- positive = upward
  81. --[[Forward]] 0 } -- positive = forward
  82.  
  83. --Aesthetics
  84. Tune.SusVisible = true -- Spring Visible
  85. Tune.WsBVisible = true -- Wishbone Visible
  86. Tune.SusRadius = .2 -- Suspension Coil Radius
  87. Tune.SusThickness = .1 -- Suspension Coil Thickness
  88. Tune.SusColor = "Bright red" -- Suspension Color [BrickColor]
  89. Tune.SusCoilCount = 6 -- Suspension Coil Count
  90. Tune.WsColor = "Black" -- Wishbone Color [BrickColor]
  91. Tune.WsThickness = .1 -- Wishbone Rod Thickness
  92.  
  93. --[[Wheel Stabilizer Gyro]]
  94. Tune.FGyroDamp = 400 -- Front Wheel Non-Axial Dampening
  95. Tune.RGyroDamp = 400 -- Rear Wheel Non-Axial Dampening
  96.  
  97. --[[Steering]]
  98. Tune.SteerInner = 36 -- Inner wheel steering angle (in degrees)
  99. Tune.SteerOuter = 37 -- Outer wheel steering angle (in degrees)
  100. Tune.SteerSpeed = .05 -- Steering increment per tick (in degrees)
  101. Tune.ReturnSpeed = .1 -- Steering increment per tick (in degrees)
  102. Tune.SteerDecay = 320 -- Speed of gradient cutoff (in SPS)
  103. Tune.MinSteer = 10 -- Minimum steering at max steer decay (in percent)
  104. Tune.MSteerExp = 1 -- Mouse steering exponential degree
  105.  
  106. --Steer Gyro Tuning
  107. Tune.SteerD = 1000 -- Steering Dampening
  108. Tune.SteerMaxTorque = 10000 -- Steering Force
  109. Tune.SteerP = 30000 -- Steering Aggressiveness
  110.  
  111. --[[Engine]]
  112. --Torque Curve
  113. Tune.Horsepower = 10000 -- [TORQUE CURVE VISUAL]
  114. Tune.IdleRPM = 800 -- https://www.desmos.com/calculator/2uo3hqwdhf
  115. Tune.PeakRPM = 8000 -- Use sliders to manipulate values
  116. Tune.Redline = 8500 -- Copy and paste slider values into the respective tune values
  117. Tune.EqPoint = 6800
  118. Tune.PeakSharpness = 3.8
  119. Tune.CurveMult = 0.07
  120.  
  121. --Incline Compensation
  122. Tune.InclineComp = .5 -- Torque compensation multiplier for inclines (applies gradient from 0-90 degrees)
  123.  
  124. --Misc
  125. Tune.RevAccel = 400 -- RPM acceleration when clutch is off
  126. Tune.RevDecay = 75 -- RPM decay when clutch is off
  127. Tune.RevBounce = 470 -- RPM kickback from redline
  128. Tune.IdleThrottle = 0 -- Percent throttle at idle
  129. Tune.ClutchTol = 150 -- Clutch engagement threshold (higher = faster response)
  130.  
  131. --[[Drivetrain]]
  132. Tune.Config = "AWD" --"FWD" , "RWD" , "AWD"
  133.  
  134. --Differential Settings
  135. Tune.FDiffSlipThres = 50 -- 1 - 100% (Max threshold of applying full lock determined by deviation from avg speed)
  136. Tune.FDiffLockThres = 50 -- 0 - 100% (0 - Bias toward slower wheel, 100 - Bias toward faster wheel)
  137. Tune.RDiffSlipThres = 50 -- 1 - 100%
  138. Tune.RDiffLockThres = 50 -- 0 - 100%
  139. Tune.CDiffSlipThres = 50 -- 1 - 100% [AWD Only]
  140. Tune.CDiffLockThres = 50 -- 0 - 100% [AWD Only]
  141.  
  142. --Traction Control Settings
  143. Tune.TCSEnabled = true -- Implements TCS
  144. Tune.TCSThreshold = 20 -- Slip speed allowed before TCS starts working (in SPS)
  145. Tune.TCSGradient = 20 -- Slip speed gradient between 0 to max reduction (in SPS)
  146. Tune.TCSLimit = 10 -- Minimum amount of torque at max reduction (in percent)
  147.  
  148. --[[Transmission]]
  149. Tune.TransModes = {"Auto"} --[[
  150. [Modes]
  151. "Auto" : Automatic shifting
  152. "Semi" : Clutchless manual shifting, dual clutch transmission
  153. "Manual" : Manual shifting with clutch
  154.  
  155. >Include within brackets
  156. eg: {"Semi"} or {"Auto", "Manual"}
  157. >First mode is default mode ]]
  158.  
  159. --Automatic Settings
  160. Tune.AutoShiftMode = "Speed" --[[
  161. [Modes]
  162. "Speed" : Shifts based on wheel speed
  163. "RPM" : Shifts based on RPM ]]
  164. Tune.AutoUpThresh = -200 --Automatic upshift point (relative to peak RPM, positive = Over-rev)
  165. Tune.AutoDownThresh = 1400 --Automatic downshift point (relative to peak RPM, positive = Under-rev)
  166.  
  167. --Gear Ratios
  168. Tune.FinalDrive = 3.31 -- Gearing determines top speed and wheel torque
  169. Tune.Ratios = { -- Higher ratio = more torque, Lower ratio = higher top speed
  170. --[[Reverse]] 2.8 , -- Copy and paste a ratio to add a gear
  171. --[[Neutral]] 0 , -- Ratios can also be deleted
  172. --[[ 1 ]] 3.98 , -- Reverse, Neutral, and 1st gear are required
  173. --[[ 2 ]] 2.61 ,
  174. --[[ 3 ]] 1.9 ,
  175. --[[ 4 ]] 1.48 ,
  176. --[[ 5 ]] 1.16 ,
  177. --[[ 6 ]] 0.99 ,
  178. --[[ 7 ]] 0.84 ,
  179. }
  180. Tune.FDMult = 1 -- -- Ratio multiplier (Change this value instead of FinalDrive if car is struggling with torque ; Default = 1)
  181.  
  182. --[[Brakes]]
  183. Tune.ABSEnabled = true -- Implements ABS
  184. Tune.ABSThreshold = 20 -- Slip speed allowed before ABS starts working (in SPS)
  185.  
  186. Tune.FBrakeForce = 30000 -- Front brake force
  187. Tune.RBrakeForce = 24000 -- Rear brake force
  188. Tune.PBrakeForce = 100000 -- Handbrake force
  189.  
  190. Tune.FLgcyBForce = 15000 -- Front brake force [PGS OFF]
  191. Tune.RLgcyBForce = 10000 -- Rear brake force [PGS OFF]
  192. Tune.LgcyPBForce = 25000 -- Handbrake force [PGS OFF]
  193.  
  194. --[[[Default Controls]]
  195. --Peripheral Deadzones
  196. Tune.Peripherals = {
  197. MSteerWidth = 67 , -- Mouse steering control width (0 - 100% of screen width)
  198. MSteerDZone = 10 , -- Mouse steering deadzone (0 - 100%)
  199.  
  200. ControlLDZone = 5 , -- Controller steering L-deadzone (0 - 100%)
  201. ControlRDZone = 5 , -- Controller steering R-deadzone (0 - 100%)
  202. }
  203.  
  204. --Control Mapping
  205. Tune.Controls = {
  206.  
  207. --Keyboard Controls
  208. --Mode Toggles
  209. ToggleTCS = Enum.KeyCode.T ,
  210. ToggleABS = Enum.KeyCode.Y ,
  211. ToggleTransMode = Enum.KeyCode.M ,
  212. ToggleMouseDrive = Enum.KeyCode.R ,
  213.  
  214. --Primary Controls
  215. Throttle = Enum.KeyCode.Up ,
  216. Brake = Enum.KeyCode.Down ,
  217. SteerLeft = Enum.KeyCode.Left ,
  218. SteerRight = Enum.KeyCode.Right ,
  219.  
  220. --Secondary Controls
  221. Throttle2 = Enum.KeyCode.W ,
  222. Brake2 = Enum.KeyCode.S ,
  223. SteerLeft2 = Enum.KeyCode.A ,
  224. SteerRight2 = Enum.KeyCode.D ,
  225.  
  226. --Manual Transmission
  227. ShiftUp = Enum.KeyCode.E ,
  228. ShiftDown = Enum.KeyCode.Q ,
  229. Clutch = Enum.KeyCode.LeftShift ,
  230.  
  231. --Handbrake
  232. PBrake = Enum.KeyCode.P ,
  233.  
  234. --Mouse Controls
  235. MouseThrottle = Enum.UserInputType.MouseButton1 ,
  236. MouseBrake = Enum.UserInputType.MouseButton2 ,
  237. MouseClutch = Enum.KeyCode.W ,
  238. MouseShiftUp = Enum.KeyCode.E ,
  239. MouseShiftDown = Enum.KeyCode.Q ,
  240. MousePBrake = Enum.KeyCode.LeftShift ,
  241.  
  242. --Controller Mapping
  243. ContlrThrottle = Enum.KeyCode.ButtonR2 ,
  244. ContlrBrake = Enum.KeyCode.ButtonL2 ,
  245. ContlrSteer = Enum.KeyCode.Thumbstick1 ,
  246. ContlrShiftUp = Enum.KeyCode.ButtonY ,
  247. ContlrShiftDown = Enum.KeyCode.ButtonX ,
  248. ContlrClutch = Enum.KeyCode.ButtonR1 ,
  249. ContlrPBrake = Enum.KeyCode.ButtonL1 ,
  250. ContlrToggleTMode = Enum.KeyCode.DPadUp ,
  251. ContlrToggleTCS = Enum.KeyCode.DPadDown ,
  252. ContlrToggleABS = Enum.KeyCode.DPadRight ,
  253. }
  254.  
  255. --[[Weight Scaling]]
  256. --[Cubic stud : pounds ratio]
  257. --[STANDARDIZED: Don't touch unless needed]
  258. Tune.WeightScaling = 1/50 --Default = 1/50 (1 cubic stud = 50 lbs)
  259. Tune.LegacyScaling = 1/10 --Default = 1/10 (1 cubic stud = 10 lbs) [PGS OFF]
  260.  
  261.  
  262. tune = Tune
  263. local newreq = require
  264. local oldreq = function(...)
  265.    print({...})
  266.    local returnval = newreq(...)
  267.    if tostring(...) == 'A-Chassis Tune' then
  268.        for i,v in pairs(returnval) do
  269.            if tune[i] then
  270.                returnval[i] = tune[i]
  271.                end
  272.        end
  273.    end
  274.  
  275.    return returnval
  276. end
  277. getgenv().require = oldreq
  278. getrenv().require = oldreq
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement