Skip to content

Commit

Permalink
Merge pull request #1712 from Stephan-S/beta-testing
Browse files Browse the repository at this point in the history
Release 1.1.0.7
  • Loading branch information
Iwan1803 authored Dec 16, 2020
2 parents 286950b + f502147 commit b85d84f
Show file tree
Hide file tree
Showing 19 changed files with 449 additions and 281 deletions.
70 changes: 65 additions & 5 deletions FS19_AutoDrive/modDesc.xml
Original file line number Diff line number Diff line change
@@ -1,22 +1,82 @@
<?xml version="1.0" encoding="utf-8" standalone="no" ?>
<modDesc descVersion="46">
<modDesc descVersion="53">
<author>Balu</author>
<title>
<en>AutoDrive</en>
</title>
<description>
<en>
<![CDATA[This mod can be used to create a network of routes for vehicles to drive autonomously. Once setup you can tell a tractor which is standing anywhere close to the network to drive to any point, such as the shop, field 1 or to a sell point.]]>
<![CDATA[This mod can be used to create a network of routes for vehicles to drive autonomously. Once setup you can tell a tractor which is standing anywhere close to the network to drive to any point, such as the shop, field 1 or to a sell point.
Changelog 1.1.0.7:
- Unload backwards into bunker silo
- GUI reworked for easier usability
- Colored marking of previous and following waypoints in the editor
- Open and close folder with folder name
- Marking of open waypoints
- Cooperation with Courseplay and AIVE
- Loading and unloading at multiple destinations
- adjustable collision detection
- Vehicles, trailers and attachments can be assigned and approached to parking positions
- Parking positions can be approached at the end of unloading cycles
- MultiPlayer support improved
- Automatic flashing adjustable
- Automatic selection of unloading side adjustable
- Automatic opening and closing of trailer cover adjustable
- Rotating beacon adjustable for each vehicle
- Further a key combination can be assigned
- Card name removed from config file
]]>
</en>
<de>
<![CDATA[Dieser Mod erlaubt es ein Netzwerk von Routen aufzuzeichnen, um dann ein Fahrzeug von jedem beliebigen Punkt zu speziell definierten Zielen, wie zum Beispiel der eigenen Farm, Feld 1 oder auch zu jedem Verkaufspunkt fahren zu lassen.]]>
<![CDATA[Dieser Mod erlaubt es ein Netzwerk von Routen aufzuzeichnen, um dann ein Fahrzeug von jedem beliebigen Punkt zu speziell definierten Zielen, wie zum Beispiel der eigenen Farm, Feld 1 oder auch zu jedem Verkaufspunkt fahren zu lassen.
Changelog 1.1.0.7:
- Rückwärts in Bunker Silo entladen
- GUI überarbeitet für einfachere Bedienbarkeit
- Farbliche Markierung vorheriger und nachfolgender Wegpunkte im Editor
- Ordner öffnen und schließen mit Ordnername
- Markierung offener Wegstrecken
- Zusammenarbeit mit Courseplay und AIVE
- Be- und Entladen an mehreren Zielen
- einstellbare Kollisionserkennung
- Fahrzeugen, Anhängern und Anbauteilen können Parkplätze zugewiesen und angefahren werden
- Parkpositionen können bei Ende von Abladezyklen angefahren werden
- MultiPlayer-Unterstützung verbessert
- Automatisches Blinken einstellbar
- Automatische Auswahl der Abladeseite einstellbar
- Automatisches Öffnen und Schließen der Abdeckung von Anhängern einstellbar
- Rundumleuchte für jedes Fahrzeug einstellbar
- Weiter kann eine Tastenkombination zugewiesen werden
- Kartenname aus der config-Datei entfernt
]]>
</de>
<it>
<![CDATA[Questa mod può essere usata per creare una rete di percorsi per permettere ai veicoli di guidare autonomamente. Una volta effettuata la configurazione puoi dire a un veicolo di guidare tramite la rete verso un qualsiasi punto, come il negozio, il campo 1 o un punto vendita.]]>
</it>
<fr>
<![CDATA[Ce mod peut être utilisé pour créer un réseau de routes permettant aux véhicules de conduire de manière autonome. Une fois la configuration effectuée, vous pouvez indiquer à un tracteur situé près du réseau de se rendre à n’importe quel point, tel que le magasin, le champ 1 ou un point de vente.
Créer, ajouter, modifier, supprimer vos routes ou points de destination à l'aide de l'éditeur intégré très pratique !]]>
Créer, ajouter, modifier, supprimer vos routes ou points de destination à l'aide de l'éditeur intégré très pratique !
Changelog 1.1.0.7:
- Déchargement à l'envers dans un silo-couloir
- L'interface graphique a été retravaillée pour une utilisation plus aisée
- Marquage coloré des points de passage précédents et suivants dans l'éditeur
- Ouvrir et fermer le dossier avec le nom du dossier
- Marquage des points de passage ouverts
- Coopération avec Courseplay et AIVE
- Chargement et déchargement à des destinations multiples
- détection réglable des collisions
- Les véhicules, remorques et accessoires peuvent être affectés et approchés aux positions de stationnement
- Les positions de stationnement peuvent être approchées à la fin des cycles de déchargement
- Amélioration du support multijoueurs
- Clignotement automatique réglable
- Sélection automatique du côté de déchargement réglable
- Ouverture et fermeture automatique de la bâche de la remorque réglable
- Balise tournante réglable pour chaque véhicule
- En outre, une combinaison de clés peut être attribuée
- Nom de la carte retiré du fichier de configuration
]]>
</fr>
<es>
<![CDATA[Este mod se utiliza para crear una red de rutas y permitir que los vehículos conduzcan de forma autónoma. Una vez configurado, puede ordenar a un tractor, cercano a la red, que conduzca a cualquier meta definida, como la tienda, el campo 1 o un punto de venta.]]>
Expand All @@ -25,7 +85,7 @@ Créer, ajouter, modifier, supprimer vos routes ou points de destination à l'ai
<![CDATA[Этот мод может быть использован для создания сети маршрутов для транспортных средств для автономного вождения. После настройки вы можете указать трактору, стоящему где-угодно рядом с сетью, проехать в любую точку, например, в магазин, поле №1 или в точку продажи.]]>
</ru>
</description>
<version>1.1.0.6</version>
<version>1.1.0.7</version>
<multiplayer supported="true" />
<iconFilename>icon.dds</iconFilename>
<extraSourceFiles>
Expand Down
28 changes: 1 addition & 27 deletions FS19_AutoDrive/register.lua
Original file line number Diff line number Diff line change
Expand Up @@ -236,32 +236,6 @@ function AutoDriveLoadedMission(mission, superFunc, node)
if mission.cancelLoading then
return
end

