Skip to content

Commit b85d84f

Browse files
authored
Merge pull request #1712 from Stephan-S/beta-testing
Release 1.1.0.7
2 parents 286950b + f502147 commit b85d84f

19 files changed

+449
-281
lines changed

FS19_AutoDrive/modDesc.xml

Lines changed: 65 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,82 @@
11
<?xml version="1.0" encoding="utf-8" standalone="no" ?>
2-
<modDesc descVersion="46">
2+
<modDesc descVersion="53">
33
<author>Balu</author>
44
<title>
55
<en>AutoDrive</en>
66
</title>
77
<description>
88
<en>
9-
<![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.]]>
9+
<![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.
10+
11+
Changelog 1.1.0.7:
12+
- Unload backwards into bunker silo
13+
- GUI reworked for easier usability
14+
- Colored marking of previous and following waypoints in the editor
15+
- Open and close folder with folder name
16+
- Marking of open waypoints
17+
- Cooperation with Courseplay and AIVE
18+
- Loading and unloading at multiple destinations
19+
- adjustable collision detection
20+
- Vehicles, trailers and attachments can be assigned and approached to parking positions
21+
- Parking positions can be approached at the end of unloading cycles
22+
- MultiPlayer support improved
23+
- Automatic flashing adjustable
24+
- Automatic selection of unloading side adjustable
25+
- Automatic opening and closing of trailer cover adjustable
26+
- Rotating beacon adjustable for each vehicle
27+
- Further a key combination can be assigned
28+
- Card name removed from config file
29+
]]>
1030
</en>
1131
<de>
12-
<![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.]]>
32+
<![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.
33+
34+
Changelog 1.1.0.7:
35+
- Rückwärts in Bunker Silo entladen
36+
- GUI überarbeitet für einfachere Bedienbarkeit
37+
- Farbliche Markierung vorheriger und nachfolgender Wegpunkte im Editor
38+
- Ordner öffnen und schließen mit Ordnername
39+
- Markierung offener Wegstrecken
40+
- Zusammenarbeit mit Courseplay und AIVE
41+
- Be- und Entladen an mehreren Zielen
42+
- einstellbare Kollisionserkennung
43+
- Fahrzeugen, Anhängern und Anbauteilen können Parkplätze zugewiesen und angefahren werden
44+
- Parkpositionen können bei Ende von Abladezyklen angefahren werden
45+
- MultiPlayer-Unterstützung verbessert
46+
- Automatisches Blinken einstellbar
47+
- Automatische Auswahl der Abladeseite einstellbar
48+
- Automatisches Öffnen und Schließen der Abdeckung von Anhängern einstellbar
49+
- Rundumleuchte für jedes Fahrzeug einstellbar
50+
- Weiter kann eine Tastenkombination zugewiesen werden
51+
- Kartenname aus der config-Datei entfernt
52+
]]>
1353
</de>
1454
<it>
1555
<![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.]]>
1656
</it>
1757
<fr>
1858
<![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.
19-
Créer, ajouter, modifier, supprimer vos routes ou points de destination à l'aide de l'éditeur intégré très pratique !]]>
59+
Créer, ajouter, modifier, supprimer vos routes ou points de destination à l'aide de l'éditeur intégré très pratique !
60+
61+
Changelog 1.1.0.7:
62+
- Déchargement à l'envers dans un silo-couloir
63+
- L'interface graphique a été retravaillée pour une utilisation plus aisée
64+
- Marquage coloré des points de passage précédents et suivants dans l'éditeur
65+
- Ouvrir et fermer le dossier avec le nom du dossier
66+
- Marquage des points de passage ouverts
67+
- Coopération avec Courseplay et AIVE
68+
- Chargement et déchargement à des destinations multiples
69+
- détection réglable des collisions
70+
- Les véhicules, remorques et accessoires peuvent être affectés et approchés aux positions de stationnement
71+
- Les positions de stationnement peuvent être approchées à la fin des cycles de déchargement
72+
- Amélioration du support multijoueurs
73+
- Clignotement automatique réglable
74+
- Sélection automatique du côté de déchargement réglable
75+
- Ouverture et fermeture automatique de la bâche de la remorque réglable
76+
- Balise tournante réglable pour chaque véhicule
77+
- En outre, une combinaison de clés peut être attribuée
78+
- Nom de la carte retiré du fichier de configuration
79+
]]>
2080
</fr>
2181
<es>
2282
<![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.]]>
@@ -25,7 +85,7 @@ Créer, ajouter, modifier, supprimer vos routes ou points de destination à l'ai
2585
<![CDATA[Этот мод может быть использован для создания сети маршрутов для транспортных средств для автономного вождения. После настройки вы можете указать трактору, стоящему где-угодно рядом с сетью, проехать в любую точку, например, в магазин, поле №1 или в точку продажи.]]>
2686
</ru>
2787
</description>
28-
<version>1.1.0.6</version>
88+
<version>1.1.0.7</version>
2989
<multiplayer supported="true" />
3090
<iconFilename>icon.dds</iconFilename>
3191
<extraSourceFiles>

