Skip to content

Commit

Permalink
v1.2.8.9
Browse files Browse the repository at this point in the history
- adjustable field completion factor (#240)
- compatibility with FS22_Through_The_Years (#238)
  • Loading branch information
Mmtrx committed Aug 25, 2024
1 parent f0ee646 commit 9a5f95f
Show file tree
Hide file tree
Showing 19 changed files with 411 additions and 8 deletions.
17 changes: 13 additions & 4 deletions betterContracts.lua
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
-- new setting "hardLimit": limit jobs per farm and month (#168)
-- new setting "multRewardMow" for baling contracts (#199)
-- v1.2.8.8 08.07.2024 compatibility with FS22_KommunalServices (#233)
-- v1.2.8.9 12.08.2024 AbstractMission.SUCCESS_FACTOR adjustable
--=======================================================================================================
SC = {
FERTILIZER = 1, -- prices index
Expand Down Expand Up @@ -225,6 +226,8 @@ function registerXML(self)
self.xmlSchema:register(XMLValueType.FLOAT, self.baseXmlKey.."#rewardMow")
self.xmlSchema:register(XMLValueType.FLOAT, self.baseXmlKey.."#lease")
self.xmlSchema:register(XMLValueType.FLOAT, self.baseXmlKey.."#deliver")
self.xmlSchema:register(XMLValueType.FLOAT, self.baseXmlKey.."#deliverBale")
self.xmlSchema:register(XMLValueType.FLOAT, self.baseXmlKey.."#fieldCompletion")

local key = self.baseXmlKey..".lazyNPC"
self.xmlSchema:register(XMLValueType.BOOL, key.."#harvest")
Expand Down Expand Up @@ -265,7 +268,8 @@ function readconfig(self)
self.config.multRewardMow = xmlFile:getValue(key.."#rewardMow", 1.)
self.config.multLease = xmlFile:getValue(key.."#lease", 1.)
self.config.toDeliver = xmlFile:getValue(key.."#deliver", 0.94)
self.config.toDeliverBale = xmlFile:getValue(key.."#deliver", 0.90)
self.config.toDeliverBale = xmlFile:getValue(key.."#deliverBale", 0.90)
self.config.fieldCompletion = xmlFile:getValue(key.."#fieldCompletion", 0.95)
self.config.refreshMP = xmlFile:getValue(key.."#refreshMP", 2)
self.config.lazyNPC = xmlFile:getValue(key.."#lazyNPC", false)
self.config.hardMode = xmlFile:getValue(key.."#hard", false)
Expand Down Expand Up @@ -449,7 +453,8 @@ function BetterContracts:initialize()
multRewardMow = 1., -- mow reward multiplier
multLease = 1., -- general lease cost multiplier
toDeliver = 0.94, -- HarvestMission.SUCCESS_FACTOR
toDeliverBale = 0.90, -- BaleMission.SUCCESS_FACTOR
toDeliverBale = 0.90, -- BaleMission.FILL_SUCCESS_FACTOR
fieldCompletion = 0.95, -- AbstractMission.SUCCESS_FACTOR
generationInterval = 1, -- MissionManager.MISSION_GENERATION_INTERVAL
missionGenPercentage = 0.2, -- percent of missions to be generated (default: 20%)
refreshMP = SC.ADMIN, -- necessary permission to refresh contract list (MP)
Expand Down Expand Up @@ -547,7 +552,10 @@ function BetterContracts:initialize()
Utility.appendedFunction(Farm,"readStream",farmRead)
Utility.overwrittenFunction(FarmlandManager, "saveToXMLFile", farmlandManagerSaveToXMLFile)

-- to adjust contracts reward / vehicle lease values:
-- to adjust contracts field compl / reward / vehicle lease values:
Utility.overwrittenFunction(AbstractFieldMission,"getCompletion",getCompletion)
Utility.overwrittenFunction(HarvestMission,"getCompletion",harvestCompletion)
Utility.overwrittenFunction(BaleMission,"getCompletion",baleCompletion)
Utility.overwrittenFunction(AbstractFieldMission,"getReward",getReward)
Utility.overwrittenFunction(AbstractFieldMission,"calculateVehicleUseCost",calcLeaseCost)

Expand Down Expand Up @@ -650,7 +658,7 @@ function BetterContracts:onPostLoadMap(mapNode, mapFile)
addConsoleCommand("gsMissionHarvestField", "Harvest a field and print the liters", "consoleHarvestField", g_missionManager)
addConsoleCommand("gsMissionTestHarvests", "Run an expansive tests for harvest missions", "consoleHarvestTests", g_missionManager)
end
-- init Harvest SUCCESS_FACTORs (std is harv = .93, bale = .9)
-- init Harvest SUCCESS_FACTORs (std is harv = .93, bale = .9, abstract = .95)
HarvestMission.SUCCESS_FACTOR = self.config.toDeliver
BaleMission.FILL_SUCCESS_FACTOR = self.config.toDeliverBale

Expand Down Expand Up @@ -723,6 +731,7 @@ function BetterContracts:onPostSaveSavegame(saveDir, savegameIndex)
xmlFile:setFloat( key.."#lease", conf.multLease)
xmlFile:setFloat( key.."#deliver", conf.toDeliver)
xmlFile:setFloat( key.."#deliverBale", conf.toDeliverBale)
xmlFile:setFloat( key.."#fieldCompletion",conf.fieldCompletion)
xmlFile:setInt ( key.."#refreshMP", conf.refreshMP)
xmlFile:setBool ( key.."#lazyNPC", conf.lazyNPC)
xmlFile:setBool ( key.."#discount", conf.discountMode)
Expand Down
Binary file added icon_BetterContracts.dds
Binary file not shown.
2 changes: 2 additions & 0 deletions l10n/l10n_br.xml
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@
<text name="bc_toDeliver" text="Entrega em contratos de colheita" />
<text name="bc_toDeliverBale" text="Entrega para contratos de enfardamento" />
<text name="bc_toDeliver_tooltip" text="Porcentagem do rendimento total estimado que você deve entregar para completar um contrato de colheita." />
<text name="bc_fieldCompletion" text="Fieldwork complete" />
<text name="bc_fieldCompletion_tooltip" text="Min percentage of field area worked, to count as fieldwork complete." />

<text name="bc_missionGeneration" text="Geração de contratos" />
<text name="bc_generationInterval" text="Intervalo de Geração" />
Expand Down
2 changes: 2 additions & 0 deletions l10n/l10n_cs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@
<text name="bc_toDeliver" text="收割合同交付" />
<text name="bc_toDeliverBale" text="打包合同交付" />
<text name="bc_toDeliver_tooltip" text="完成收割合同必须交付的估计总产量的百分比。" />
<text name="bc_fieldCompletion" text="Fieldwork complete" />
<text name="bc_fieldCompletion_tooltip" text="Min percentage of field area worked, to count as fieldwork complete." />

<text name="bc_missionGeneration" text="生成合同" />
<text name="bc_generationInterval" text="生成合同的间隔" />
Expand Down
2 changes: 2 additions & 0 deletions l10n/l10n_cz.xml
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@
<text name="bc_toDeliver" text="Procenta doručení ze sklizně" />
<text name="bc_toDeliverBale" text="Doručení pro zakázky na balíkování" />
<text name="bc_toDeliver_tooltip" text="Procento odhadovaného celkového výnosu, které musíte dodat, abyste dokončili smlouvu o sklizni." />
<text name="bc_fieldCompletion" text="Fieldwork complete" />
<text name="bc_fieldCompletion_tooltip" text="Min percentage of field area worked, to count as fieldwork complete." />

<text name="bc_missionGeneration" text="Generování zakázek" />
<text name="bc_generationInterval" text="Interval generování" />
Expand Down
2 changes: 2 additions & 0 deletions l10n/l10n_da.xml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@
<text name="bc_discPerJob_tooltip" text="En NPC-landmand øger deres rabat med dette beløb pr. udført job. Maksimal rabat må ikke overstige 50 %." />
<text name="bc_discMaxJobs" text="Antal rabat-effektive job" />
<text name="bc_discMaxJobs_tooltip" text="Kan reducere max rabat, f.eks. rabat pr. kontrakt = 11%, antal job = 3 -> max rabat = 33%. Forsigtig: Det nuværende antal fuldførte job vil falde med denne værdi ved køb af landbrugsjord." />
<text name="bc_fieldCompletion" text="Fieldwork complete" />
<text name="bc_fieldCompletion_tooltip" text="Min percentage of field area worked, to count as fieldwork complete." />

<text name="bc_missionGeneration" text="Kontrakt generering" />
<text name="bc_generationInterval" text="Generation Interval" />
Expand Down
2 changes: 2 additions & 0 deletions l10n/l10n_de.xml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@
<text name="bc_toDeliver" text="Lieferanteil Ernteverträge" />
<text name="bc_toDeliverBale" text="Lieferanteil Ballenverträge" />
<text name="bc_toDeliver_tooltip" text="Pozentsatz des theoretisch möglichen Ertrags, der zur Erfüllung eines Erntevertrags abgeliefert werden muss." />
<text name="bc_fieldCompletion" text="Feldbearbeitung abgeschlossen" />
<text name="bc_fieldCompletion_tooltip" text="Pozentsatz der Feldfläche, ab dem das Feld als komplett bearbeitet zählt." />
<text name="bc_refreshMP" text="Berechtigung Vertragsliste" />
<text name="bc_refreshMP_tooltip" text="Wer in einem MP-Spiel Verträge löschen/ erzeugen darf" />
<text name="bc_ferment" text="Insta-Gären" />
Expand Down
2 changes: 2 additions & 0 deletions l10n/l10n_en.xml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@
<text name="bc_toDeliver" text="Delivery on harvest contracts" />
<text name="bc_toDeliverBale" text="Delivery for baling contracts" />
<text name="bc_toDeliver_tooltip" text="Percentage of the estimated total yield you must deliver to complete a harvest contract." />
<text name="bc_fieldCompletion" text="Fieldwork complete" />
<text name="bc_fieldCompletion_tooltip" text="Min percentage of field area worked, to count as fieldwork complete." />
<text name="bc_refreshMP" text="Permission contracts list" />
<text name="bc_refreshMP_tooltip" text="Who can delete / refresh contracts in an MP game." />
<text name="bc_ferment" text="Insta-Fermenting" />
Expand Down
2 changes: 2 additions & 0 deletions l10n/l10n_fr.xml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@
<text name="bc_toDeliver" text="Delivery on harvest contracts" />
<text name="bc_toDeliverBale" text="Delivery for baling contracts" />
<text name="bc_toDeliver_tooltip" text="Percentage of the estimated total yield you must deliver to complete a harvest contract." />
<text name="bc_fieldCompletion" text="Fieldwork complete" />
<text name="bc_fieldCompletion_tooltip" text="Min percentage of field area worked, to count as fieldwork complete." />

<text name="bc_missionGeneration" text="Contract generation" />
<text name="bc_generationInterval" text="Generation Interval" />
Expand Down
2 changes: 2 additions & 0 deletions l10n/l10n_it.xml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@
<text name="bc_toDeliver" text="Delivery on harvest contracts" />
<text name="bc_toDeliverBale" text="Delivery for baling contracts" />
<text name="bc_toDeliver_tooltip" text="Percentage of the estimated total yield you must deliver to complete a harvest contract." />
<text name="bc_fieldCompletion" text="Fieldwork complete" />
<text name="bc_fieldCompletion_tooltip" text="Min percentage of field area worked, to count as fieldwork complete." />

<text name="bc_missionGeneration" text="Contract generation" />
<text name="bc_generationInterval" text="Generation Interval" />
Expand Down
2 changes: 2 additions & 0 deletions l10n/l10n_jp.xml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@
<text name="bc_toDeliver" text="Delivery on harvest contracts" />
<text name="bc_toDeliverBale" text="Delivery for baling contracts" />
<text name="bc_toDeliver_tooltip" text="Percentage of the estimated total yield you must deliver to complete a harvest contract." />
<text name="bc_fieldCompletion" text="Fieldwork complete" />
<text name="bc_fieldCompletion_tooltip" text="Min percentage of field area worked, to count as fieldwork complete." />

<text name="bc_missionGeneration" text="Contract generation" />
<text name="bc_generationInterval" text="Generation Interval" />
Expand Down
2 changes: 2 additions & 0 deletions l10n/l10n_pl.xml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@
<text name="bc_toDeliver" text="Dostawa przy umowach o zbiór" />
<text name="bc_toDeliverBale" text="Dostawa przy umowach związanych z belowaniem" />
<text name="bc_toDeliver_tooltip" text="Procent oszacowanego całkowitego plonu, który musisz dostarczyć, aby zakończyć umowę na zbiór." />
<text name="bc_fieldCompletion" text="Fieldwork complete" />
<text name="bc_fieldCompletion_tooltip" text="Min percentage of field area worked, to count as fieldwork complete." />

<text name="bc_missionGeneration" text="Generowanie umów" />
<text name="bc_generationInterval" text="Interwał generacji" />
Expand Down
2 changes: 2 additions & 0 deletions l10n/l10n_ru.xml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@
<text name="bc_toDeliver" text="Доставка по контрактам на сбор урожая" />
<text name="bc_toDeliverBale" text="Доставка по контрактам на тюкование" />
<text name="bc_toDeliver_tooltip" text="Процент от расчётного общего урожая, который вы должны доставить, чтобы выполнить контракт на сбор урожая." />
<text name="bc_fieldCompletion" text="Fieldwork complete" />
<text name="bc_fieldCompletion_tooltip" text="Min percentage of field area worked, to count as fieldwork complete." />
<text name="bc_refreshMP" text="Управляющий контрактами в МП" />
<text name="bc_refreshMP_tooltip" text="Кто может удалять/обновлять контракты в сетевой игре." />
<text name="bc_ferment" text="Мгновенная ферментация" />
Expand Down
163 changes: 163 additions & 0 deletions missionVehicles/1950.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
---------------- 1950 - 1959 -------------------------------------
<!-- tractor -->
McCormick
<vehicle filename="EYM_McCormickW4.xml" requiredMod="FS22_mcCormickW4"> <!-- tractor -->
<configuration name="motor" id="2" />
</vehicle>
Rotselmash
<vehicle filename="DT75_kazahstan.xml" requiredMod="FS22_Kazahstan"> <!-- tractor -->
<configuration name="design" id="2" />
</vehicle>
JohnDeere A
<vehicle filename="JD_EYM_A.xml" requiredMod="FS22_JohnDeereA"> <!-- tractor -->
<configuration name="wheel" id="4"/>
<configuration name="attacherJoint" id="4"/>
</vehicle>
Farmall
<vehicle filename="farmall460n560.xml" requiredMod="FS22_Farmall_460_560"> <!-- tractor -->
<configuration name="design" id="7"/>
<configuration name="motor" id="5"/>
</vehicle>
MicroTractor
<vehicle filename="Xml/TobataCabra.xml" requiredMod="FS22_Micro_Tractor_Sprayer_Package">
<configuration name="motor" id="2"/>
<configuration name="design" id="2"/>
</vehicle>
<!- trailers _______________________________________________
Lizard 4T
<vehicle filename="lizard4t.xml" requiredMod="FS22_Lizard4T_crossplay"> <!-- trailer -->
<configuration name="inputAttacherJoint" id="2"/>
<configuration name="fillUnit" id="2"/>
<configuration name="fillVolume" id="2"/>
<configuration name="trailer" id="2"/>
</vehicle>
Wooden
<vehicle filename="Woz.xml" requiredMod="FS22_WoodenTrailer">
<configuration name="fillVolume" id="2"/>
<configuration name="trailer" id="2"/>
<configuration name="fillUnit" id="2"/>
</vehicle>
<!- plows _______________________________________________
Unia PZ525
<vehicle filename="Pz525.xml" requiredMod="FS22_Unia_PZ_pack">
<configuration name="vehicleType" id="3"/>
</vehicle>
Lemken D24
<vehicle filename="Lemken.xml" requiredMod="FS22_Lemken_d24">
<configuration name="baseMaterial" id="79"/>
</vehicle>
<!- cultivators______________________________________________
Lizard Egge
<vehicle filename="brony.xml" requiredMod="FS22_lizardHarrows5">
<configuration name="design" id="2"/>
<configuration name="design2" id="2"/>
</vehicle>
Sam 3m
<vehicle filename="sam.xml" requiredMod="FS22_Sam3M"/>
International
<vehicle filename="i37.xml" requiredMod="FS22_International_37"/>
Fortschritt
<vehicle filename="Fortschritt_B391_cu.xml" requiredMod="FS22_Fortschritt_T890_Pack">
<configuration name="design" id="2"/>
</vehicle>
<!- seeders _________________________________________________
Isaria
<vehicle filename="Isaria6000S.xml" requiredMod="FS22_Isaria6000S"/>

Lzard TR500
<vehicle filename="DistribuidorDeSementes.xml" requiredMod="FS22_LizardTR500"/>

Micro
<vehicle filename="Xml/DistribuidorDeSementes.xml" requiredMod="FS22_Micro_Tractor_Sprayer_Package"/>

<!- planter _________________________________________________
Cyclo
<vehicle filename="IH800CycloEYM.xml" requiredMod="FS22_IH_CycloEYM800_4Row"/>

<!- fertilizer _________________________________________________
Kos
<vehicle filename="N015.xml" requiredMod="FS22_KOS_N015"/>
Lizard
<vehicle filename="Lizard330.xml" requiredMod="FS22_Lizard_Spreader"/>
Gülle
<vehicle filename="zjv_manure.xml" requiredMod="FS22_zjv"/>
Miststreuer
<vehicle filename="N235.xml" requiredMod="FS22_FMR_N235">
<configuration name="vehicleType" id="4"/>
<configuration name="powerConsumer" id="2"/>
<configuration name="trailer" id="3"/>
<configuration name="inputAttacherJoint" id="2"/>
<configuration name="fillVolume" id="4"/>
<configuration name="fillUnit" id="2"/>
</vehicle>
<!- striegel _________________________________________________
Fortschritt
<vehicle filename="Fortschritt_B391.xml" requiredMod="FS22_Fortschritt_T890_Pack"> <!-- weeder -->
<configuration name="design" id="2"/>
<configuration name="baseMaterial" id="3"/>
</vehicle>
Betonwalze
<vehicle filename="cr290.xml" requiredMod="FS22_concreteRolls"/>

<!- sprayer _________________________________________________
JD 250
<vehicle filename="johnDeere250_sprayer.xml" requiredMod="FS22_JohnDeere_250_Sprayer">
<configuration name="design" id="2"/>
<configuration name="baseMaterial" id="3"/>
</vehicle>
<!- roller _________________________________________________
LH5 schwere Wiesenwalze
<vehicle filename="xml/LVH5.xml" requiredMod="FS22_LizardLVrollers">
<configuration name="baseMaterial" id="5"/>
<configuration name="designMaterial" id="46"/>
<configuration name="folding" id="2"/>
<configuration name="design" id="4"/>
</vehicle>
Lizard
<vehicle filename="Lizard_RingRoller_4000_Old.xml" requiredMod="FS22_Lizard_RingRoller_pack"/>

<!- combine _________________________________________________
Vistula
<vehicle filename="kzb3.xml" requiredMod="FS22_Vistula_KZB3"/>
Cotton
<vehicle filename="$data/vehicles/lizard/module4/module4.xml"/>
<vehicle filename="$data/vehicles/johnDeere/cp690/cp690.xml"/>

<!- mower _________________________________________________
Lizard front
<vehicle filename="xml/Front_Hydraulisch.xml" requiredMod="FS22_Lizard_CuttingBars"/> <!-- mower -->
Lizard heck
<vehicle filename="xml/Heck_Butterfly.xml" requiredMod="FS22_Lizard_CuttingBars"/>
Fiore
<vehicle filename="FBR_FIORE.xml" requiredMod="FS22_Fbr_Fiore_console">
<configuration name="folding" id="4"/>
</vehicle>

<!- wender/schwad _________________________________________________
Vermeer
<vehicle filename="td190.xml" requiredMod="FS22_LEM_TD100"/>
Schwader
<vehicle filename="zgrabiarka_5.xml" requiredMod="FS22_lizardWindrower"/>
Ladewagen
<vehicle filename="T072.xml" requiredMod="FS22_Lizard_T072"/>

<!- Baler _________________________________________________
Mascar
<vehicle filename="Mascar2120.xml" requiredMod="FS22_Mascar2120"/>
<vehicle filename="przyczepa.xml" requiredMod="FS22_homemadeTrailer">
<configuration name="design2" id="2"/>
</vehicle>
<vehicle filename="elhoJM2.xml" requiredMod="FS22_ElhoJM2"/>
Wickler
<vehicle filename="$data/vehicles/kuhn/sw4014/sw4014.xml"/>
Lader
<vehicle filename="$ddata/vehicles/newHolland/l218/l218.xml"/>
<vehicle filename="$data/vehicles/paladin/baleSpear/baleSpear.xml"/>
<!- Potato _________________________________________________
Planter
<vehicle filename="planter.xml" requiredMod="FS22_LizardS208"/>
Roder
<vehicle filename="Akpil_Bulwa_2.xml" requiredMod="FS22_AkpilBulwa"/>
Rüben
<vehicle filename="sokser.xml" requiredMod="FS22_LizardPHMini"/>
-->
Loading

0 comments on commit 9a5f95f

Please sign in to comment.