g_deferredLoadingManager:addTask(
function()
AutoDriveOnMissionLoaded(mission)
end
)
end

function AutoDriveOnMissionLoaded(mission)
g_helpLineManager:loadFromXML(Utils.getFilename("helpLine.xml", AutoDrive.directory))
local category =
table.f_find(
g_helpLineManager.categories,
function(item)
return item.title == "$l10n_ad_helpCategory_1"
end
)
if category ~= nil then
for _, page in pairs(category.pages) do
for _, item in pairs(page.items) do
if item.type == "image" then
item.value = AutoDrive.parsePath(item.value)
end
end
end
end
end

Mission00.loadMission00Finished = Utils.overwrittenFunction(Mission00.loadMission00Finished, AutoDriveLoadedMission)
Expand All @@ -271,4 +245,4 @@ addModEventListener(AutoDriveRegister)

-- first iteration to register AD to vehicle types
AutoDriveRegister.register()
AutoDriveRegister.registerVehicleData()
AutoDriveRegister.registerVehicleData()
2 changes: 1 addition & 1 deletion FS19_AutoDrive/scripts/AutoDrive.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
AutoDrive = {}
AutoDrive.version = "1.1.0.6"
AutoDrive.version = "1.1.0.7-RC1"

AutoDrive.directory = g_currentModDirectory

