-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 69bb81d
Showing
7 changed files
with
60 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.idea/ | ||
*.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
AutomaticReelSpeed = {} | ||
|
||
function AutomaticReelSpeed:onUpdate(dt, isActiveForInput, isActiveForInputIgnoreSelection, isSelected) | ||
local spec = self.spec_turnOnVehicle | ||
|
||
for i = 1, #spec.turnedOnAnimations do | ||
local turnedOnAnimation = spec.turnedOnAnimations[i] | ||
if turnedOnAnimation.name == "reelAnimation" and turnedOnAnimation.isTurnedOn then | ||
local lastSpeed = math.ceil(self:getLastSpeed()) | ||
local workingSpeedLimit, isWorking = self:getSpeedLimit(true) | ||
if not isWorking then | ||
lastSpeed = 6 | ||
elseif lastSpeed < 2 then | ||
lastSpeed = 2 | ||
elseif lastSpeed > 14 then | ||
lastSpeed = 14 | ||
end | ||
|
||
turnedOnAnimation.speedScale = (lastSpeed / 10) * 0.7 | ||
if turnedOnAnimation.speedScaleLast ~= nil and turnedOnAnimation.speedScaleLast ~= turnedOnAnimation.speedScale then | ||
self:setAnimationSpeed(turnedOnAnimation.name, turnedOnAnimation.currentSpeed * turnedOnAnimation.speedScale) | ||
end | ||
turnedOnAnimation.speedScaleLast = turnedOnAnimation.speedScale | ||
spec.turnedOnAnimations[i] = turnedOnAnimation | ||
end | ||
end | ||
end | ||
|
||
TurnOnVehicle.onUpdate = Utils.appendedFunction(TurnOnVehicle.onUpdate, AutomaticReelSpeed.onUpdate) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Automatic Reel Speed for Farming Simulator 22 | ||
|
||
__Important! This is an early version. Bugs may occur!__ | ||
|
||
This is a mod for realism fans. Modern combines are able to adjust the reel speed based on their driven speed. This script will just do that. | ||
|
||
# Automatische Haspelgeschwindigkeit for Farming Simulator 22 | ||
|
||
__Achtung! Dies ist eine erste Version. Es können Bugs auftreten!__ | ||
|
||
Dieser Mod ist für Realismus-Fans. Moderne Mähdrescher können die Geschwindigkeit der Haspel des Schneidwerks automatisch der Fahrgeschwindigkeit anpassen. Dieses Script macht genau das. |
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?xml version="1.0" encoding="utf-8" standalone="no" ?> | ||
<modDesc descVersion="63"> | ||
<author>CptCray</author> | ||
<version>0.1.0.0</version> | ||
<title> | ||
<en>Automatic Reel Speed</en> | ||
<de>Automatische Haspelgeschwindigkeit</de> | ||
</title> | ||
<description> | ||
<en><![CDATA[Adjusts the combine reel speed depending on driven speed]]></en> | ||
<de><![CDATA[Passt die Geschwindigkeit der Drescher-Haspel entsprechend der Fahrgeschwindigkeit an]]></de> | ||
</description> | ||
<iconFilename>icon.dds</iconFilename> | ||
<multiplayer supported="true"/> | ||
<extraSourceFiles> | ||
<sourceFile filename="AutomaticReelSpeed.lua"/> | ||
</extraSourceFiles> | ||
</modDesc> |