Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into ChopperSupport
Browse files Browse the repository at this point in the history
  • Loading branch information
pops64 committed Sep 21, 2023
2 parents 98a6f90 + f661488 commit d05abc4
Show file tree
Hide file tree
Showing 88 changed files with 4,110 additions and 728 deletions.
38 changes: 22 additions & 16 deletions Courseplay.lua
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ end
function Courseplay.drawHudMap(map)
if g_Courseplay.globalSettings.drawOntoTheHudMap:getValue() then
local vehicle = g_currentMission.controlledVehicle
if vehicle and vehicle:getIsEntered() and not g_gui:getIsGuiVisible() and vehicle.spec_courseplaySpec and not vehicle.spec_locomotive then
if vehicle and vehicle:getIsEntered() and not g_gui:getIsGuiVisible() and vehicle.spec_cpAIWorker and not vehicle.spec_locomotive then
SpecializationUtil.raiseEvent(vehicle, "onCpDrawHudMap", map)
end
end
Expand Down Expand Up @@ -192,14 +192,28 @@ end
FSCareerMissionInfo.saveToXMLFile = Utils.prependedFunction(FSCareerMissionInfo.saveToXMLFile, Courseplay.saveToXMLFile)

function Courseplay:update(dt)
g_devHelper:update()
g_bunkerSiloManager:update(dt)
g_devHelper:update()
g_bunkerSiloManager:update(dt)
g_triggerManager:update(dt)
if not self.postInit then
-- Doubles the map zoom for 4x Maps. Mainly to make it easier to set targets for unload triggers.
self.postInit = true
local function setIngameMapFix(mapElement)
local factor = 2*mapElement.terrainSize/2048
mapElement.zoomMax = mapElement.zoomMax * factor
mapElement.zoomDefault = mapElement.zoomDefault * factor
mapElement.mapZoom = mapElement.zoomDefault
end
setIngameMapFix(g_currentMission.inGameMenu.pageAI.ingameMap)
setIngameMapFix(g_currentMission.inGameMenu.pageMapOverview.ingameMap)
end
end