FS19_AutoDrive/register.lua

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -236,32 +236,6 @@ function AutoDriveLoadedMission(mission, superFunc, node)
236236
if mission.cancelLoading then
237237
return
238238
end
239-
240-
g_deferredLoadingManager:addTask(
241-
function()
242-
AutoDriveOnMissionLoaded(mission)
243-
end
244-
)
245-
end
246-
247-
function AutoDriveOnMissionLoaded(mission)
248-
g_helpLineManager:loadFromXML(Utils.getFilename("helpLine.xml", AutoDrive.directory))
249-
local category =
250-
table.f_find(
251-
g_helpLineManager.categories,
252-
function(item)
253-
return item.title == "$l10n_ad_helpCategory_1"
254-
end
255-
)
256-
if category ~= nil then
257-
for _, page in pairs(category.pages) do
258-
for _, item in pairs(page.items) do
259-
if item.type == "image" then
260-
item.value = AutoDrive.parsePath(item.value)
261-
end
262-
end
263-
end
264-
end
265239
end
266240

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

272246
-- first iteration to register AD to vehicle types
273247
AutoDriveRegister.register()
274-
AutoDriveRegister.registerVehicleData()
248+
AutoDriveRegister.registerVehicleData()

FS19_AutoDrive/scripts/AutoDrive.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
AutoDrive = {}
2-
AutoDrive.version = "1.1.0.6"
2+
AutoDrive.version = "1.1.0.7-RC1"
33

44
AutoDrive.directory = g_currentModDirectory
55

FS19_AutoDrive/scripts/Hud/HudButton.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ function ADHudButton:getNewState(vehicle)
126126
end
127127

128128
if self.primaryAction == "input_incLoopCounter" then
129-
newState = math.max(0, vehicle.ad.stateModule:getLoopCounter() - vehicle.ad.modes[AutoDrive.MODE_PICKUPANDDELIVER].loopsDone) + 1
129+
newState = math.max(0, vehicle.ad.stateModule:getLoopCounter() - vehicle.ad.stateModule:getLoopsDone()) + 1
130130
if vehicle.ad.stateModule:isActive() and vehicle.ad.stateModule:getMode() == AutoDrive.MODE_PICKUPANDDELIVER then
131131
if newState > 1 then
132132
newState = newState + 9

FS19_AutoDrive/scripts/Manager/HarvestManager.lua

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ function ADHarvestManager:update(dt)
210210
end
211211

212212
function ADHarvestManager.doesHarvesterNeedUnloading(harvester, ignorePipe)
213+
local ret = false
213214
local fillLevel, leftCapacity = AutoDrive.getFilteredFillLevelAndCapacityOfAllUnits(harvester)
214215
local maxCapacity = fillLevel + leftCapacity
215216

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

221222
local pipeOut = AutoDrive.isPipeOut(harvester)
222-
return (((maxCapacity > 0 and leftCapacity < 1.0) or cpIsCalling) and (pipeOut or ignorePipe) and harvester.ad.noMovementTimer.elapsedTime > 5000)
223+
ret = (
224+
(
225+
(
226+
(maxCapacity > 0 and leftCapacity / maxCapacity < 0.2)
227+
-- (maxCapacity > 0 and leftCapacity < 1.0)
228+
or
229+
cpIsCalling
230+
)
231+
and
232+
-- (pipeOut or ignorePipe)
233+
(pipeOut or (ignorePipe == true))
234+
)
235+
and
236+
harvester.ad.noMovementTimer.elapsedTime > 5000
237+
)
238+
return ret
223239
end
224240

225241
function ADHarvestManager.isHarvesterActive(harvester)

FS19_AutoDrive/scripts/Manager/InputManager.lua

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,6 @@ end
236236

237237
function ADInputManager:input_setParkDestination(vehicle)
238238
if vehicle.ad.stateModule:getFirstMarker() ~= nil then
239-
240239
-- g_logManager:info("[AD] ADInputManager:input_setParkDestination vehicle %s vehicle:getIsSelected() %s", tostring(vehicle), tostring(vehicle:getIsSelected()))
241240

