Added SX 240 config; Added new engine outputs
This commit is contained in:
parent
d2e85d9c61
commit
ac8458de72
32
koptilnya/engine_remastered/configs/sx240.txt
Normal file
32
koptilnya/engine_remastered/configs/sx240.txt
Normal file
@ -0,0 +1,32 @@
|
||||
-- @name SX 240
|
||||
-- @author Koptilnya1337
|
||||
-- @server
|
||||
-- @include /koptilnya/engine_remastered/vehicle.txt
|
||||
require('/koptilnya/engine_remastered/vehicle.txt')
|
||||
|
||||
Vehicle:new({
|
||||
Engine = {
|
||||
IdleRPM = 900,
|
||||
MaxRPM = 7500,
|
||||
FlywheelMass = 4.4,
|
||||
FlywheelRadius = 0.418,
|
||||
StartFriction = -30,
|
||||
FrictionCoeff = 0.01,
|
||||
LimiterDuration = 0.05,
|
||||
TorqueMap = {
|
||||
118.89918444138, 122.0751393736, 125.25109430583, 128.42704923806, 131.60300417029, 134.77895910251, 137.95491403474, 141.13086896697, 144.3068238992, 147.48277883143, 150.65873376365, 153.83468869588, 157.01064362811, 160.18659856034, 163.36255349256,
|
||||
166.53850842479, 169.71446335702, 172.89041828925, 176.06637322148, 179.2423281537, 182.41828308593, 185.59423801816, 188.77019295039, 191.94614788261, 195.12210281484, 198.29805774707, 201.4740126793, 204.64996761153, 207.82592254375, 211.00187747598,
|
||||
214.17783240821, 217.35378734044, 220.52974227266, 223.70569720489, 226.88165213712, 227.9621903219, 229.04272850669, 230.12326669147, 231.20380487625, 232.28434306104, 233.36488124582, 234.4454194306, 235.52595761538, 236.60649580017, 237.68703398495,
|
||||
238.76757216973, 239.84811035452, 240.9286485393, 242.00918672408, 243.08972490886, 244.17026309365, 245.25080127843, 246.33133946321, 247.411877648, 248.49241583278, 249.57295401756, 250.65349220234, 251.73403038713, 252.81456857191, 253.89510675669, 254.97564494148,
|
||||
256.05618312626, 257.13672131104, 258.21725949582, 259.29779768061, 260.37833586539, 261.29278066787, 262.20722547034, 263.12167027282, 264.0361150753, 264.95055987777, 265.86500468025, 266.77944948273, 267.6938942852, 268.60833908768, 269.52278389016,
|
||||
270.43722869263, 271.35167349511, 272.26611829758, 273.18056310006, 274.09500790254, 275.00945270501, 275.92389750749, 276.83834230997, 275.50329427594, 274.16824624192, 272.8331982079, 271.49815017388, 270.16310213985, 268.82805410583, 267.49300607181,
|
||||
266.15795803778, 264.82291000376, 263.48786196974, 262.15281393572, 260.81776590169, 259.48271786767, 250.23203287321, 240.98134787874, 231.73066288428, 222.47997788981
|
||||
}
|
||||
},
|
||||
Clutch = {Stiffness = 20, Damping = 0.5, MaxTorque = 400},
|
||||
Gearbox = {Type = 'MANUAL', ShiftDuration = 0.2, ShiftSmoothness = 0.3, Ratios = {3.67, 2.1, 1.35, 1.1, 0.901}, Reverse = 3.818},
|
||||
Axles = {
|
||||
{Power = 0.96, Coast = 0.96, Preload = 10, UsePowerBias = 10, ViscousCoeff = 0.96, Axle = Vector(1, 0, 0), DistributionCoeff = 0.6, FinalDrive = 3.9}
|
||||
},
|
||||
Systems = {{Type = 'LAUNCH', Limit = 3500}, {Type = 'TRACTION', Limit = 1.5}}
|
||||
})
|
||||
@ -19,6 +19,7 @@ function Engine:initialize(config, clutch)
|
||||
self.rpmFrac = 0
|
||||
self.rpm = self.idleRPM
|
||||
self.friction = 0
|
||||
self.masterThrottle = 0
|
||||
|
||||
self.limiterDuration = config.LimiterDuration
|
||||
|
||||
@ -39,14 +40,16 @@ end
|
||||
|
||||
function Engine:getOutputs()
|
||||
return {
|
||||
RPM = 'number',
|
||||
Engine_Torque = 'number'
|
||||
Engine_RPM = 'number',
|
||||
Engine_Torque = 'number',
|
||||
Engine_MasterThrottle = 'number'
|
||||
}
|
||||
end
|
||||
|
||||
function Engine:updateOutputs()
|
||||
wire.ports.RPM = self.rpm
|
||||
wire.ports.Engine_RPM = self.rpm
|
||||
wire.ports.Engine_Torque = self.torque
|
||||
wire.ports.Engine_MasterThrottle = self.masterThrottle
|
||||
end
|
||||
|
||||
function Engine:getThrottle()
|
||||
@ -74,9 +77,9 @@ function Engine:update()
|
||||
throttle = timer.systime() >= self._limiterTime + self.limiterDuration and throttle or 0
|
||||
end
|
||||
|
||||
local masterThrottle = math.clamp(additionalEnergySupply + throttle, 0, 1)
|
||||
self.masterThrottle = math.clamp(additionalEnergySupply + throttle, 0, 1)
|
||||
|
||||
local realInitialTorque = maxInitialTorque * masterThrottle
|
||||
local realInitialTorque = maxInitialTorque * self.masterThrottle
|
||||
|
||||
local loadTorque = self.clutch and self.clutch.torque or 0
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user