Skip to content

Commit

Permalink
Merge pull request #975 from Stephan-S/dev-iwan
Browse files Browse the repository at this point in the history
AutoDrive 2.0.1.4
  • Loading branch information
Iwan1803 authored Aug 29, 2023
2 parents e9084e7 + 4a98bbf commit 1eb6f65
Show file tree
Hide file tree
Showing 16 changed files with 164 additions and 166 deletions.
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# FS22_AutoDrive
FS22 version of the AutoDrive mod

### Latest Release: 2.0.1.2
### Latest Release: 2.0.1.4
![GitHub all releases](https://img.shields.io/github/downloads/Stephan-S/FS22_AutoDrive/total?label=Downloads&style=plastic)
[Latest Release](https://github.com/Stephan-S/FS22_AutoDrive/releases/latest)
Direct Download: https://github.com/Stephan-S/FS22_AutoDrive/releases/download/2.0.1.2/FS22_AutoDrive.zip
Direct Download: https://github.com/Stephan-S/FS22_AutoDrive/releases/latest/download/FS22_AutoDrive.zip

## Discord Server:
For help & support, feel free to join us on Discord:
Expand Down
2 changes: 1 addition & 1 deletion modDesc.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Différents modes d'utilisation ont été ajoutés depuis les premières version
<![CDATA[Этот мод может быть использован для создания сети маршрутов для транспортных средств для автономного вождения. После настройки вы можете указать трактору, стоящему где-угодно рядом с сетью, проехать в любую точку, например, в магазин, поле №1 или в точку продажи.]]>
</ru>
</description>
<version>2.0.1.2</version>
<version>2.0.1.4</version>
<multiplayer supported="true" />
<iconFilename>icon.dds</iconFilename>
<extraSourceFiles>
Expand Down
2 changes: 1 addition & 1 deletion scripts/AutoDrive.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
AutoDrive = {}
AutoDrive.version = "2.0.1.2"
AutoDrive.version = "2.0.1.4"

AutoDrive.directory = g_currentModDirectory

Expand Down
18 changes: 9 additions & 9 deletions scripts/Manager/DrawingManager.lua
Original file line number Diff line number Diff line change
Expand Up @@ -87,18 +87,18 @@ function ADDrawingManager.initObject(id)
return itemId
end

function ADDrawingManager:addLineTask(sx, sy, sz, ex, ey, ez, r, g, b)
function ADDrawingManager:addLineTask(sx, sy, sz, ex, ey, ez, scale, r, g, b)
-- storing task
local hash = 0
-- local hash = string.format("l%.2f%.2f%.2f%.2f%.2f%.2f%.2f%.2f%.2f%.1f", sx, sy, sz, ex, ey, ez, r, g, b, self.yOffset)
table.insert(self.lines.tasks, {sx = sx, sy = sy, sz = sz, ex = ex, ey = ey, ez = ez, r = r, g = g, b = b, hash = hash})
table.insert(self.lines.tasks, {sx = sx, sy = sy, sz = sz, ex = ex, ey = ey, ez = ez, scale = scale, r = r, g = g, b = b, hash = hash})
end

function ADDrawingManager:addArrowTask(sx, sy, sz, ex, ey, ez, position, r, g, b)
function ADDrawingManager:addArrowTask(sx, sy, sz, ex, ey, ez, scale, position, r, g, b)
-- storing task
local hash = 0
-- local hash = string.format("a%.2f%.2f%.2f%.2f%.2f%.2f%d%.2f%.2f%.2f%.1f", sx, sy, sz, ex, ey, ez, position, r, g, b, self.yOffset)
table.insert(self.arrows.tasks, {sx = sx, sy = sy, sz = sz, ex = ex, ey = ey, ez = ez, r = r, g = g, b = b, position = position, hash = hash})
table.insert(self.arrows.tasks, {sx = sx, sy = sy, sz = sz, ex = ex, ey = ey, ez = ez, scale = scale, r = r, g = g, b = b, position = position, hash = hash})
end

function ADDrawingManager:addSmallSphereTask(x, y, z, r, g, b)
Expand All @@ -115,11 +115,11 @@ function ADDrawingManager:addMarkerTask(x, y, z)
table.insert(self.markers.tasks, {x = x, y = y, z = z, hash = hash})
end

function ADDrawingManager:addCrossTask(x, y, z)
function ADDrawingManager:addCrossTask(x, y, z, scale)
-- storing task
local hash = 0
-- local hash = string.format("c%.2f%.2f%.2f%.1f", x, y, z, self.yOffset)
table.insert(self.cross.tasks, {x = x, y = y, z = z, hash = hash})
table.insert(self.cross.tasks, {x = x, y = y, z = z, scale = scale, hash = hash})
end

function ADDrawingManager:addSphereTask(x, y, z, scale, r, g, b, a)
Expand Down Expand Up @@ -348,7 +348,7 @@ function ADDrawingManager:drawLine(id, task)

setTranslation(id, task.sx, task.sy + self.yOffset, task.sz)

local scaleLines = AutoDrive.getSetting("scaleLines") or 1
local scaleLines = (AutoDrive.getSetting("scaleLines") or 1) * (task.scale or 1)
setScale(id, scaleLines, scaleLines, distToNextPoint)

-- Set the direction of the line
Expand Down Expand Up @@ -387,7 +387,7 @@ function ADDrawingManager:drawArrow(id, task)

setTranslation(id, x, y + self.yOffset, z)

local scaleLines = AutoDrive.getSetting("scaleLines") or 1
local scaleLines = (AutoDrive.getSetting("scaleLines") or 1) * (task.scale or 1)
setScale(id, scaleLines, scaleLines, scaleLines)

-- Set the direction of the arrow
Expand All @@ -413,7 +413,7 @@ end

function ADDrawingManager:drawCross(id, task)
setTranslation(id, task.x, task.y + self.yOffset, task.z)
local scaleLines = AutoDrive.getSetting("scaleLines") or 1
local scaleLines = (AutoDrive.getSetting("scaleLines") or 1) * (task.scale or 1)
setScale(id, scaleLines, scaleLines, scaleLines)
setVisibility(id, true)
end
Expand Down
2 changes: 1 addition & 1 deletion scripts/Modules/DrivePathModule.lua
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ function ADDrivePathModule:followWaypoints(dt)

--print("Speed: " .. (self.vehicle.lastSpeedReal * 3600) .. "/" .. self.speedLimit .. " acc: " .. self.acceleration .. " maxSpeedDiff: " .. maxSpeedDiff)
--print("LAD: " .. self.distanceToLookAhead .. " maxAngle: " .. self.maxAngle .. " maxAngleSpeed: " .. self.maxAngleSpeed)
--ADDrawingManager:addLineTask(x, y, z, self.targetX, y, self.targetZ, 1, 0, 0)
--ADDrawingManager:addLineTask(x, y, z, self.targetX, y, self.targetZ, 1, 1, 0, 0)
if self.vehicle.startMotor then
if not self.vehicle:getIsMotorStarted() and self.vehicle:getCanMotorRun() and not self.vehicle.ad.specialDrivingModule:shouldStopMotor() then
self.vehicle:startMotor()
Expand Down
Loading

0 comments on commit 1eb6f65

Please sign in to comment.