Expand Down
2 changes: 1 addition & 1 deletion FS19_AutoDrive/scripts/Hud/HudButton.lua
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ function ADHudButton:getNewState(vehicle)
end

if self.primaryAction == "input_incLoopCounter" then
newState = math.max(0, vehicle.ad.stateModule:getLoopCounter() - vehicle.ad.modes[AutoDrive.MODE_PICKUPANDDELIVER].loopsDone) + 1
newState = math.max(0, vehicle.ad.stateModule:getLoopCounter() - vehicle.ad.stateModule:getLoopsDone()) + 1
if vehicle.ad.stateModule:isActive() and vehicle.ad.stateModule:getMode() == AutoDrive.MODE_PICKUPANDDELIVER then
if newState > 1 then
newState = newState + 9
Expand Down
18 changes: 17 additions & 1 deletion FS19_AutoDrive/scripts/Manager/HarvestManager.lua
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ function ADHarvestManager:update(dt)
end

function ADHarvestManager.doesHarvesterNeedUnloading(harvester, ignorePipe)
local ret = false
local fillLevel, leftCapacity = AutoDrive.getFilteredFillLevelAndCapacityOfAllUnits(harvester)
local maxCapacity = fillLevel + leftCapacity

Expand All @@ -219,7 +220,22 @@ function ADHarvestManager.doesHarvesterNeedUnloading(harvester, ignorePipe)
end

local pipeOut = AutoDrive.isPipeOut(harvester)
return (((maxCapacity > 0 and leftCapacity < 1.0) or cpIsCalling) and (pipeOut or ignorePipe) and harvester.ad.noMovementTimer.elapsedTime > 5000)
ret = (
(
(
(maxCapacity > 0 and leftCapacity / maxCapacity < 0.2)
-- (maxCapacity > 0 and leftCapacity < 1.0)
or
cpIsCalling
)
and
-- (pipeOut or ignorePipe)
(pipeOut or (ignorePipe == true))
)
and
harvester.ad.noMovementTimer.elapsedTime > 5000
)
return ret
end

function ADHarvestManager.isHarvesterActive(harvester)
Expand Down
33 changes: 17 additions & 16 deletions FS19_AutoDrive/scripts/Manager/InputManager.lua
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,6 @@ end

function ADInputManager:input_setParkDestination(vehicle)
if vehicle.ad.stateModule:getFirstMarker() ~= nil then

-- g_logManager:info("[AD] ADInputManager:input_setParkDestination vehicle %s vehicle:getIsSelected() %s", tostring(vehicle), tostring(vehicle:getIsSelected()))

local SelectedWorkTool = nil
Expand All @@ -249,7 +248,7 @@ function ADInputManager:input_setParkDestination(vehicle)
table.insert(allImp, imp)
end
end

addAllAttached(vehicle)

if allImp ~= nil then
Expand Down Expand Up @@ -283,19 +282,19 @@ function ADInputManager:input_previousMode(vehicle)
end

function ADInputManager:input_record(vehicle)
if not vehicle.ad.stateModule:isInCreationMode() and not vehicle.ad.stateModule:isInDualCreationMode() then
vehicle.ad.stateModule:startNormalCreationMode()
else
vehicle.ad.stateModule:disableCreationMode()
end
if not vehicle.ad.stateModule:isInCreationMode() and not vehicle.ad.stateModule:isInDualCreationMode() then
vehicle.ad.stateModule:startNormalCreationMode()
else
vehicle.ad.stateModule:disableCreationMode()
end
end

function ADInputManager:input_record_dual(vehicle)
if not vehicle.ad.stateModule:isInCreationMode() and not vehicle.ad.stateModule:isInDualCreationMode() then
vehicle.ad.stateModule:startDualCreationMode()
else
vehicle.ad.stateModule:disableCreationMode()
end
if not vehicle.ad.stateModule:isInCreationMode() and not vehicle.ad.stateModule:isInDualCreationMode() then
vehicle.ad.stateModule:startDualCreationMode()
else
vehicle.ad.stateModule:disableCreationMode()
end
end

