feat(forsyning): siloer der kun kan fyldes (Pumps&Hoses drive-on-bunker DOB 115) kan vælges under Til og er aldrig kilder (v1.18.1.0)

This commit is contained in:
2026-09-24 05:29:58 +02:00
parent d0485caa33
commit 57fc01ac47
5 changed files with 30 additions and 8 deletions
+7 -3
View File
@@ -231,13 +231,17 @@ local function build(adEnv, farmId)
end
table.sort(loadMarkers, function(a, b) return ADBuildings.naturalLess(a.name, b.name) end)
end
local unloadMarker = nearestMarker(adEnv, unloadNodes)
-- silo der kun kan FYLDES (fx drive-on-bunker der fodrer en biogas-fermentor): aflæsning,
-- ingen læssestation -> et forsyningsmål, aldrig en kilde
local isFillOnlySilo = kind == "silo" and loadMarkers[1] == nil and #loadGroups == 0 and unloadMarker ~= nil
table.insert(result, {
id = id, name = getName(placeable, id), kind = kind, placeable = placeable,
loadMarker = loadMarkers[1],
loadMarkers = loadMarkers,
unloadMarker = nearestMarker(adEnv, unloadNodes),
canBeSource = kind ~= "sell",
canBeTarget = kind == "husbandry" or kind == "factory",
unloadMarker = unloadMarker,
canBeSource = kind ~= "sell" and not isFillOnlySilo,
canBeTarget = kind == "husbandry" or kind == "factory" or isFillOnlySilo,
canSell = kind == "sell",
})
end
+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.18.0.0</version>
<version>1.18.1.0</version>
<title>
<en>AD Smart Pickup</en>
</title>
+4 -2
View File
@@ -1,6 +1,6 @@
# AD Smart Pickup — brugermanual
Version 1.18.0 · Farming Simulator 25 · tillæg til AutoDrive
Version 1.18.1 · Farming Simulator 25 · tillæg til AutoDrive
*English version: [USER_MANUAL.md](USER_MANUAL.md)*
@@ -179,7 +179,9 @@ Et forsyningsflow holder én eller flere bygninger fyldt med alt det, de bruger.
### Opsætning
1. **Nyt run**, og lad Retning stå på **Ind til bygning**.
2. Under **Til**: sæt Ja ud for de stalde og fabrikker, der skal fyldes.
2. Under **Til**: sæt Ja ud for de stalde og fabrikker, der skal fyldes. Listen viser også siloer,
der kun kan fyldes og ikke tømmes, fx Pumps & Hoses' drive-on-bunkere (DOB 115), der fodrer en
biogas-fermentor. For dem er **Vælg** med de varer, fermentoren skal have, bedst.
3. Under **Varer**: vælg **Auto** eller **Vælg**.
- **Auto** henter alt det, bygningen tager. For fabrikker er det inputs til de produktioner,
der er tændt.
+4 -2
View File
@@ -1,6 +1,6 @@
# AD Smart Pickup — user manual
Version 1.18.0 · Farming Simulator 25 · add-on for AutoDrive
Version 1.18.1 · Farming Simulator 25 · add-on for AutoDrive
*Dansk version: [BRUGERMANUAL.md](BRUGERMANUAL.md)*
@@ -181,7 +181,9 @@ A supply flow keeps one or more buildings filled with everything they use.
### Setup
1. **New run**, and leave Direction on **Into building**.
2. Under **To**: set Yes on the barns and factories to fill.
2. Under **To**: set Yes on the barns and factories to fill. The list also shows silos that can only
be filled and not emptied, such as the Pumps & Hoses drive-on bunkers (DOB 115) that feed a biogas
fermenter. For those, **Select** with the goods the fermenter needs works best.
3. Under **Goods**: choose **Auto** or **Select**.
- **Auto** fetches everything the building accepts. For factories, that is the inputs of the
productions that are switched on.
+14
View File
@@ -135,5 +135,19 @@ check("B6 naturlig sortering", ADBuildings.naturalLess("Silo 9", "Silo 10"), tru
check("B6 naturlig sortering, tal før tekst-lighed", ADBuildings.naturalLess("25 Silo Storage", "26 Silo Storage"), true)
check("B6 naturlig sortering ens navn -> markørnavn", ADBuildings.compare({name = "Farma", loadMarkers = {{name = "30 Silo"}}}, {name = "Farma", loadMarkers = {{name = "4 Silo"}}}), false)
-- B-DOB: silo der kun kan FYLDES (drive-on-bunker ved biogas: aflæsning, ingen læssestation) = mål, ikke kilde
do
local dob = placeable("dob1", "DOB 115", 5000, 0, {spec_silo = {}})
table.insert(unloadStations, {owningPlaceable = dob, unloadTriggers = {{exactFillRootNode = {x = 5000, z = 5}}}})
addMarker(21, "Biogas Drop 1", "Biogas", 5000, 12)
ADBuildings.invalidate()
local byIdDob = {}
for _, b in ipairs(ADBuildings.list(adEnv, 1)) do byIdDob[b.id] = b end
check("B-DOB kan være mål", byIdDob.dob1.canBeTarget, true)
check("B-DOB ikke kilde (intet at hente)", byIdDob.dob1.canBeSource, false)
check("B-DOB aflæsningsmarkør", byIdDob.dob1.unloadMarker.id, 21)
check("B-DOB almindelig silo stadig ikke mål", byIdDob.silo1.canBeTarget, false)
end
print(failures == 0 and "\nALLE TESTS OK" or ("\n" .. failures .. " FEJL"))
os.exit(failures == 0 and 0 or 1)