Community Forum

Adding Alfalfa bales to all bale wrapper

Forum Overview >> Farming Simulator 19

CategoryFarming Simulator 19
Created04.03.2021 12:47

Geoffrey A (geooooo51) 04.03.2021 12:47
Hello everyone,

I've added Alfalfa on my map and everything is working fine, mowing and pressing. But I want to allow the wrapper to work with my alfalfa bales to makes alfalfa bales fermented.

I know there is an lua to add specializations to wrapper but I can't make it right.

Any tips ?


Bilbo Beutlin (BBeutlin) 04.03.2021 22:58
It should work according default baler/wrapper eg. the kuhnSW4014.
Add in <baleTypes> your custom bale, eg.
<baleType fillType="alfalfa_windrow" wrapperBaleFilename={your custom bale}.i3d
For this bale.i3d copy the default roundbaleSilage.i3d and set in user attributes fillType=alfalfa_fermented or whatever you use.

Geoffrey A (geooooo51) 05.03.2021 22:14
Thank for the answer. So I tried but, it's not working, here is the balestypes.xml :

<baleType filename="maps/bales/roundbales/roundbaleAlfalfa_w112_d130.i3d" wrapperBaleFilename="maps/bales/roundbales/roundbaleAlfalfaFermented_w112_d130.i3d" fillType="ALFALFA_WINDROW" isRoundbale="true" width="1.12" diameter="1.3" />

The roundbaleAlfalfa_w112_d130.i3d is set with the user attributes fillType : ALFALFA_FERMENTED and supportsWrapping true

I'm missing something ?


Geoffrey A (geooooo51) 05.03.2021 22:34

Bilbo Beutlin (BBeutlin) 06.03.2021 01:41
For usage in vehicle/tool it must be defined also in the vehicle.xml, see eg. cited kuhnSW4014 section <baleWrapper>.

Geoffrey A (geooooo51) 06.03.2021 13:40
Thanks for the answers and sorry for all the questions, but just to be sure, when you talk about the vehicle.xml :

I need to add ALFALFA_WINDROW in the baleType fillType from the lines below of the Kuhn SW4014 :

<baleType fillType="grass_windrow" wrapperBaleFilename="$data/objects/roundbales/kuhnSW4014/roundbaleSilage_w112_d130.i3d" minBaleDiameter="1.1" maxBaleDiameter="1.3" minBaleWidth="1.1" maxBaleWidth="1.3" />

So :

<baleType fillType="grass_windrow" wrapperBaleFilename="$data/objects/roundbales/kuhnSW4014/roundbaleSilage_w112_d130.i3d" minBaleDiameter="1.1" maxBaleDiameter="1.3" minBaleWidth="1.1" maxBaleWidth="1.3" />
<baleType fillType=""ALFALFA_WINDROW" wrapperBaleFilename="$data/objects/roundbales/kuhnSW4014/roundbaleSilage_w112_d130.i3d" minBaleDiameter="1.1" maxBaleDiameter="1.3" minBaleWidth="1.1" maxBaleWidth="1.3" />


But if I want to use the wrapper from the DLC Claas it's not possible ?

Bilbo Beutlin (BBeutlin) 06.03.2021 14:43
No. The vehicle.xml needs this additional entry. But the mentioned Claas baler is part of the Claas DLC and not changeable.
Only possible by a custom LUA script which adds the missing stuff.

Anyway, there should be some similar mods around. Try these.

Geoffrey A (geooooo51) 06.03.2021 15:47
So, I added a new vehicle in my map, the kuhnSW4014 modified with adding ALFALFA_FERMENTED and it's working, thanks a lot !

I'm interessted with the LUA script for adding the ALFALFA_FERMENTED for all the wrappers, but I never worked with LUA, can you explained it to me or is it to complicated ?


Bilbo Beutlin (BBeutlin) 06.03.2021 22:28
Yes, it is somehow complicated, at least for a beginner in FS LUA. ;)
Basically one must add to the Baler:onLoad() a custom extension which adds the specific bale types.

Geoffrey A (geooooo51) 07.03.2021 13:35
Well, I expected this answer :)
Anyway thanks for the help, I will do silage with modified mods and it will be ok !
Thanks a lot !

Boris Klinko (Boris555) 21.03.2021 13:03
Hello Bilbo

I am trying to solve this, because I want to wrap bales with Vicon baler. I have found mod that does something similar but instead of adding to .xml file he just changing the number in .xml file with setXMLInt. Which function should I use to add lines to .xml file?

Second question is about setXMLInt, I haven't found information about that function on internet, to which library does it belong?

Thank you.

Bilbo Beutlin (BBeutlin) 22.03.2021 10:53

Boris Klinko (Boris555) 23.03.2021 10:27
Hello Bilbo,

I have read the documentation, and i think there is no possiblity to solve this through xml editing, because there is no method that allows inserting of elements in xml.

I took a look in documentation for BaleWrapper specialization and i have seen that allowed bale types are in table wrapper.allowedBaleTypes. The getWrapperBaleType is used to check is found bale exists in that table, and getWrapperBaleType is called by getBaleInRange which is detecting type of bale in bale wrapper work area.

As next step I will try to somehow insert new bale types in tabele wrapper.allowedBaleTypes, but before of that I would just like to check with you if I am working in right direction, and maybe if you have some recomendation for me.

Thank you.

Boris Klinko (Boris555) 13.04.2021 14:14

Geoffrey A I have made the mod that has the function you described, it is available on modhub and is called Bale Wrapper Extension.

Bilbo, thank you very much you for all the help and advice.

Bilbo Beutlin (BBeutlin) 13.04.2021 14:38
*oops* wrong thread. See your other thread nearby. ;)

Geoffrey A (geooooo51) 25.04.2021 15:25
Hello Boris,

Thanks a lot, this is exaclty what I was looking for !
Good job !

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