Skip to content
This repository was archived by the owner on Jan 19, 2019. It is now read-only.

Commit da5e6ab

Browse files
committed
v2.1 rc1
- imporved one button clutch - adjusted manual clutch timings
1 parent b4b6b64 commit da5e6ab

File tree

4 files changed

+51
-25
lines changed

4 files changed

+51
-25
lines changed

FS17_GearboxAddon.zip

419 Bytes
Binary file not shown.

FS17_GearboxAddon/gearboxMogli.lua

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -918,7 +918,7 @@ function gearboxMogli:initFromXml(xmlFile,xmlString,xmlSource,serverAndClient,mo
918918

919919
self.mrGbMS.ClutchTimeInc = Utils.getNoNil(getXMLFloat(xmlFile, xmlString .. "#clutchTimeIncreaseMs"), clutchEngagingTimeMs )
920920
self.mrGbMS.ClutchTimeDec = Utils.getNoNil(getXMLFloat(xmlFile, xmlString .. "#clutchTimeDecreaseMs"), clutchEngagingTimeMs )
921-
self.mrGbMS.ClutchShiftTime = Utils.getNoNil(getXMLFloat(xmlFile, xmlString .. "#clutchShiftingTimeMs"), 2 * self.mrGbMS.ClutchTimeDec)
921+
self.mrGbMS.ClutchShiftTime = Utils.getNoNil(getXMLFloat(xmlFile, xmlString .. "#clutchShiftingTimeMs"), 0.5 * self.mrGbMS.ClutchTimeDec)
922922
self.mrGbMS.ClutchTimeManual = math.max( Utils.getNoNil(getXMLFloat(xmlFile, xmlString .. "#clutchTimeManualMs"), self.mrGbMG.minClutchTimeManual ), self.mrGbMS.ClutchTimeInc )
923923
self.mrGbMS.ClutchCanOverheat = Utils.getNoNil(getXMLBool( xmlFile, xmlString .. "#clutchCanOverheat"), not self.mrGbMS.TorqueConverterOrHydro )
924924
self.mrGbMS.ClutchOverheatStartTime = Utils.getNoNil(getXMLFloat(xmlFile, xmlString .. "#clutchOverheatStartTimeMs"), 5000 )
@@ -2545,14 +2545,15 @@ function gearboxMogli:update(dt)
25452545
self:mrGbMSetManualClutch( 1 )
25462546
end
25472547
elseif g_currentMission.time > self.mrGbML.oneButtonClutchTimer then
2548-
local mi = ( g_currentMission.time - self.mrGbML.oneButtonClutchTimer ) / self.mrGbMS.ClutchTimeManual
2549-
local ma = math.min( 1, self.mrGbMS.ManualClutch + dt / self.mrGbMS.ClutchTimeInc )
2548+
local mi = math.max( ( g_currentMission.time - self.mrGbML.oneButtonClutchTimer ) / self.mrGbMS.ClutchTimeManual,
2549+
self.mrGbMS.ManualClutch - dt / self.mrGbMS.ClutchTimeDec )
2550+
local ma = math.min( 1,
2551+
self.mrGbMS.ManualClutch + dt / self.mrGbMS.ClutchTimeInc )
25502552
if self.motor.targetRpm == nil then
25512553
self:mrGbMSetManualClutch( mi )
25522554
else
2553-
self:mrGbMSetManualClutch( self.motor:getClutchPercent( self.motor.targetRpm, self.mrGbMS.OpenRpm, self.mrGbMS.CloseRpm, mi, ma ) )
2555+
self:mrGbMSetManualClutch( self.motor:getClutchPercent( self.motor.targetRpm, self.mrGbMS.OpenRpm, self.mrGbMS.CloseRpm, mi, self.mrGbMS.ManualClutch, ma ) )
25542556
end
2555-
--print(string.format("%d, %5.2f%% <= %5.2f%% <= %5.2f%%",g_currentMission.time - self.mrGbML.oneButtonClutchTimer, mi*100,self.mrGbMS.ManualClutch*100,ma*100))
25562557
end
25572558

25582559
if InputBinding.gearboxMogliMINRPM ~= nil then
@@ -8944,7 +8945,7 @@ function gearboxMogliMotor:mrGbMUpdateGear( accelerationPedal )
89448945
if clutchMode > 1
89458946
and self.vehicle.mrGbML.afterShiftClutch ~= nil then
89468947
if self.vehicle.mrGbML.afterShiftClutch < 0 then
8947-
self.autoClutchPercent = self:getClutchPercent( targetRpm, openRpm, closeRpm, fromClutchPercent, toClutchPercent )
8948+
self.autoClutchPercent = self:getClutchPercent( targetRpm, openRpm, closeRpm, fromClutchPercent, self.autoClutchPercent, toClutchPercent )
89488949
else
89498950
self.autoClutchPercent = self.vehicle.mrGbML.afterShiftClutch
89508951
end
@@ -8977,7 +8978,7 @@ function gearboxMogliMotor:mrGbMUpdateGear( accelerationPedal )
89778978
end
89788979
end
89798980

8980-
local c = self:getClutchPercent( targetRpm, openRpm, closeRpm, fromClutchPercent, toClutchPercent )
8981+
local c = self:getClutchPercent( targetRpm, openRpm, closeRpm, fromClutchPercent, self.autoClutchPercent, toClutchPercent )
89818982

89828983
if self.vehicle.mrGbML.debugTimer ~= nil and g_currentMission.time < self.vehicle.mrGbML.debugTimer then
89838984
print(string.format("Clutch mode %d: %3.0f%% => %3.0f%% o: %4.0f U/min c: %4.0f U/min / %3.0f%% .. %3.0f%%",
@@ -9319,7 +9320,7 @@ end
93199320
--**********************************************************************************************************
93209321
-- gearboxMogliMotor:getClutchPercent
93219322
--**********************************************************************************************************
9322-
function gearboxMogliMotor:getClutchPercent( targetRpm, openRpm, closeRpm, fromPercent, toPercent )
9323+
function gearboxMogliMotor:getClutchPercent( targetRpm, openRpm, closeRpm, fromPercent, curPercent, toPercent )
93239324

93249325
if fromPercent ~= nil and toPercent ~= nil and fromPercent >= toPercent then
93259326
return fromPercent
@@ -9331,7 +9332,7 @@ function gearboxMogliMotor:getClutchPercent( targetRpm, openRpm, closeRpm, fromP
93319332
return Utils.getNoNil( fromPercent, self.vehicle.mrGbMS.MinClutchPercent )
93329333
end
93339334

9334-
local minPercent = self.vehicle.mrGbMS.MinClutchPercent + Utils.clamp( 0.5 + 0.02 * ( self.lastRealMotorRpm - openRpm ), 0, 1 ) * math.max( 0, self.autoClutchPercent - self.vehicle.mrGbMS.MinClutchPercent )
9335+
local minPercent = self.vehicle.mrGbMS.MinClutchPercent + Utils.clamp( 0.5 + 0.02 * ( self.lastRealMotorRpm - openRpm ), 0, 1 ) * math.max( 0, curPercent - self.vehicle.mrGbMS.MinClutchPercent )
93359336
local maxPercent = self.vehicle.mrGbMS.MaxClutchPercent
93369337

93379338
if fromPercent ~= nil and minPercent < fromPercent then

FS17_GearboxAddon/modDesc.xml

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22
<modDesc descVersion="32">
33
<author>Mogli aka Biedens</author>
44
<iconFilename>dds/store.dds</iconFilename>
5-
<version>2.0.5.1</version>
5+
<version>2.0.5.2</version>
66
<multiplayer supported="true"/>
77

88
<l10n filenamePrefix="modDesc_l10n">
99
<text name="gearboxMogliVERSION">
10-
<de>Getriebe v2.0.5.1 von Mogli</de>
11-
<en>Gearbox v2.0.5.1 by mogli</en>
12-
<it>Cambio v2.0.5.1 by mogli</it>
13-
<fr>Transmission v2.0.5.1 by mogli</fr>
14-
<cz>Řazení v2.0.5.1 by mogli</cz>
15-
<pl>Skrzynia biegów v2.0.5.1 by mogli</pl>
10+
<de>Getriebe v2.1 RC1 von Mogli</de>
11+
<en>Gearbox v2.1 RC1 by mogli</en>
12+
<it>Cambio v2.1 RC1 by mogli</it>
13+
<fr>Transmission v2.1 RC1 by mogli</fr>
14+
<cz>Řazení v2.1 RC1 by mogli</cz>
15+
<pl>Skrzynia biegów v2.1 RC1 by mogli</pl>
1616
</text>
1717
</l10n>
1818

@@ -37,6 +37,14 @@ In modern tractors power shift transmissions are often combined with automatic g
3737
There are models with one or two gears like the Fendt Vario.
3838
Other models combine four automatically switched mechanical gears with a continuously variable hydrostatic drive.
3939
All of these continuously variable transmission have one thing in common. The efficiency varies quite strongly depending on the gear ratio.
40+
41+
Changelog 2.1:
42+
- Easier launch of vehicle with CVT
43+
- reverse driving sound
44+
- avoid overheating of clutch if a GUI is open
45+
- launch gear can be adjusted while vehicle is in AutoHold
46+
- bug fix blinking fuel usage (MP)
47+
- better motor brake
4048
]]></en>
4149
<de><![CDATA[
4250
Nicht jeder Traktor hat ein stufenloses Getriebe.
@@ -46,6 +54,14 @@ Dabei können ganz unterschiedliche Getriebe simuliert werden.
4654
Es gibt klassische Getriebe mit Gängen, ein oder zwei Gruppen und den Rückwärtsgängen als Gang, in der ersten oder zweiten Gruppe oder als Wendeschaltung.
4755
Wenn man die Schaltzeit auf null verkürzt, dann wird daraus leicht ein Lastschaltgetriebe.
4856
In modernen Traktoren werden die Lastschaltstufen dann oft auch automatisch geschaltet.
57+
58+
Changelog 2.1:
59+
- leichterer Start von Fahrzeugen mit CVT
60+
- Rückfahrtsound
61+
- Keine Überhitzung der Kupplung, wenn ein GUI geöffnet ist
62+
- Start-Gang kann eingestellt werden, während Fahrzeug in AutoHold ist
63+
- Fehlerbehebung blinkt Kraftstoffverbrauch (MP)
64+
- bessere Motorbremse
4965
]]></de>
5066

5167
<it><![CDATA[
@@ -71,6 +87,14 @@ Dans les tracteurs modernes, les transmissions à changement de vitesse sont sou
7187
Il existe des modèles avec une ou deux vitesses comme le Fendt Vario.
7288
D'autres modèles combinent quatre engrenages mécaniques automatiquement commutés avec un entraînement hydrostatique continuellement variable.
7389
Toutes ces transmissions continuellement variables ont une chose en commun. Le rendement varie fortement selon le rapport de démultiplication.
90+
91+
Changement 2.1:
92+
- Lancement plus facile du véhicule avec CVT
93+
- sens inverse
94+
- éviter la surchauffe de l'embrayage si une GUI est ouverte
95+
- Le mécanisme de lancement peut être réglé lorsque le véhicule est en mode AutoHold
96+
- bug corrige l'utilisation de carburant clignotante (MP)
97+
- meilleur frein moteur
7498
]]></fr>
7599
<es><![CDATA[Descripción:
76100
Cambio Manual/automático para FS17 por Mogli]]></es>

src/gearboxMogli.lua

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -918,7 +918,7 @@ function gearboxMogli:initFromXml(xmlFile,xmlString,xmlSource,serverAndClient,mo
918918

919919
self.mrGbMS.ClutchTimeInc = Utils.getNoNil(getXMLFloat(xmlFile, xmlString .. "#clutchTimeIncreaseMs"), clutchEngagingTimeMs )
920920
self.mrGbMS.ClutchTimeDec = Utils.getNoNil(getXMLFloat(xmlFile, xmlString .. "#clutchTimeDecreaseMs"), clutchEngagingTimeMs )
921-
self.mrGbMS.ClutchShiftTime = Utils.getNoNil(getXMLFloat(xmlFile, xmlString .. "#clutchShiftingTimeMs"), 2 * self.mrGbMS.ClutchTimeDec)
921+
self.mrGbMS.ClutchShiftTime = Utils.getNoNil(getXMLFloat(xmlFile, xmlString .. "#clutchShiftingTimeMs"), 0.5 * self.mrGbMS.ClutchTimeDec)
922922
self.mrGbMS.ClutchTimeManual = math.max( Utils.getNoNil(getXMLFloat(xmlFile, xmlString .. "#clutchTimeManualMs"), self.mrGbMG.minClutchTimeManual ), self.mrGbMS.ClutchTimeInc )
923923
self.mrGbMS.ClutchCanOverheat = Utils.getNoNil(getXMLBool( xmlFile, xmlString .. "#clutchCanOverheat"), not self.mrGbMS.TorqueConverterOrHydro )
924924
self.mrGbMS.ClutchOverheatStartTime = Utils.getNoNil(getXMLFloat(xmlFile, xmlString .. "#clutchOverheatStartTimeMs"), 5000 )
@@ -2545,14 +2545,15 @@ function gearboxMogli:update(dt)
25452545
self:mrGbMSetManualClutch( 1 )
25462546
end
25472547
elseif g_currentMission.time > self.mrGbML.oneButtonClutchTimer then
2548-
local mi = ( g_currentMission.time - self.mrGbML.oneButtonClutchTimer ) / self.mrGbMS.ClutchTimeManual
2549-
local ma = math.min( 1, self.mrGbMS.ManualClutch + dt / self.mrGbMS.ClutchTimeInc )
2548+
local mi = math.max( ( g_currentMission.time - self.mrGbML.oneButtonClutchTimer ) / self.mrGbMS.ClutchTimeManual,
2549+
self.mrGbMS.ManualClutch - dt / self.mrGbMS.ClutchTimeDec )
2550+
local ma = math.min( 1,
2551+
self.mrGbMS.ManualClutch + dt / self.mrGbMS.ClutchTimeInc )
25502552
if self.motor.targetRpm == nil then
25512553
self:mrGbMSetManualClutch( mi )
25522554
else
2553-
self:mrGbMSetManualClutch( self.motor:getClutchPercent( self.motor.targetRpm, self.mrGbMS.OpenRpm, self.mrGbMS.CloseRpm, mi, ma ) )
2555+
self:mrGbMSetManualClutch( self.motor:getClutchPercent( self.motor.targetRpm, self.mrGbMS.OpenRpm, self.mrGbMS.CloseRpm, mi, self.mrGbMS.ManualClutch, ma ) )
25542556
end
2555-
--print(string.format("%d, %5.2f%% <= %5.2f%% <= %5.2f%%",g_currentMission.time - self.mrGbML.oneButtonClutchTimer, mi*100,self.mrGbMS.ManualClutch*100,ma*100))
25562557
end
25572558

25582559
if InputBinding.gearboxMogliMINRPM ~= nil then
@@ -8944,7 +8945,7 @@ function gearboxMogliMotor:mrGbMUpdateGear( accelerationPedal )
89448945
if clutchMode > 1
89458946
and self.vehicle.mrGbML.afterShiftClutch ~= nil then
89468947
if self.vehicle.mrGbML.afterShiftClutch < 0 then
8947-
self.autoClutchPercent = self:getClutchPercent( targetRpm, openRpm, closeRpm, fromClutchPercent, toClutchPercent )
8948+
self.autoClutchPercent = self:getClutchPercent( targetRpm, openRpm, closeRpm, fromClutchPercent, self.autoClutchPercent, toClutchPercent )
89488949
else
89498950
self.autoClutchPercent = self.vehicle.mrGbML.afterShiftClutch
89508951
end
@@ -8977,7 +8978,7 @@ function gearboxMogliMotor:mrGbMUpdateGear( accelerationPedal )
89778978
end
89788979
end
89798980

8980-
local c = self:getClutchPercent( targetRpm, openRpm, closeRpm, fromClutchPercent, toClutchPercent )
8981+
local c = self:getClutchPercent( targetRpm, openRpm, closeRpm, fromClutchPercent, self.autoClutchPercent, toClutchPercent )
89818982

89828983
if self.vehicle.mrGbML.debugTimer ~= nil and g_currentMission.time < self.vehicle.mrGbML.debugTimer then
89838984
print(string.format("Clutch mode %d: %3.0f%% => %3.0f%% o: %4.0f U/min c: %4.0f U/min / %3.0f%% .. %3.0f%%",
@@ -9319,7 +9320,7 @@ end
93199320
--**********************************************************************************************************
93209321
-- gearboxMogliMotor:getClutchPercent
93219322
--**********************************************************************************************************
9322-
function gearboxMogliMotor:getClutchPercent( targetRpm, openRpm, closeRpm, fromPercent, toPercent )
9323+
function gearboxMogliMotor:getClutchPercent( targetRpm, openRpm, closeRpm, fromPercent, curPercent, toPercent )
93239324

93249325
if fromPercent ~= nil and toPercent ~= nil and fromPercent >= toPercent then
93259326
return fromPercent
@@ -9331,7 +9332,7 @@ function gearboxMogliMotor:getClutchPercent( targetRpm, openRpm, closeRpm, fromP
93319332
return Utils.getNoNil( fromPercent, self.vehicle.mrGbMS.MinClutchPercent )
93329333
end
93339334

9334-
local minPercent = self.vehicle.mrGbMS.MinClutchPercent + Utils.clamp( 0.5 + 0.02 * ( self.lastRealMotorRpm - openRpm ), 0, 1 ) * math.max( 0, self.autoClutchPercent - self.vehicle.mrGbMS.MinClutchPercent )
9335+
local minPercent = self.vehicle.mrGbMS.MinClutchPercent + Utils.clamp( 0.5 + 0.02 * ( self.lastRealMotorRpm - openRpm ), 0, 1 ) * math.max( 0, curPercent - self.vehicle.mrGbMS.MinClutchPercent )
93359336
local maxPercent = self.vehicle.mrGbMS.MaxClutchPercent
93369337

93379338
if fromPercent ~= nil and minPercent < fromPercent then

0 commit comments

Comments
 (0)