Community Forum

unloading trailer as bigBags, is it possible?

Forum Overview >> Farming Simulator 19

CategoryFarming Simulator 19
Created30.08.2021 23:12


Fuman 30.08.2021 23:12
I think I have exhausted my mental facilities with this project, and need outside assistance.

The project is as follows:
An it-runner platform trailer to haul bigBags.
As it stands now, the trailer will successfully load seed, fertilizer and lime. That's a good start.
*note that the trailer is "virtually hauling" said products as bigBags, in reality they are loaded
as a bulk product, much like a seeder, planter, and sprayer.

However, the only option I have for unloading is to "unload here" which results in the it-runner trailer
sitting on top of a pile of product... Not so good.

The goal now is to have the it_runner trailer unload it's products as bigBags. Much like the aforementioned
seeder, planter, and sprayer.

I will provide code snippets from the trailer.xml and modDesc.xml that apply to the task at hand, and will
omit those items that are not pertinent to this endeavor, ie, wheels, hubs, moving parts... etc etc

Note that the fillTypes are represented in the maps fillTypes.xml, and the bigBags are all vanilla xml.

From the modDesc.xml
<?xml version="1.0" encoding="utf-8" standalone="no" ?>
<modDesc descVersion="51">
<author></author>
<version></version>
<title></title>
<description></description>
<iconFilename></iconFilename>
<multiplayer/>

<vehicleTypes>
<type name="fu-Trailer" parent="baseTipper" className="Vehicle" filename="$dataS/scripts/vehicles/Vehicle.lua">
<specialization name="fillTriggerVehicle"/>
<specialization name="hookLiftContainer"/>
<specialization name="fillableImplement"/>
<specialization name="fillUnit"/>
<specialization name="fillVolume"/>
</type>
</vehicleTypes>

<storeItems></storeItems>
<brands></brands>
</modDesc>

*Note that from what I can tell, specialization=hookLiftContainer is what allows me to "hook and haul" the trailer, and that
parent=baseTipper is what providing me the option to dump the product on the ground, but not unload as a bigBag.

From the fu-trailer.xml
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<vehicle type="fu-trailer">
<storeData>
<functions>
<function>$l10n_function_fu-trailer</function>
</functions>
</storeData>
<base>
<typeDesc>$l10n_typeDesc_container</typeDesc>
<filename>fu-trailer.i3d</filename>
<size width="3.5" length="8.5" lengthOffset="0.3"/>
<components>
<component centerOfMass="0 0.2 0" solverIterationCount="10" mass="1800"/>
</components>
<schemaOverlay attacherJointPosition="0 0">
<default name="DEFAULT_IMPLEMENT"/>
<turnedOn name="DEFAULT_IMPLEMENT_ON"/>
<selected name="DEFAULT_IMPLEMENT_SELECTED"/>
<turnedOnSelected name="DEFAULT_IMPLEMENT_SELECTED"/>
</schemaOverlay>
</base>
<fillUnit>
<fillUnitConfigurations>
<fillUnitConfiguration>
<fillUnits>
<fillUnit unit="$l10n_unit_literShort" fillTypes="fertilizer" capacity="20000" fillLitersPerSecond="1000">
<dashboard displayType="ANIMATION" valueType="fillLevel" animName="fertilizerAnimation"/>
<exactFillRootNode node="exactFillRoot"/>
<autoAimTargetNode node="exactFillRoot" />
</fillUnit>
</fillUnits>
<objectChange node="0>0|5|0" visibilityActive="true" visibilityInactive="false"/>
</fillUnitConfiguration>
<fillUnitConfiguration>
<fillUnits>
<fillUnit unit="$l10n_unit_literShort" fillTypes="lime" capacity="20000">
<dashboard displayType="ANIMATION" valueType="fillLevel" animName="limeAnimation"/>
<exactFillRootNode node="exactFillRoot"/>
<autoAimTargetNode node="exactFillRoot" />
</fillUnit>
</fillUnits>
<objectChange node="0>0|5|1" visibilityActive="true" visibilityInactive="false"/>
</fillUnitConfiguration>
<fillUnitConfiguration>
<fillUnits>
<fillUnit unit="$l10n_unit_literShort" fillTypes="seeds" capacity="20000">
<dashboard displayType="ANIMATION" valueType="fillLevel" animName="seedsAnimation"/>
<exactFillRootNode node="exactFillRoot"/>
<autoAimTargetNode node="exactFillRoot" />
</fillUnit>
</fillUnits>
<objectChange node="0>0|5|2" visibilityActive="true" visibilityInactive="false"/>
</fillUnitConfiguration>
</fillUnitConfigurations>
</fillUnit>