function ADInputManager:input_debug(vehicle)
Expand Down Expand Up @@ -387,11 +386,12 @@ end
function ADInputManager:input_callDriver(vehicle)
if vehicle.spec_pipe ~= nil and vehicle.spec_enterable ~= nil then
ADHarvestManager:assignUnloaderToHarvester(vehicle)
elseif vehicle.ad.isCombine and vehicle.ad.attachableCombine ~= nil then
ADHarvestManager:assignUnloaderToHarvester(vehicle.ad.attachableCombine)
end
end

function ADInputManager:input_parkVehicle(vehicle)

local actualParkDestination = AutoDrive.getActualParkDestination(vehicle)

if actualParkDestination >= 1 then
Expand All @@ -404,6 +404,7 @@ function ADInputManager:input_parkVehicle(vehicle)
self:input_start_stop(vehicle)
vehicle.ad.onRouteToPark = true
else
vehicle.ad.onRouteToPark = false
AutoDriveMessageEvent.sendMessage(vehicle, ADMessagesManager.messageTypes.ERROR, "$l10n_AD_parkVehicle_noPosSet;", 5000)
end
end
Expand All @@ -415,15 +416,15 @@ function ADInputManager:input_swapTargets(vehicle)
vehicle.ad.stateModule:removeCPCallback()
end

function ADInputManager:input_startCp(vehicle) -- enable / disable CP or AIVE
function ADInputManager:input_startCp(vehicle) -- enable / disable CP or AIVE
if g_courseplay ~= nil or vehicle.acParameters ~= nil then
vehicle.ad.stateModule:toggleStartCP_AIVE()
end
end

function ADInputManager:input_toggleCP_AIVE(vehicle) -- select CP or AIVE
function ADInputManager:input_toggleCP_AIVE(vehicle) -- select CP or AIVE
if g_courseplay ~= nil and vehicle.acParameters ~= nil then
vehicle.ad.stateModule:toggleUseCP_AIVE()
vehicle.ad.stateModule:setStartCP_AIVE(false) -- disable if changed between CP and AIVE
vehicle.ad.stateModule:setStartCP_AIVE(false) -- disable if changed between CP and AIVE
end
end
13 changes: 6 additions & 7 deletions FS19_AutoDrive/scripts/Modes/PickupAndDeliverMode.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ end
function PickupAndDeliverMode:reset()
AutoDrive.debugPrint(self.vehicle, AutoDrive.DC_PATHINFO, "[AD] PickupAndDeliverMode:reset set STATE_INIT")
self.state = PickupAndDeliverMode.STATE_INIT
self.loopsDone = 0
self.vehicle.ad.stateModule:setLoopsDone(0)
self.activeTask = nil
end

Expand Down Expand Up @@ -167,16 +167,16 @@ function PickupAndDeliverMode:getNextTask(forced)