242241
local SelectedWorkTool = nil
@@ -249,7 +248,7 @@ function ADInputManager:input_setParkDestination(vehicle)
249248
table.insert(allImp, imp)
250249
end
251250
end
252-
251+
253252
addAllAttached(vehicle)
254253

255254
if allImp ~= nil then
@@ -283,19 +282,19 @@ function ADInputManager:input_previousMode(vehicle)
283282
end
284283

285284
function ADInputManager:input_record(vehicle)
286-
if not vehicle.ad.stateModule:isInCreationMode() and not vehicle.ad.stateModule:isInDualCreationMode() then
287-
vehicle.ad.stateModule:startNormalCreationMode()
288-
else
289-
vehicle.ad.stateModule:disableCreationMode()
290-
end
285+
if not vehicle.ad.stateModule:isInCreationMode() and not vehicle.ad.stateModule:isInDualCreationMode() then
286+
vehicle.ad.stateModule:startNormalCreationMode()
287+
else
288+
vehicle.ad.stateModule:disableCreationMode()
289+
end
291290
end
292291

293292
function ADInputManager:input_record_dual(vehicle)
294-
if not vehicle.ad.stateModule:isInCreationMode() and not vehicle.ad.stateModule:isInDualCreationMode() then
295-
vehicle.ad.stateModule:startDualCreationMode()
296-
else
297-
vehicle.ad.stateModule:disableCreationMode()
298-
end
293+
if not vehicle.ad.stateModule:isInCreationMode() and not vehicle.ad.stateModule:isInDualCreationMode() then
294+
vehicle.ad.stateModule:startDualCreationMode()
295+
else
296+
vehicle.ad.stateModule:disableCreationMode()
297+
end
299298
end
300299

301300
function ADInputManager:input_debug(vehicle)
@@ -387,11 +386,12 @@ end
387386
function ADInputManager:input_callDriver(vehicle)
388387
if vehicle.spec_pipe ~= nil and vehicle.spec_enterable ~= nil then
389388
ADHarvestManager:assignUnloaderToHarvester(vehicle)
389+
elseif vehicle.ad.isCombine and vehicle.ad.attachableCombine ~= nil then
390+
ADHarvestManager:assignUnloaderToHarvester(vehicle.ad.attachableCombine)
390391
end
391392
end
392393

393394
function ADInputManager:input_parkVehicle(vehicle)
394-
395395
local actualParkDestination = AutoDrive.getActualParkDestination(vehicle)
396396

397397
if actualParkDestination >= 1 then
@@ -404,6 +404,7 @@ function ADInputManager:input_parkVehicle(vehicle)
404404
self:input_start_stop(vehicle)
405405
vehicle.ad.onRouteToPark = true
406406
else
407+
vehicle.ad.onRouteToPark = false
407408
AutoDriveMessageEvent.sendMessage(vehicle, ADMessagesManager.messageTypes.ERROR, "$l10n_AD_parkVehicle_noPosSet;", 5000)
408409
end
409410
end
@@ -415,15 +416,15 @@ function ADInputManager:input_swapTargets(vehicle)
415416
vehicle.ad.stateModule:removeCPCallback()
416417
end
417418

418-
function ADInputManager:input_startCp(vehicle) -- enable / disable CP or AIVE
419+
function ADInputManager:input_startCp(vehicle) -- enable / disable CP or AIVE
419420
if g_courseplay ~= nil or vehicle.acParameters ~= nil then
420421
vehicle.ad.stateModule:toggleStartCP_AIVE()
421422
end
422423
end
423424

424-
function ADInputManager:input_toggleCP_AIVE(vehicle) -- select CP or AIVE
425+
function ADInputManager:input_toggleCP_AIVE(vehicle) -- select CP or AIVE
425426
if g_courseplay ~= nil and vehicle.acParameters ~= nil then
426427
vehicle.ad.stateModule:toggleUseCP_AIVE()
427-
vehicle.ad.stateModule:setStartCP_AIVE(false) -- disable if changed between CP and AIVE
428+
vehicle.ad.stateModule:setStartCP_AIVE(false) -- disable if changed between CP and AIVE
428429
end
429430
end