<fillVolume>
<unloadInfos>
<unloadInfo>
<node node="unloadInfo01" width="2" length="1.0" />
</unloadInfo>
<unloadInfo>
<node node="unloadInfo02" width="1" length="4.0" />
</unloadInfo>
<unloadInfo>
<node node="unloadInfo03" width="1" length="4.0" />
</unloadInfo>
</unloadInfos>
</fillVolume>

<dischargeable requiresTipOcclusionArea="false">
<dischargeNode node="0>" emptySpeed="1000" fillUnitIndex="1" maxDistance="6" canStartDischargeAutomatically="true">
<trigger node="0>1|6"/>
</dischargeNode>
</dischargeable>

<fillTriggerVehicle triggerNode="Filltrigger" fillUnitIndex="1" litersPerSecond="750"/>

<i3dMappings>
<i3dMapping id="fu-trailer_main_component" node="0>"/>
<i3dMapping id="fu-trailer" node="0>0"/>
<i3dMapping id="Filltrigger" node="0>0|3|1"/>
<i3dMapping id="exactFillRoot" node="0>0|3|3"/>
<i3dMapping id="unloadInfo01" node="0>0|4|0" />
<i3dMapping id="unloadInfo02" node="0>0|4|1" />
<i3dMapping id="unloadInfo03" node="0>0|4|2" />

I can see no reason why this trailer shouldn't be able to unload to bigBags, and hopefully, pallets as well; much like
the in-game implements.
Yet as it stands at this moment, there is a reason... I can't figure out what it is....
Any and all remarks, advice, criticism is welcome....

Thank you.

Bilbo Beutlin (BBeutlin) 31.08.2021 07:05
I've told you already in your other thread how it works.

1. You need another vehicleType. You use parent="baseTipper" what includes the specs 'dischargeable' and 'trailer'. This will force the unload by tipping only.
Take parent="baseFillable" instead and add perhaps required additional specs.

2. You need a <fillUnit> with the tag <unloading width=.. offset=.. />

3. You DO NOT need several <fillUnitConfiguration> for each fillType. You can make a list eg. fillTypes="wheat barley oat". Pay attention that these fillTypes really have a <pallet> link (in the map's fillTypes.xml).

Fuman 31.08.2021 08:03
I have yet to find an in-game implement (seeder, planter, sprayer) that uses "<fillUnits> <unloading>" . Seeing it used, would make using it a much more pleasant journey. The ones I have read through all use the "<fillVolume><loadInfos>".

The advice for the baseTipper "forcing" the unload to tipping only, is fantastic.

As for a list of fillTypes, I am not certain that I can get away with that, as each fillType as it's own <animation> associated with it to control the respective shape( fertilizer, seed or lime) in the i3D and apply the correct skin (diffuse, specular, normal) to said shape.

Is it possible to have just one shape (generic bigBag) in the i3D, and then have the xml choose the correct <animation> based on the fillType that is being loaded in game ?

i.e, for a list filltypes, if the fillType being loaded in game is xyz, then use the <animation> and skin for xyz.

I don't think the xml alone could achieve this. It would probably require something more.

Bilbo Beutlin (BBeutlin) 31.08.2021 10:36
You can easily find keywords/phrases with the help of Notepad++ "search in files".
Here eg. search for "<unloading " filter "*.xml" in folder "{FS install folder}\data\vehicles".
This will give you 43 hits in 38 files. Should be enough to examine. ;)

Your mod uses different bags in different animations. Alternatively you could use one neutral bag type for all fillTypes. Or at least for these fillTypes which have a common <pallet>. It's your decision.
But of course, if you want different bags, you need different <fillUnitConfiguration> and <animation>.


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