Community Forum

Yield Adjustment .Lua

Forum Overview >> Scripting

CategoryScripting
Created11.03.2020 02:21


JMFModding 11.03.2020 02:21
Hi,

Trying to mud my way through .lua scripting for a mod, looking for some help.

I've been working on a combine header that picks up swathed windrows of grain crops. I've been testing it in barley. You mow the barley into a windrow of straw, then you can pick up the windrow with the combine using the pickup header. Here's my issue.

The yield of the barley as its converted from straw to barley is multiplied by a large factor, and the resulting straw swath leaving the combine is also multiplied by a large factor.

I understand this is controlled by the cutter.lua specialization, my thought is to create a new specialization script, pickupcutter.lua for example, that I can then modify the yieldpersqm for just this header.

Any thoughts on this or direction toward how I would go about this?

Thanks

JMFModding 14.03.2020 23:44
Ok let me try another angle, if I modify the maps Fruittype.xml like the following, why does affect the straw windrow as mown, but regardless the combine picks up the same amount of grain

fruitTypeConverter name="MOWER">
<converter from="BARLEY" to="STRAW" factor="0.1" windrowFactor="0.1" />
</fruitTypeConverter>
</fruitTypeConverters>

Or should I add a new category to fruit type converter and add the fruit type converter line to the cutter in the combine?

fruitTypeConverter name="PICKUPHEADER">
<converter from="STRAW" to="BARLEY" factor="0.1" windrowFactor="0.1" />
</fruitTypeConverters>

Bilbo Beutlin (BBeutlin) 15.03.2020 00:23
hmm .. I don't really understand your intentions.

Basically the yield of straw is determined in the "fruitTypes.xml" <windrow name="straw" litersPerSqm=".." />
There's no individual straw anymore (eg. "wheat_windrow") like in earlier FS versions. So a 'recycling' to a concrete source fruit is impossible (by default) due to unknown origin type.

Else you must re-write the "fruitTypes.xml" so eg. <fruitType name="wheat" ..> gives <windrow name="wheat_windrow" litersPerSqm=".." />. So it was in earlier versions. Finally the collecting pickup wagons converted all "{grain}_windrow" types to "straw".


Note: Log in to post. Create a new account here.