if self.state == PickupAndDeliverMode.STATE_DELIVER then
-- STATE_DELIVER - drive to load destination
AutoDrive.debugPrint(self.vehicle, AutoDrive.DC_PATHINFO, "[AD] PickupAndDeliverMode:getNextTask STATE_DELIVER self.loopsDone %s", tostring(self.loopsDone))
if self.vehicle.ad.stateModule:getLoopCounter() == 0 or self.loopsDone < self.vehicle.ad.stateModule:getLoopCounter() or ((AutoDrive.getSetting("rotateTargets", self.vehicle) == AutoDrive.RT_ONLYPICKUP or AutoDrive.getSetting("rotateTargets", self.vehicle) == AutoDrive.RT_PICKUPANDDELIVER) and AutoDrive.getSetting("useFolders")) then
AutoDrive.debugPrint(self.vehicle, AutoDrive.DC_PATHINFO, "[AD] PickupAndDeliverMode:getNextTask STATE_DELIVER loopsDone %s", tostring(self.vehicle.ad.stateModule:getLoopsDone()))
if self.vehicle.ad.stateModule:getLoopCounter() == 0 or self.vehicle.ad.stateModule:getLoopsDone() < self.vehicle.ad.stateModule:getLoopCounter() or ((AutoDrive.getSetting("rotateTargets", self.vehicle) == AutoDrive.RT_ONLYPICKUP or AutoDrive.getSetting("rotateTargets", self.vehicle) == AutoDrive.RT_PICKUPANDDELIVER) and AutoDrive.getSetting("useFolders")) then
-- until loops not finished or 0 - drive to load destination
setPickupTarget() -- if rotateTargets is set, set the next pickup target
AutoDrive.debugPrint(self.vehicle, AutoDrive.DC_PATHINFO, "[AD] PickupAndDeliverMode:getNextTask LoadAtDestinationTask... getFirstMarkerName() %s", tostring(self.vehicle.ad.stateModule:getFirstMarkerName()))
nextTask = LoadAtDestinationTask:new(self.vehicle, self.vehicle.ad.stateModule:getFirstMarker().id)
AutoDrive.debugPrint(self.vehicle, AutoDrive.DC_PATHINFO, "[AD] PickupAndDeliverMode:getNextTask set STATE_PICKUP_FROM_NEXT_TARGET")
self.state = PickupAndDeliverMode.STATE_PICKUP_FROM_NEXT_TARGET
self.loopsDone = self.loopsDone + 1
AutoDrive.debugPrint(self.vehicle, AutoDrive.DC_PATHINFO, "[AD] PickupAndDeliverMode:getNextTask self.loopsDone %s", tostring(self.loopsDone))
self.vehicle.ad.stateModule:setLoopsDone(self.vehicle.ad.stateModule:getLoopsDone() + 1)
AutoDrive.debugPrint(self.vehicle, AutoDrive.DC_PATHINFO, "[AD] PickupAndDeliverMode:getNextTask loopsDone %s", tostring(self.vehicle.ad.stateModule:getLoopsDone()))
else
-- if loops are finished - drive to park destination and stop AD
AutoDrive.debugPrint(self.vehicle, AutoDrive.DC_PATHINFO, "[AD] PickupAndDeliverMode:getNextTask DriveToDestinationTask...")
Expand All @@ -189,7 +189,6 @@ function PickupAndDeliverMode:getNextTask(forced)
setDeliverTarget() -- if rotateTargets is set, set the next deliver target
AutoDrive.debugPrint(self.vehicle, AutoDrive.DC_PATHINFO, "[AD] PickupAndDeliverMode:getNextTask STATE_PICKUP UnloadAtDestinationTask... getSecondMarkerName() %s", tostring(self.vehicle.ad.stateModule:getSecondMarkerName()))
nextTask = UnloadAtDestinationTask:new(self.vehicle, self.vehicle.ad.stateModule:getSecondMarker().id)
-- self.loopsDone = self.loopsDone + 1
AutoDrive.debugPrint(self.vehicle, AutoDrive.DC_PATHINFO, "[AD] PickupAndDeliverMode:getNextTask set STATE_DELIVER_TO_NEXT_TARGET")
self.state = PickupAndDeliverMode.STATE_DELIVER_TO_NEXT_TARGET
elseif self.state == PickupAndDeliverMode.STATE_EXIT_FIELD then
Expand Down Expand Up @@ -225,7 +224,7 @@ function PickupAndDeliverMode:getNextTask(forced)
AutoDriveMessageEvent.sendMessageOrNotification(self.vehicle, ADMessagesManager.messageTypes.ERROR, "$l10n_AD_Driver_of; %s $l10n_AD_has_reached; %s", 5000, self.vehicle.ad.stateModule:getName(), self.vehicle.ad.stateModule:getFirstMarkerName())
end

AutoDrive.debugPrint(self.vehicle, AutoDrive.DC_PATHINFO, "[AD] PickupAndDeliverMode:getNextTask end self.loopsDone %s self.state %s", tostring(self.loopsDone), tostring(self.state))
AutoDrive.debugPrint(self.vehicle, AutoDrive.DC_PATHINFO, "[AD] PickupAndDeliverMode:getNextTask end loopsDone %s self.state %s", tostring(self.vehicle.ad.stateModule:getLoopsDone()), tostring(self.state))
return nextTask
end

Expand Down
Loading

0 comments on commit b85d84f

Please sign in to comment.