Tutorial to integrate the FS 2011 DLC 2 into mods
Last changes to this article:
June 28, 2011
Changelog:
- Added silage shovel sample mod (June 28, 2011)
- Added english translation, thanks to Jan "Byteone" Heinsvig (June 28, 2011)
- Fixed DLC2_not_installed l10n entry (June 24, 2011)
This guide describes the few simple steps to add the BGA and the silos from the DLC 2 for Farming Simulator 2011 to integrate into any mod map.
It is also possible to adapt the model of the BGA according to your needs and still be provided with the functionality of the second DLC.
It also explains how other devices such as silage forks, silage shovels and silage compressing vehicles can be created. Prerequisites for this tutorial are the knowledge of the GIANTS editor and basic modding skills (e.g. editing the modDesc.xml).
Please post questions and feedback in this thread in the official LS support forum or in the thread on LS-UK.
- Add biogas facility to mod maps (Difficulty: easy)
- Adjust the biogas facility (Difficulty: medium)
- Compacting speed of vehicles (Difficulty: easy)
- Create a new silage shovel/fork (Difficulty: medium)
- Fill trailers with silage (Difficulty: medium)
Add biogas facility to mod maps (Difficulty: easy)
- Download the required files: giantsLS11DLC2SDK.zip
- The file giantsLS11DLC2SDK.zip must be unzipped into the folder of the mod map. The files can be copied to any subfolders, depending on your preference. The following steps assume that the files are located directly in the mod map folder and not in a subfolder. If this is not the case, the paths below must be adjusted accordingly.
- The file "DLC2Bga.lua" must be entered as an extra source file in the modDesc.xml.
<extraSourceFiles> <sourceFile filename="DLC2Bga.lua"/> ... possibly other sourceFile entries of the mods </extraSourceFiles> - An l10n entry with the name "DLC2_not_installed" must be inserted into the modDesc.xml.
<l10n> <text name="DLC2_not_installed"> <en>The Farming Simulator 2011 DLC 2 is not installed or was not selected in the mod menu. The DLC 2 is available on www.farming-simulator.com</en> <de>Der Landwirtschafts Simulator 2011 DLC 2 ist nicht installiert oder wurde nicht selektiert im Mod-Menü. Den DLC 2 gibt es auf www.landwirtschafts-simulator.de</de> <fr>Le Farming Simulator 2011 DLC pack 2 n'est pas installé ou n'a pas été sélectionné dans le menu de mod. Le DLC pack 2 est disponible sur www.farming-simulator.com</fr> </text> ... possibly other l10n entries of the mods </l10n> -
The biogas facility must be placed on the map. This is done by importing the file "i3d/bga.i3d" and placing the object at the desired location.
With the GIANTS Editor you can do this with drag&drop, or in the menu you can choose File->Import and then select the i3d file.
Adjust the biogas facility (Difficulty: medium)
The biogas facility can be rearranged arbitrarily, as long as the triggers of the objects and the information objects of the bunker silos and the object BGA are preserved, or this these are replaced with corresponding objects.
Modders, which own Autodesk Maya can also download the Maya file and the textures in png format and modify the objects directly in Maya. The relevant files are here: giantsLS11DLC2SDK_sourceFiles.zip.
However, the biogas facility can also be adjusted directly in the GIANTS editor.
The following list describes the functions and characteristics of the most important items:
| Biogas facility (BGA): | |
| The biogas facility consists of an unloading zone (tip trigger, unloading silage with shovel, strawbale trigger) and a slurry tank. | |
| User attributes | |
| onCreate | modOnCreate.dlc2_Bga_onCreate |
| tipTriggersIndex | Index path to a transform group which contains thee tip triggers. The tip triggers are described in the section "Tip Trigger" |
| objectDeleteTriggerIndex | Index path to a rigid body (static) shape with the flag "trigger", which defines in which area straw and hay bales are accepted |
| silageCatcherIndex | Index path to a rigid body (static) shape, which defines the area, where silage can be unloaded with the shovel to fill the bunker |
| liquidManureSiloIndex | Index path to the slurry tank. More information is given in the section "Slurry Tank" |
| bunkerPlaneIndex | Index path to the moving plane of the bunker |
| bunkerPlaneMinMaxY | Minimum and maximum Y translation of the moving plane |
| bunkerPushersIndex | Index path to the group which contains the moving pushers of the bunker. It can contain any number of objects |
| bunkerPushersMinMaxZ | Minimum and maximum Y translation of the pushers |
| bunkerRollsIndex | Index path to the group which containts the spinning reels of the bunker. It can contain any number of objects |
| bunkerRollsSpeed | Rotational speed of the reels, in degrees / second |
| bunkerCapacity | Capacity of the bunker, in liters |
| bunkerUseSpeed | Defines how fast the bunker is emptied, in liters / millisecond (default: 0.5) |
| bunkerPlaneMoveScale | How much faster / slower does the bunker plane move in comparison to the real fill level (default: 0.2 (= 5 times slower)) |
| fillDeltaToManureDeltaScale | Amount of manure produced by one liter of bunker content |
| baleValueToFillDeltaScale | Number of liters of bunker contents produced by 1$ value of money of a bale |
| Hierarchy (children) | |
| iconNode | The BGA node may have a child named "iconNode". At the location of this node the biogas facility icon is shown in the PDA. |
| Tip Trigger: | |
| The BGA tip triggers are similar to the normal tip triggers in the game. However newly they define a whole area, where trailers can be unloaded. The length of this area is defined by the position of the trigger and the Z translation of the first child. The width is defined by the user attribute "triggerWidth". | |
| User attributes | |
| fruitTypes | A list of accepted fruit types |
| priceMultipliers | A list of prize multipliers for each fruit type |
| triggerWidth | Width of the trigger |
| Slurry tank: | |
| The slurry tank consists of a moving plane and a trigger to fill the slurry into a trailer. | |
| User attributes | |
| capacity | Capacity of the slurry tank |
| movingIndex | Index path to the plane which moves according to the fill level |
| moveMinMaxY | Minimum and maximum Y translation of the moving plane |
| triggerIndex | Index path to a rigid body (static) shape, with the flag "trigger", which determines the area where trailers can be filled |
| Bunker silo: | |
| Each bunker silo has its own object, and accordingly has its own user attributes. A bunker silo consists of several moving planes, the various triggers (trigger for shovels, tip triggers interaction triggers and compression trigger) and the information object which defines where silage can be unloaded with the shovel. | |
| User attributes | |
| onCreate | modOnCreate.dlc2_BunkerSilo_onCreate |
| capacity | Capacity of the bunker silo |
| movingPlanesIndex | Index index path to the group which contains the moving planes which represent the chaff/grass and the silage. See subsection "Silo Moving Plane" |
| movingPlanesMinMaxY | Minimum and maximum Y translation of the moving planes |
| silagePlaneIndex | Index path to the tarp, which covers the silo during the fermentation |
| silagePlanesMinMaxY | Minimum and maximum Y translation of the silage plane. The maximum should be chosen such that the silo is covered when the moving plane is at the maximum |
| shovelTriggersMinY | Minimal Y translation of the shovel triggers. Should be slightly larger than the minimum of "silagePlanesMinMaxY". This prevents that the shovel triggers are moved below the floor when the silo is almost empty. |
| tipTriggersIndex | Index path to a group which contains the tip triggers. The tip triggers are described in the section "Tip Trigger" |
| interactionTriggerIndex | Index path to a rigid body (static) shape, with the flag "trigger", which specifies the area where the fill level display is active, and where you can start the fermentation |
| compactingTriggerIndex | Index path to a rigid body (static) shape, with the flag "trigger", which specifies the area in which a vehicle compresses the silo |
| silageCatcherIndex | Index path to a rigid body (static) shape, which defines the area where a silage shovel can unload to the silo. |
| distanceToCompactedFillLevel | How much of the silo's contents is compressed by driving one meter. (Default: 500. This equivalent to 500 to 500 / 3, depending on the game's difficulty) |
| fermentingDuration | Duration of the fermentation process, in milliseconds. (Standard: 900000. This is 15min to 45min depending on the game's difficulty) |
| Silo Moving Plane | |
|
A moving plane consists of the plane which is displayed and a shovel trigger. The material that is assigned to the plane, must have a custom shader which interprets the parameter "colorScale". The value of this parameter is (1,1,1) if chaff/grass is in the silo and (0.658823, 0.5647, 0.4423529) if it contains silage. Usually you can simply use the supplied custom shader "silageShader.xml". The shovel trigger is the first child of the plane and must be a rigid body (kinematic) shape with the flag "tigger". The standard BGA in the DLC2 also another child (rigid body (kinematic)), which defines the collision of the plane. This is slightly below the visible plane, resulting in the effect that the wheels of the vehicle slightly sink into the silage. | |
Compacting speed of vehicles (Difficulty: easy)
Each vehicle can compact the silos at different speeds. The wheel loader in DLC2 compacts twice as fast as the other vehicles. To achieve this, the vehicle object must have the attributes "bunkerSiloCompactingScale" and "bunkerSiloCompactingRefNode".
"BunkerSiloCompactingScale" is an arbitrary scaling factor of the compression speed. 1 corresponds to the standard that is used in tractors. 2 is used for the wheel loader.
To set these attributes, the simplest way is to use the specialization "BunkerSiloCompacter" which can be downloaded here: BunkerSiloCompacter.lua.
Once you haveadded this specialization to the vehicle, you can put the following line in the vehicle XML:
<bunkerSiloCompacter compactingScale="SCALE" refNode="INDEX_PATH"/>SCALE must be replaced with the desired value, and INDEX_PATH must be replaced with the index path an object. The position of this object determines where the silo is pushed down during the drive over. The wheel loader in the DLC 2 has SCALE="2" and INDEX_PATH="0>".
Create a new silage shovel/fork (Difficulty: medium)
To add the possibility of a mod to take silage from the silo, the following steps must be performed.
- The specializations "fillable" and "pdlc_dlcPack2.newShovel" must be added to the shovel mod
- The new information of the DLC2 shovel must be inserted into the XML of the vehicle. It looks like this:
<shovel tipReferenceNode="INDEX_PATH"> <node index="INDEX_PATH_1" /> ... <node index="INDEX_PATH_N" /> </shovel>The "tipReferenceNode" determines where the content is unloaded. It can be unloaded if this object is above the silo silage catcher of the BGA or the bunker silo or above a trailer. This object should be placed around the front edge of the shovel. The "node" information defined by INDEX_PATH_1 to INDEX_PATH_N, determines which parts of the vehicle can pickup silage. For the wheel loader, the only node that is used, it the physics object of the shovel. This prevents the shovel from being filled, if you drive with the rear of the wheel loader into a shovel trigger.
If no "node" is specified, then each physics object of the vehicle is used to trigger. E.g. the silage forks in the DLC2 have no "node" information. - The shovel of the DLC2 is working with the fillable specialization. Accordingly, the fillPlanes and fillTypes need to be specified in the vehicle XML.
This might look like this:<fillPlanes> <fillPlane type="manure"> <node index="1>2|2|0|3"/> </fillPlane> <fillPlane type="silage"> <node index="1>2|2|0|4"/> </fillPlane> </fillPlanes> <fillTypes fillTypes="manure silage"/>
Fill trailers with silage (Difficulty: medium)
The DLC2 adds support for silage to all trailers that can be filled from the air (self.allowFillFromAir = true) and already support chaff. Thereby the same optical properties as for chaff are used (fillPlane, particle system). Mods can change this behavior. You can manually add 'silage' to the supported fillTypes and add the appropriate "dischargeParticleSystem".
In addition, you can also disable the automatic addition of silage even in case no silage support is desired. This is is done by adding the attribute "dlc2AddSilage" to the fillType node and setting it to "false".
This looks like this:
<fillTypes dlc2AddSilage="false" fillTypes="..."/>
Files Overview
- giantsLS11DLC2SDK.zip: Contains biogas facility SDK (I3D file, textures and scripts)
- giantsLS11DLC2SDK_sourceFiles.zip: Contains biogas source files (Maya file, Textures as png)
- BunkerSiloCompacter.lua: Script to create a bunker silo compacting vehicle
- giantsLS11DLC2ShovelSample.zip: Silage shovel sample mod