How to add multiple steering modes to a mod

Game Version: Farming Simulator 13
Programs required: Winzip, Jzip, 7zip or WinRar | Notepad / Notepad++


Modding Index | Vehicle Tutorials


This tutorial will explain in full detail, how to give your mod multiple (max 4) steering modes. The steering modes are: - Front axle steering - Rear axle steering - Both axle steering - “Crab” steering (all wheels point in the same direction)

Hey guys,

As said in the summary, this tutorial will show you how to add multiple steering modes to either a mod you downloaded, or one you are making.

A few things before we start:

I'm Dutch, so all info on screenshots will be in Dutch. You can still see what you need to click, and I'll provide a translation.
All image in this tutorial are clickable, if you click an image it will show a bigger image
Difficulty level: basic
Required equipment: Notepad++
Required equipment: (if your mods are zipped) 7-Zip OR WinRAR (32-bit version / 64-bit version

Scripts

Roue.lua file:
RoueEvent.lua file:
(Both are needed to complete this tutorial)

Contents:

Scripts
Step 1: Unzipping
Step 2: Scripts folder
Step 3: The ModDesc file
Step 3.1a: <vehicleTypes> already present
Step 3.1b: <vehicleTypes> not present
Step 3.2a: <extraSourceFiles> already present
Step 3.2b: <extraSourceFiles> not present
Step 3.3a: <l10n> already present
Step 3.3b: <l10n> not present
Step 4: Saving!
Step 5: Editing the Roue.lua file
(Optional) Step 6: changing the number of steering modes
Step 7: Finishing up


Step 1: Unzipping

Using 7-Zip or WinRAR, unzip your mod by right clicking on it, and selecting Extract to /“ModName”. “ModName” resembles the name of the ZIP file you are trying to unzip.
Fig:1

The result:
Fig:2


Step 2: Scripts folder

Look for a “scripts” folder inside your mod folder. If there isn't one, create one by right clicking on a empty part of the folder, hover over “new”, and click “folder”. Name your folder “scripts” (Without quotation marks)

Once created, place both the Roue.lua and RoueEvent.lua file in there.
Fig:3

Fig:4


Step 3 The ModDesc

Open the file modDesc.xml with Notepad++

You will need to add some things to your modDesc file, but first of all, I need you to look or search for the next few things, again, without quotation marks.
- “<vehicleTypes>“
- ”<extraSourceFiles>“
- ”<l10n>“

Look very close which ones you DO have, and which ones you DON'T have. If you mess this up, it'll be very hard for us to find out what you did wrong.
The next steps will be marked as 3.1a / 3.1b / 3.2a / 3.2b etc.
It is important you do EVERY numeric step. That means, you have to do step 3.1, 3.2, etc, but you can ONLY do 1 of the alphabetic steps.

If you continue the next part with step A, then don't do step B, and vice versa. Only choose 1


Step 3.1a

If you DO have ”<vehicleTypes>” in your modDesc, it will probably look like this:
(If you DON'T have “<vehicleTypes>” in your modDesc, go to step 3.1b!!)

<vehicleTypes>
 <type name="---Insert name of your mod here---" className="Vehicle" filename="$dataS/scripts/vehicles/Vehicle.lua">
 <specialization name="---specialization name---" />
 <specialization name="---specialization name---" />
 <specialization name="---specialization name---" />
 <specialization name="---specialization name---" />
 </type>
</vehicleTypes>

“—Insert name of your mod here—” Would be the name of your mod. You don't have to worry about this or change it.
“—specialization name—” Stands for randmom specializations, like motorized, steerable, etc…

Now here is what you should change:

<vehicleTypes>
  <type name="---Insert name of your mod here---" className="Vehicle" filename="$dataS/scripts/vehicles/Vehicle.lua">
  <specialization name="---specialization name---" />
  <specialization name="---specialization name---" />
  <specialization name="---specialization name---" />
  <specialization name="---specialization name---" />
  <specialization name="Roue" />
 </type>
</vehicleTypes>

As you can see, you have to ADD “<specialization name=“Roue” />” to your specializations.

!!!!!DON'T REPLACE A SPECIALIZATION!!!!! You need them all!


Step 3.1b

If you DON'T have “<vehicleTypes>” in your modDesc, it will probably look like this:
(Skip if you did step 3.1a!!!)

...
...
    <description>
        <en>Sample mod description</en>
        <de>Beispiel Mod Beschreibung</de>
    </description>
    <iconFilename>store_deutzAgrovector.png</iconFilename>
    <multiplayer supported="true"/>
    <storeItems>
        <storeItem>
            <en>
                <name>Deutz Agrovector</name>
                <description>
<![CDATA[This is the sample mod]]>
                </description>
            </en>
...
...

I reconmend changing this to make it more readable.
I reconmend changing it to something like this, by just adding 3 empty lines:

...
...
    <description>
        <en>Sample mod description</en>
        <de>Beispiel Mod Beschreibung</de>
    </description>
    <iconFilename>store_deutzAgrovector.png</iconFilename>
    <multiplayer supported="true"/>
    
 
 
 <storeItems>
        <storeItem>
            <en>
                <name>Deutz Agrovector</name>
                <description>
<![CDATA[This is the sample mod]]>
                </description>
            </en>
...
...

Now you have done that, save it for now, and open up the XML file of your mod. It will probably be named like this: “NameOfYourMod.xml”
Using the Deutz Agrovector as example, it would look like: “deutzAgrovector.xml”

Open this file in notepad++ and look for “<vehicle type=”…….“>”. It should be on the second line. On the dots will be the name of your mod.
Fig:5

In my case, the name is “AgrovectorAllSteer”

COPY this name over litterally, and temporarilly place it in your modDesc file.

Now copy the next part over to your modDesc file:

<vehicleTypes>
  <type name="---Insert name of your mod here---" className="Vehicle" filename="$dataS/scripts/vehicles/Vehicle.lua">
   <specialization name="Roue" />
  </type>
 </vehicleTypes>

After you did that, it should look like this:

...
...
    <description>
        <en>Sample mod description</en>
        <de>Beispiel Mod Beschreibung</de>
    </description>
    <iconFilename>store_deutzAgrovector.png</iconFilename>
    <multiplayer supported="true"/>
    
    <vehicleTypes>
  <type name="---Insert name of your mod here---" className="Vehicle" filename="$dataS/scripts/vehicles/Vehicle.lua">
   <specialization name="Roue" />
  </type>
 </vehicleTypes>
 
 <storeItems>
        <storeItem>
            <en>
                <name>Deutz Agrovector</name>
                <description>
<![CDATA[This is the sample mod]]>
                </description>
            </en>
...
...

Now, replace “—Insert name of your mod here—” by the name you copied a few seconds earlier.
In my case, this would be replaced by “AgrovectorAllSteer”.


Step 3.2a

If you DO have “<extraSourceFiles>” in your modDesc, it will probably look like this:
(If you DON'T have “<extraSourceFiles>” in your modDesc, go to step 3.2b!!)

<extraSourceFiles>
  <sourceFile filename="scripts/---scriptNameHere---.lua" />
  <sourceFile filename="scripts/---scriptNameHere---.lua" />
  <sourceFile filename="scripts/---scriptNameHere---.lua" />
  <sourceFile filename="scripts/---scriptNameHere---.lua" />
 </extraSourceFiles>

“—scriptNameHere—” Stands for random scripts that your mod uses.

Now here is what you should change:

<extraSourceFiles>
  <sourceFile filename="scripts/---scriptNameHere---.lua" />
  <sourceFile filename="scripts/---scriptNameHere---.lua" />
  <sourceFile filename="scripts/---scriptNameHere---.lua" />
  <sourceFile filename="scripts/---scriptNameHere---.lua" />
  <sourceFile filename="scripts/RoueEvent.lua" />
 </extraSourceFiles>

As you can see, you have to ADD “<sourceFile filename=“scripts/RoueEvent.lua” />” to your specializations.

!!!!!DON'T REPLACE A EXTRA SOURCE FILE!!!!! You need them all!


Step 3.2b

If you DON'T have “<extraSourceFiles>” in your modDesc, it will probably look like this after the edits we did before:
(Skip if you did step 3.2a!!!)

...
...
    <description>
        <en>Sample mod description</en>
        <de>Beispiel Mod Beschreibung</de>
    </description>
    <iconFilename>store_deutzAgrovector.png</iconFilename>
    <multiplayer supported="true"/>
    
    <vehicleTypes>
  <type name="---Insert name of your mod here---" className="Vehicle" filename="$dataS/scripts/vehicles/Vehicle.lua">
   <specialization name="Roue" />
  </type>
 </vehicleTypes>
 
 <storeItems>
        <storeItem>
            <en>
                <name>Deutz Agrovector</name>
                <description>
<![CDATA[This is the sample mod]]>
                </description>
            </en>
...
...

Now I need you to free up some space again, so add 2 extra empty lines UNDER </vehicleTypes>, like this:

...
...
    <description>
        <en>Sample mod description</en>
        <de>Beispiel Mod Beschreibung</de>
    </description>
    <iconFilename>store_deutzAgrovector.png</iconFilename>
    <multiplayer supported="true"/>
    
    <vehicleTypes>
  <type name="---Insert name of your mod here---" className="Vehicle" filename="$dataS/scripts/vehicles/Vehicle.lua">
   <specialization name="Roue" />
  </type>
 </vehicleTypes>
 
 
 
 <storeItems>
        <storeItem>
            <en>
                <name>Deutz Agrovector</name>
                <description>
<![CDATA[This is the sample mod]]>
                </description>
            </en>
...
...

With that done, copy the next part:

<extraSourceFiles>
  <sourceFile filename="scripts/RoueEvent.lua" />
 </extraSourceFiles>

Paste this inside your modDesc, make it look like this:

...
...
    <description>
        <en>Sample mod description</en>
        <de>Beispiel Mod Beschreibung</de>
    </description>
    <iconFilename>store_deutzAgrovector.png</iconFilename>
    <multiplayer supported="true"/>
    
    <vehicleTypes>
  <type name="---Insert name of your mod here---" className="Vehicle" filename="$dataS/scripts/vehicles/Vehicle.lua">
   <specialization name="Roue" />
  </type>
 </vehicleTypes>
 
 <extraSourceFiles>
  <sourceFile filename="scripts/RoueEvent.lua" />
 </extraSourceFiles>
 
 <storeItems>
        <storeItem>
            <en>
                <name>Deutz Agrovector</name>
                <description>
<![CDATA[This is the sample mod]]>
                </description>
            </en>
...
...

Another step down, keep going, almost there!


Step 3.3a

If you DO have “<l10n>” in your modDesc, it will probably look like this:
(If you DON'T have “<l10n>” in your modDesc, go to step 3.3b!!)

<l10n>
  <text name="---Codename here---">
   <en>---English here---</en>
   <de>---German here---</de>
  </text>
  <text name="---Codename here---">
   <en>---English here---</en>
   <de>---German here---</de>
  </text>
 </l10n>

This can also look like this, which I prefer:

<l10n>
  <text name="---Codename here---"> <en>---English here---</en> <de>---German here---</de></text>
  <text name="---Codename here---"> <en>---English here---</en> <de>---German here---</de></text>
 </l10n>

—Codename here— is the name the game will use and recognize.
—English here— is the text that will show up in the help / F1 box when the game is in English
—German here— is the text that will show up in the help / F1 box when the game is in German

To make it work, change it to:

<l10n>
  <text name="---Codename here---">
   <en>---English here---</en>
   <de>---German here---</de>
  </text>
  <text name="---Codename here---">
   <en>---English here---</en>
   <de>---German here---</de>
  </text>
  <text name="steeringMode">
   <en>Steering Mode</en>
   <de>Lenkart wechseln</de>
  </text>
 </l10n>

OR

<l10n>
  <text name="---Codename here---"> <en>---English here---</en> <de>---German here---</de></text>
  <text name="---Codename here---"> <en>---English here---</en> <de>---German here---</de></text>
  <text name="steeringMode"> <en>Steering Mode</en> <de>Lenkart wechseln</de></text>
 </l10n>

Step 3.2b

If you DON'T have “<l10n>” in your modDesc, it will probably look like this after the edits we did before: (Skip if you did step 3.3a!!!)

...
...
    <description>
        <en>Sample mod description</en>
        <de>Beispiel Mod Beschreibung</de>
    </description>
    <iconFilename>store_deutzAgrovector.png</iconFilename>
    <multiplayer supported="true"/>
    
    <vehicleTypes>
  <type name="---Insert name of your mod here---" className="Vehicle" filename="$dataS/scripts/vehicles/Vehicle.lua">
   <specialization name="Roue" />
  </type>
 </vehicleTypes>
 
 <extraSourceFiles>
  <sourceFile filename="scripts/RoueEvent.lua" />
 </extraSourceFiles>
 
 <storeItems>
        <storeItem>
            <en>
                <name>Deutz Agrovector</name>
                <description>
<![CDATA[This is the sample mod]]>
                </description>
            </en>
...
...

Again, make room for the next part we're inserting by adding 2 emtpy lines below </extraSourceFiles>, and copy the next part over to fit in the opening:

<l10n>
  <text name="steeringMode">
   <en>Steering Mode</en>
   <de>Lenkart wechseln</de>
  </text>
 </l10n>

After you're done, it should look like this:

...
...
    <description>
        <en>Sample mod description</en>
        <de>Beispiel Mod Beschreibung</de>
    </description>
    <iconFilename>store_deutzAgrovector.png</iconFilename>
    <multiplayer supported="true"/>
    
    <vehicleTypes>
  <type name="---Insert name of your mod here---" className="Vehicle" filename="$dataS/scripts/vehicles/Vehicle.lua">
   <specialization name="Roue" />
  </type>
 </vehicleTypes>
 
 <l10n>
  <text name="steeringMode">
   <en>Steering Mode</en>
   <de>Lenkart wechseln</de>
  </text>
 </l10n>
 
 <extraSourceFiles>
  <sourceFile filename="scripts/RoueEvent.lua" />
 </extraSourceFiles>
 
 <storeItems>
        <storeItem>
            <en>
                <name>Deutz Agrovector</name>
                <description>
<![CDATA[This is the sample mod]]>
                </description>
            </en>
...
...

Step 4

Save the modDesc file. You can close it now, we're done with that, but we aren't done yet!


Step 5

Open up the Roue.lua file, also with notepad++
Don't fear the crazy, weird look of this file, we don't have to change a lot here.

Now the next part is a bit of a personal part, so I CAN'T tell you exactly how to fill everything, but I'll make it as clear as possible.

We're going to change how far the wheels can turn, and how fast they turn. If you are satisfied with how the wheels turn as they came with the mod, I reconmend you to open the XML file of the mod again, and look for this part:
Fig:6

I need you to note a few things here, which are:
- The value behind “rotSpeed=“
- The value behind “rotMax=“
- The value behind “rotMin=“

You might notice the same values in the Roue.lua file:
Fig:7

Now press “Control + H”, bringing up the the replace window. Fig:8

In the “Search” box, type: rotSpeed
In the “Replace with” box, type the number you found in the mods XML file. In my case, that would be: 70

Now click the “Search next” button, untill you can see one of the right rotSpeeds selected. Now click “replace”.
Now click “Search next” again, untill you see another one of the right rotSpeeds selected, and click replace again.
Repeat until every rotSpeed has changed to your desired number.
Do the same thing for “rotMax” and “rotMin”.

Do NOT change the 0's, since that would change the way your mod steers.


(Optional) Step 6

If you only need 3 steering modes, and for example don't want the dual axle steering in your mod, this is what you do:

Select the line that says Dual Axle Steering (or the other steering mode you'd like to remove), and the 2 lines below that.
Fig:9

Delete those lines.
Now you might notice that the value “self.changeWheel” won't go up with steps of 1 anymore. Now it says 1, 3, 4.
We have to change this back to steps of one, so we change the numbers to 1, 2, 3.

Fig:10

Should look like:

Fig:11

You should follow the same steps for removing different steering modes.
Remember:

       Only remove the 3 lines that go with that steering mode.
         So just the lines containing: "--Steering mode", "self:changeSteer...." and "else if self.change...."
      
       Don't remove the lines containing:
         "else if self.changeWheel == 4 then"
           "    self.changeWheel = 0;"
           "end"
      
       The "self.changeWheel ==" streak should ALWAYS go with steps of 1.
          if there are only 2 steering modes, it's only 1 and 2, etc.

Step 7

Now to finish up, you need to zip your mod back up, or leave it in a folder, and place it in your mods folder.

To zip the mod back up, go into the folder that contains your mod:
Fig:12

Then select everything, right click, and select: Add to ”—foldername—.zip”
If your context menu doesn't say .zip, but .rar, click “Add to archife…”, and select the .zip format from there.
Fig:13

Now you should have something like this:
Fig:14

Now, copy this .zip file to: C:\Users\—Username—\Documents\My Games\FarmingSimulator2013\mods (or your own personal mod folder location)
Fig:15

If you don't want the zip file, just copy the folder that contains your mod to the location named above.
Fig:16


Original Author: timmiej93 | Date: August 13, 2013

Modding Index | Vehicle Tutorials