chore: DEBUG ved mål viser AutoDrives tømnings-porte (v1.62.148)

This commit is contained in:
2026-10-10 04:54:41 +02:00
parent 60bc20ffb9
commit a22d7870de
3 changed files with 21 additions and 2 deletions
+19 -1
View File
@@ -333,8 +333,26 @@ local function debugAtTarget(adEnv, task, dt)
local ok, value = pcall(function() return object:getCanDischargeToObject(object:getCurrentDischargeNode()) end)
canDischarge = ok and tostring(value) or "err"
end
table.insert(states, string.format("dischargeState=%s canDischargeToObject=%s", tostring(state), canDischarge))
-- AD's porte for at starte tømningen (ADTrailerModule:lookForPossibleUnloadTrigger): autoload-tolkning, vognens
-- afstand til aflæsningspunktet og AD's egen vurdering (in-game 10/10: BOSS ALPIN ved Cow 3 Silo tippede aldrig)
local hasAL = object ~= nil and adEnv.AutoDrive.hasAL ~= nil and tostring(select(2, pcall(adEnv.AutoDrive.hasAL, adEnv.AutoDrive, object))) or "?"
local unitDistance = object ~= nil and adEnv.AutoDrive.getDistanceToUnloadPosition ~= nil and select(2, pcall(adEnv.AutoDrive.getDistanceToUnloadPosition, object)) or nil
local adTrigger = "?"
if trailerModule ~= nil and trailerModule.lookForPossibleUnloadTrigger ~= nil and object ~= nil then
local okT, trigger = pcall(trailerModule.lookForPossibleUnloadTrigger, trailerModule, object)
adTrigger = okT and tostring(trigger ~= nil) or "err"
end
table.insert(states, string.format("%s: dischargeState=%s canDischargeToObject=%s hasAL=%s vognAfstand=%s adFinderTrigger=%s",
tostring(object ~= nil and object.getName ~= nil and object:getName() or "?"), tostring(state), canDischarge, hasAL,
type(unitDistance) == "number" and string.format("%.1f", unitDistance) or "?", adTrigger))
end
local maxTrigger = adEnv.AutoDrive.getMaxTriggerDistance ~= nil and select(2, pcall(adEnv.AutoDrive.getMaxTriggerDistance, vehicle)) or nil
local mode = vehicle.ad.stateModule.getCurrentMode ~= nil and vehicle.ad.stateModule:getCurrentMode() or nil
local shouldUnload = mode ~= nil and mode.shouldUnloadAtTrigger ~= nil and tostring(select(2, pcall(mode.shouldUnloadAtTrigger, mode))) or "?"
table.insert(states, string.format("AD: fillLevel=%s triggerAfstand=%s shouldUnloadAtTrigger=%s rotateTrigger=%s inRange=%s",
tostring(trailerModule ~= nil and trailerModule.fillLevel), tostring(maxTrigger), shouldUnload,
tostring(trailerModule ~= nil and trailerModule.lastUnloadRotateTrigger ~= nil),
adEnv.AutoDrive.isInRangeToLoadUnloadTarget ~= nil and tostring(select(2, pcall(adEnv.AutoDrive.isInRangeToLoadUnloadTarget, vehicle))) or "?"))
local fillTypeName = g_fillTypeManager ~= nil and g_fillTypeManager:getFillTypeNameByIndex(fillType) or tostring(fillType)
local distance = adEnv.AutoDrive.getDistanceToUnloadPosition ~= nil and adEnv.AutoDrive.getDistanceToUnloadPosition(vehicle) or -1
local secondMarker = vehicle.ad.stateModule.getSecondMarker ~= nil and vehicle.ad.stateModule:getSecondMarker() or nil
+1 -1
View File
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<modDesc descVersion="107">
<author>masterdraco</author>
<version>1.62.147.0</version>
<version>1.62.148.0</version>
<title>
<en>AD Smart Pickup</en>
</title>