FS19_AutoDrive/scripts/Modes/PickupAndDeliverMode.lua

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ end
2121
function PickupAndDeliverMode:reset()
2222
AutoDrive.debugPrint(self.vehicle, AutoDrive.DC_PATHINFO, "[AD] PickupAndDeliverMode:reset set STATE_INIT")
2323
self.state = PickupAndDeliverMode.STATE_INIT
24-
self.loopsDone = 0
24+
self.vehicle.ad.stateModule:setLoopsDone(0)
2525
self.activeTask = nil
2626
end
2727

@@ -167,16 +167,16 @@ function PickupAndDeliverMode:getNextTask(forced)
167167

168168
if self.state == PickupAndDeliverMode.STATE_DELIVER then
169169
-- STATE_DELIVER - drive to load destination
170-
AutoDrive.debugPrint(self.vehicle, AutoDrive.DC_PATHINFO, "[AD] PickupAndDeliverMode:getNextTask STATE_DELIVER self.loopsDone %s", tostring(self.loopsDone))
171-
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
170+
AutoDrive.debugPrint(self.vehicle, AutoDrive.DC_PATHINFO, "[AD] PickupAndDeliverMode:getNextTask STATE_DELIVER loopsDone %s", tostring(self.vehicle.ad.stateModule:getLoopsDone()))
171+
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
172172
-- until loops not finished or 0 - drive to load destination
173173
setPickupTarget() -- if rotateTargets is set, set the next pickup target
174174
AutoDrive.debugPrint(self.vehicle, AutoDrive.DC_PATHINFO, "[AD] PickupAndDeliverMode:getNextTask LoadAtDestinationTask... getFirstMarkerName() %s", tostring(self.vehicle.ad.stateModule:getFirstMarkerName()))
175175
nextTask = LoadAtDestinationTask:new(self.vehicle, self.vehicle.ad.stateModule:getFirstMarker().id)
176176
AutoDrive.debugPrint(self.vehicle, AutoDrive.DC_PATHINFO, "[AD] PickupAndDeliverMode:getNextTask set STATE_PICKUP_FROM_NEXT_TARGET")
177177
self.state = PickupAndDeliverMode.STATE_PICKUP_FROM_NEXT_TARGET
178-
self.loopsDone = self.loopsDone + 1
179-
AutoDrive.debugPrint(self.vehicle, AutoDrive.DC_PATHINFO, "[AD] PickupAndDeliverMode:getNextTask self.loopsDone %s", tostring(self.loopsDone))
178+
self.vehicle.ad.stateModule:setLoopsDone(self.vehicle.ad.stateModule:getLoopsDone() + 1)
179+
AutoDrive.debugPrint(self.vehicle, AutoDrive.DC_PATHINFO, "[AD] PickupAndDeliverMode:getNextTask loopsDone %s", tostring(self.vehicle.ad.stateModule:getLoopsDone()))
180180
else
181181
-- if loops are finished - drive to park destination and stop AD
182182
AutoDrive.debugPrint(self.vehicle, AutoDrive.DC_PATHINFO, "[AD] PickupAndDeliverMode:getNextTask DriveToDestinationTask...")
@@ -189,7 +189,6 @@ function PickupAndDeliverMode:getNextTask(forced)
189189
setDeliverTarget() -- if rotateTargets is set, set the next deliver target
190190
AutoDrive.debugPrint(self.vehicle, AutoDrive.DC_PATHINFO, "[AD] PickupAndDeliverMode:getNextTask STATE_PICKUP UnloadAtDestinationTask... getSecondMarkerName() %s", tostring(self.vehicle.ad.stateModule:getSecondMarkerName()))
191191
nextTask = UnloadAtDestinationTask:new(self.vehicle, self.vehicle.ad.stateModule:getSecondMarker().id)
192-
-- self.loopsDone = self.loopsDone + 1
193192
AutoDrive.debugPrint(self.vehicle, AutoDrive.DC_PATHINFO, "[AD] PickupAndDeliverMode:getNextTask set STATE_DELIVER_TO_NEXT_TARGET")
194193
self.state = PickupAndDeliverMode.STATE_DELIVER_TO_NEXT_TARGET
195194
elseif self.state == PickupAndDeliverMode.STATE_EXIT_FIELD then
@@ -225,7 +224,7 @@ function PickupAndDeliverMode:getNextTask(forced)
225224
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())
226225
end
227226

228-
AutoDrive.debugPrint(self.vehicle, AutoDrive.DC_PATHINFO, "[AD] PickupAndDeliverMode:getNextTask end self.loopsDone %s self.state %s", tostring(self.loopsDone), tostring(self.state))
227+
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))
229228
return nextTask
230229
end
231230

0 commit comments

Comments
 (0)