function Courseplay:draw()
if not g_gui:getIsGuiVisible() then
g_vineScanner:draw()
g_bunkerSiloManager:draw()
g_triggerManager:draw()
end
g_devHelper:draw()
CpDebug:draw()
Expand Down Expand Up @@ -323,27 +337,19 @@ end
function Courseplay.register(typeManager)
--- TODO: make this function async.
for typeName, typeEntry in pairs(typeManager.types) do
if CourseplaySpec.prerequisitesPresent(typeEntry.specializations) then
typeManager:addSpecialization(typeName, Courseplay.MOD_NAME .. ".courseplaySpec")
end
if CpVehicleSettings.prerequisitesPresent(typeEntry.specializations) then
typeManager:addSpecialization(typeName, Courseplay.MOD_NAME .. ".cpVehicleSettings")
end
if CpCourseGeneratorSettings.prerequisitesPresent(typeEntry.specializations) then
typeManager:addSpecialization(typeName, Courseplay.MOD_NAME .. ".cpCourseGeneratorSettings")
end
if CpCourseManager.prerequisitesPresent(typeEntry.specializations) then
typeManager:addSpecialization(typeName, Courseplay.MOD_NAME .. ".cpCourseManager")
end
CpAIWorker.register(typeManager, typeName, typeEntry.specializations)
CpVehicleSettings.register(typeManager, typeName, typeEntry.specializations)
CpCourseGeneratorSettings.register(typeManager, typeName, typeEntry.specializations)
CpCourseManager.register(typeManager, typeName, typeEntry.specializations)
CpAIFieldWorker.register(typeManager, typeName, typeEntry.specializations)
CpAIBaleFinder.register(typeManager, typeName, typeEntry.specializations)
CpAICombineUnloader.register(typeManager, typeName, typeEntry.specializations)
CpAIBunkerSiloWorker.register(typeManager, typeName, typeEntry.specializations)
CpAISiloLoaderWorker.register(typeManager, typeName, typeEntry.specializations)
CpAIBunkerSiloWorker.register(typeManager, typeName, typeEntry.specializations)
CpGamePadHud.register(typeManager, typeName,typeEntry.specializations)
CpHud.register(typeManager, typeName, typeEntry.specializations)
CpInfoTexts.register(typeManager, typeName, typeEntry.specializations)
CpShovelPositions.register(typeManager, typeName, typeEntry.specializations)
end
end
TypeManager.finalizeTypes = Utils.prependedFunction(TypeManager.finalizeTypes, Courseplay.register)
Expand Down
37 changes: 26 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,32 @@ You can download [here](https://github.com/pops64/Courseplay_FS22/releases/lates

* Chopper Support
* **Multiplayer support**
* Fieldwork and vine work with courses from the course generator.
* Course manager for saving/loading/renaming/moving and deleting of courses.
* Wrapping and collecting of bales with or without a course.
* Unloading of combines with unloaders.
* Creating heaps of sugar beets or other fruits on the field with the combine unloader.
* Unloading silo loaders, like the ``ROPA Maus`` and letting AD or Giants unload the trailer after that.
* Compacting of a bunker silo or pushing the chaff into the back of a silo.
* Let the combine unload into nearby trailers (combine self unload).
* Field work with up to 5 vehicles on the same course (multi tool course).
* Creating custom fields by recording a course or drawing on the AI Map.
* Course editor to edit fieldwork courses or custom field borders.
* Fieldwork mode:
* Course generator for complex fields with many option like headlands or beets with combines and so on ..
* Up to 5 workers with the same tools can work together on a field with the same course (multi tools)
* Generate courses for vine work
* Save/load/rename/move courses
* Load courses for baling, straw or grass collection and so on
* Combines can automatically unload into nearby trailers (combine self unload)
* Bale collector mode:
* Wrapping bales on a field without a course
* Collecting bales on the field without a course and unloading them with [AutoDrive](https://github.com/Stephan-S/FS22_AutoDrive)
* Combine unloader mode:
* Unload combines on the field
* Sending the giants helper or [AutoDrive](https://github.com/Stephan-S/FS22_AutoDrive) to unload at an unload station
* Creating heaps of sugar beets or other fruits on the field
* Unloading a loader vehicle, like the ``ROPA Maus`` and letting [AutoDrive](https://github.com/Stephan-S/FS22_AutoDrive) or Giants unload the trailer after that
* Silo load mode:
* Loading from a heap or bunker silo with loader, like the ``ROPA Maus``
* Using a wheel loader or a front loader to load from a heap or a bunker silo and unload to:
* Unloading to nearby trailers
* Unloading to an unloading station, which needs to be selected on the AI menu
* Bunker silo mode:
* Compacting the silo with or without tools like this one [Silo distributor](https://www.farming-simulator.com/mod.php?lang=de&country=de&mod_id=242708&title=fs2022)
* Using a shield in a silo with a back wall to push the chaff to the back of silo
* Misc:
* Creating custom fields by recording the boarder with a vehicle or drawing on the AI Map.
* Course editor in the buy menu to edit courses or custom fields.
* Mod support with [AutoDrive](https://github.com/Stephan-S/FS22_AutoDrive):
* Sending the fieldwork driver to refill seeds/fertilizers and so on.
* Sending the fieldworker/ bale collector to unload collected straw and so on.
Expand Down
16 changes: 16 additions & 0 deletions config/HelpMenu.xml
Original file line number Diff line number Diff line change
Expand Up @@ -222,5 +222,21 @@
<text text="$l10n_CP_help_page_siloLoaderBasic_text"/>
</paragraph>
</page>
<!--Courseplay Shovel Loader Driver-->
<page title="$l10n_CP_help_page_shovelLoader_title">
<paragraph>
<text text="$l10n_CP_help_page_shovelLoaderGeneral_text"/>
</paragraph>
<paragraph>
<text text="$l10n_CP_help_page_shovelLoaderBasic_text"/>
</paragraph>
<paragraph>
<text text="$l10n_CP_help_page_shovelLoaderTrigger_text"/>
<image filename="img/helpmenu/shovelloadertrigger.dds" size="1024 1024" uvs="0px 0px 830px 610px"/>
</paragraph>
<!--<paragraph>
<text text="$l10n_CP_help_page_shovelLoaderTpsExtension_text"/>
</paragraph>-->
</page>
</category>
</helpLines>
120 changes: 117 additions & 3 deletions config/MasterTranslations.xml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@
<Text language="de"><![CDATA[Keinen Haufen gefunden.]]></Text>
<Text language="en"><![CDATA[No heap found.]]></Text>
</Translation>
<Translation name="CP_error_no_unload_trigger_found">
<Text language="de"><![CDATA[Keinen Abladepunkt gefunden.]]></Text>
<Text language="en"><![CDATA[No unloading point found.]]></Text>
</Translation>
</Category>
<Category name="AI job parameters">
<Translation name="CP_jobParameters_fieldPosition_title">
Expand Down Expand Up @@ -302,9 +306,21 @@
<Text language="en"><![CDATA[Loading position]]></Text>
</Translation>
<Translation name="CP_siloLoader_fillLevelProgress">
<Text language="de"><![CDATA[Fortschritt: ]]></Text>
<Text language="en"><![CDATA[Progress: ]]></Text>
</Translation>
<Text language="de"><![CDATA[Liter übrig: ]]></Text>
<Text language="en"><![CDATA[Liters left: ]]></Text>
</Translation>
<Translation name="CP_siloLoaderJobParameters_subTitle_unloading">
<Text language="de"><![CDATA[Abladen in:]]></Text>
<Text language="en"><![CDATA[Unloading at:]]></Text>
</Translation>
<Translation name="CP_siloLoaderJobParameters_unloadAt_trailer">
<Text language="de"><![CDATA[Anhänger]]></Text>
<Text language="en"><![CDATA[Trailer]]></Text>
</Translation>
<Translation name="CP_siloLoaderJobParameters_unloadAt_unloadTrigger">
<Text language="de"><![CDATA[Abladestation]]></Text>
<Text language="en"><![CDATA[Unload station]]></Text>
</Translation>
</Category>
<Category name="AI jobs">
<Translation name="CP_job_fieldWork">
Expand Down Expand Up @@ -601,6 +617,14 @@
<Text language="de"><![CDATA[Arbeitsbreite. Wert: 0 - 50]]></Text>
<Text language="en"><![CDATA[Work width. Value: 0 - 50]]></Text>
</Translation>
<Translation name="CP_vehicle_setting_loadingShovelHeightOffset_title">
<Text language="de"><![CDATA[Versatz Schaufelhöhe.]]></Text>
<Text language="en"><![CDATA[Shovel hight offset.]]></Text>
</Translation>
<Translation name="CP_vehicle_setting_loadingShovelHeightOffset_tooltip">
<Text language="de"><![CDATA[Höhenversatz der Schaufel für die Ladeposition. Wert: -1 - 1]]></Text>
<Text language="en"><![CDATA[Offset for the shovel loading position. Value: -1 - 1]]></Text>
</Translation>
</Category>
<Category name="Vehicle settings speed">
<Translation name="CP_vehicle_setting_fieldWorkSpeed_title">
Expand Down Expand Up @@ -2476,6 +2500,96 @@ The marker detects heaps or silos and highlights them on the map.
Now it's possible to start the helper.
]]></Text>
</Translation>
<Translation name="CP_help_page_shovelLoader_title">
<Text language="de"><![CDATA[Radlader/Frontlader]]></Text>
<Text language="en"><![CDATA[Wheel loader/Front loader]]></Text>
</Translation>
<Translation name="CP_help_page_shovelLoaderGeneral_text">
<Text language="de"><![CDATA[
Mit einem Radlader oder Traktor mit Frontlader und Schaufel lassen sich Haufen vom Boden oder aus einem Bunker Silo automatisch aufnehmen und in einen Anhänger oder Lager abladen.
Die Schaufel wird dabei automatisch an die richtigen Positionen gefahren.
Ist der Modus im HUD nicht direkt zu sehen, schalte die "Startposition" durch bis der Modus erscheint.
Im HUD erscheint dann das gewohnte Ziel Icon um direkt mit dem richtigen Modus auf der Helfer Karte zu landen.
Es gibt eine Anzeige, die die verbleibenden Füllmenge des Haufens anzeigt.
Die Arbeitsbreite muss im HUD eventuell angepasst werden, wenn ihr ein Bunker Silo leeren möchtet, um nicht seitlich in die Wand zu fahren.
Der Versatz der Schaufelhöhe dient dazu, die Höhe über dem Boden anzupassen. Diese Höhe sollte relativ genau sein, damit auch alles eingesammelt wird
oder damit der Radlader nicht an Kanten fest hängt. Wird der Wert verändert, fährt die Schaufel automatisch auf die Position und die eingestellte Höhe.
Ein Klick auf den Text, setzt den Wert auf 0 zurück. Der Wert lässt sich zwischen +1 bis -1 anpassen.
Schaufeln mit Gebiss öffnen dieses automatisch beim laden und abladen und schließen dieses zum Transport.
Die Schaufel zum Zerkleinern von Zuckerrüben wird mit allen Funktionen unterstützt.
]]></Text>
<Text language="en"><![CDATA[
This mode enables wheel loader and tractors with a front loader.
With a shovel attached a heap can be picked up from the ground or loading from a bunker silo can be accomplished.
The picked up fill level can be unloaded automatically into a nearby trailer or a selected unloading station like a BGA.
The shovel will automatically be moved to the correct positions for loading, unloading and so on.
In case the mode is not directly visable on the hud, you can toggle the "start position" until the shovel mode appears.
The target icon on the hud can be used to open the AI map to select the loading and the unloading targets.
The hud also shows the leftover fill level of the heap or silo, while the helper is working.
If the loading target is a bunker silo, then the work width might need to be adjusted to avoid hitting the side walls of the silo.
The hight offset setting is used to adjust the hight above the ground, as not all shovel can calculated correctly.
This should be checked, if the shovel is to low for loading and the driver can't turn anymore or the shovel is to high and fill level is missed to the ground.
If the value gets changed, the shovel will automatically move to the loading position to show the impact of the offset.
To reset the offset you need to click on the settings text in the hud. The value can be adjusted from +1 to -1 in 0.1 setps.
Shovels with a silage grab will open and close automatically for loading and unloading.
The shovel to shred sugar beets is completly functional as well.
]]></Text>
</Translation>
<Translation name="CP_help_page_shovelLoaderBasic_text">
<Text language="de"><![CDATA[
Um einen Radlader Fahrer zu starten, müssen zunächst über das Ziel Icon im HUD die Lade- und Entladepositionen gewählt werden.
Die Ladeposition wird wie auch bereits beim Lader gewählt. Ein blauer Ramen entsteht um den gefunden Haufen.
Die Abladeposition hängt davon ab, ob du in einen Anhänger oder in eine Abladestation entladen möchtest.
Abladen in einen Anhänger funktioniert automatisch und braucht keine zusätzliche Position.
Es wird der naheste, stehende Anhänger gewählt und seitlich angefahren.
Möchtest du in eine Abladestation entladen, muss zunächst das Ziel umgestellt werden und anschließend der Marker auf den Trigger gesetzt werden.
]]></Text>
<Text language="en"><![CDATA[
To start a wheel loader helper, you need to set the load and unload positions by clicking the target icon on the hud.
The loading position works the same like the one from the loader mode. A blue square will be created arround the heap.
The unloading position depends if you want to unload into a trailer or into an unloading station.
Unloading into a trailer works automatically and doesn't need a dedicated unload position. The driver will check for the nearest standing trailer and unloads to it from the side.
If you want to unload into an unloading station, you need to switch the target and then mark the trigger with the unloading position.
]]></Text>
</Translation>
<Translation name="CP_help_page_shovelLoaderTrigger_text">
<Text language="de"><![CDATA[
Die Auswahl eines Triggers wirkt zunächst kompliziert, ist aber im Prinzip recht einfach.
Da Gebäude mehrere Trigger haben können, muss dieser selber gewählt werden.
Die verfügbaren Trigger werden als orangene Kreuze da gestellt.
Um einen Trigger zu wählen, setzt du den Punkt in der Mitte des runden Icons einfach mittig auf das Kreuz.
Die Richtung des Pfeils entspricht hierbei die Anfahrtsrichtung vom Helfer.
Das Kreuz sollte jetzt, wie im Bild da gestellt, gelb sein.
]]></Text>
<Text language="en"><![CDATA[
Selecting a trigger does look a bit complicated at first, but in reality it is really easy.
Every building can have more then one trigger so you have to choose the one you want to unload to.
All available triggers will be shown with an orange cross on the AI Map.
To select one place the middle of the round marker on the middle of the cross.
The driection of the arrow tells the helper from which direction he will approach the trigger for unloading.
Now your selection should look similar to the image.
]]></Text>
</Translation>
<!--
<Translation name="CP_help_page_shovelLoaderTpsExtension_text">
<Text language="de"><![CDATA[
TPS extension
]]></Text>
<Text language="en"><![CDATA[
TPS extension
]]></Text>
</Translation>
-->

</Category>
<Category name="Input bindings">
Expand Down
Loading

0 comments on commit d05abc4

Please sign in to comment.