Advertisement
Hydasi

Greenville Transmission Script.

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