How to Create a Vehicle XML Template

Tutorial written using MS2 v2020.10

Note: All images and hyperlinks open in a new tab or window (depending upon your browser settings).

What are Vehicle XML Templates?

In simple terms, vehicle XML templates are what Mod Studio 2 (MS2) uses, in order to list the specific vehicle in the MS2 options when creating a vehicle mod.

The vehicle database stores all vehicle XML templates within MS2.
These templates are accessed when users create a mod for that specific vehicle.

What is a XML file?

An XML file is an extensible mark-up language file. It is used to structure data for storage and transfer. In an XML file, there are both tags and text. The tags provide the structure to the data. The text in the file that you wish to store is surrounded by these tags, which adhere to specific syntax guidelines. At its core, an XML file is a standard text file that utilizes customised tags, to describe the structure of the document and how it should be stored and transferred. (source: indeed, Oct 2020)

For MS2, the tags represent certain key variables and the text in-between these tags represents the data required in order to produce a vehicle mod template in MS2. See the example below for a better understanding.

How to Create a Vehicle XML Template file?

There are two ways in which you can create a vehicle XML template:

1. Write the XML file manually in a text editor such as Notepad++ (found below on this page)
2. Use the graphical user interface in Mod Studio 2 (found on a this page here)

You can use which ever process you feel most comfortable with.

How to write the XML file manually?

Step 1) Tools for the job

In order to write the XML file, it is recommended you use Notepad++. The latter is a fancier version of Windows Notepad.
We recommend the style "Obsidian" (dark mode).


Step 2) Create the basic layout

It is best to create a new vehicle template xml file within the following directory; this is because when you update MS2 to a new version, these files do not get replaced.


C:\Users\[username]\Documents\Mods Studio 2\UserVehicles


If the "UserVehicles" folder doesn't exist, create it but make sure to name it exactly as seen here!

Below is an example of the basic structure of a vehicle template:

You can download the basic structure file here: basic_structure.xml.

All tags have an opening tag <ListItem> and an ending tag </ListItem>.

In a completed vehicle template xml file, there will be several sets of ListItem tags and possibly more than one set of VehicleVariant tags.


Code in the above screenshot explained:

Code Tag Required? Explanation
Variable Yes For a Vehicle Template this line of code will always be the same (as above on line 2). It informs MS2 what type of mod template you are creating.
ChildVariables Yes For a Vehicle Template this line of code will always be the same (as above on line 3).
IsEnabled Yes This tag can have one of two settings:
true = Makes MS2 see this template as being "enabled", i.e. activated and therefore can be visible in MS2.
false = This setting is the complete opposite, therefore if set will disable this template from being visible in MS2.
AccessoryItems Yes This tag defines what vehicle accessory items are to be included in a template. The vehicle accessories are listed using the ListItem tags.
ListItem (LI) Yes This tag defines an accessory item. These represent the vehicle's accessories; therefore, you will have many of these listed in your xml file.
LI - Group Recommended This tag assigns the accessory item to a particular group. This allows you to list multiple accessories (ListItem) under one group heading.
LI - Image Optional This tag assigns the accessory item a particular image as defined by the path given. In MS2, this appears when hovering over an accessory with the mouse cursor.

NOTES:
a) An image must be no higher than 120 pixels and in jpg or png format. There is no width limit but please be sensible with it.
b) It is recommended if using images, you place them in a sub folder "images" (e.g. images\chs_f_l.pallet01p.jpg).
LI - Description Optional This tag assigns the accessory item a tooltip description which appears by itself or below an image (if present) within MS2 when hovering over the accessory with the mouse cursor.

NOTE: You can use the syntax "/n" to create a new line within the code (see the above screenshot to see how to use this).
LI - Text Yes This tag assigns the accessory item a name which is displayed in the accessories list within MS2 after clicking on "Add Image".
LI - Value* Yes This tag assigns the accessory item the internal game name value for a given accessory. This is displayed in the accessories list within MS2 after clicking on "Add Image". It is also used to create a vehicle mod.
Game Yes This tag represents the game within MS2 that the vehicle mod is for. Set this as: ETS2 or ATS.
InternalName* Yes This tag assigns the vehicle template the internal game name value for a given vehicle. This is displayed within MS2 when selecting the vehicle. It is also used to create a vehicle mod.
VehicleAuthor Yes This tag assigns the vehicle author value. This is displayed within MS2 when selecting the vehicle. It is also used to create a vehicle mod.
You should set this as SCS Software for default vehicles or as the VehicleMOD Author.
VehicleImage Optional This tag
VehicleType Yes This tag assigns the type of vehicle. This is used by MS2 to assign the vehicle a category. It is also used to create a vehicle mod.
You can set this as:
AllTrucks = Advanced and Old style of truck.
NewTrucks = Advanced truck only.
OldTrucks = Old Style truck only.
Trailers = Trailer only.
VehicleVariants (VV) Yes This tag defines what vehicle variant(s) there are for a given vehicle. The vehicle variant(s) are listed using the VehicleVariants tags.
VV - Variant Yes This tag defines a variant. There can be more than one variant for one vehicle.
VV - InternalName* Yes This tag assigns the vehicle variant the internal name value for a given vehicle variant. This is displayed within MS2 when selecting suitable body. It is also used to create a vehicle mod.
VV - Name Yes This tag assigns the vehicle variant a name which is displayed in the vehicle selection list within MS2.


Step 3) How do I find the internal names for those listed above?

There are x3 code tags which require specific internal name values. I have marked these with a * in the table above.

In order to obtain these, you need to look them up in the game definition files.

Therefore, you will need to use the SCS Extractor tool to extract all the .scs game files to a temporary directory. You can find this tool in MS2 on the SCS Tools tab.

Once all the game .scs files have been extracted, follow the steps outlined below to obtain the correct values:


a) ListItem - Value

Remember, you only need to include accessory items which are paintable (e.g. side skirts, fenders, mirrors, sun shields etc).
You can choose to include those that are on the main skin template or not (if unsure ask on the discord server in general).

There are two ways to obtain this value. Advanced users feel free to navigate straight to the vehicle accessory folder to find the one you need.

Otherwise, the easiest way to obtain this value is to do this from inside the game.

1. Therefore; firstly, enable the developer console (How to enable the developer console?).

2. Make sure you are running software which has the ability to take a full screen screenshot of your game (steam has a built in one, Steam Settings > In-Game > Screenshot shortcut key).

3. Load up the game that contains the vehicle you are creating a vehicle xml template for.

4. Load a profile containing the vehicle you are creating a xml for.

5. Visit a dealership where you can purchase this vehicle.

6. Select the vehicle and click on "Customise Configuration".

7. Select the accessory you wish to find out the internal name for.

8. Then open up the developer console (usually the key to the left of the "1/!" key and above the "tab" key on your keyboard).

9. Resize the console window so that it is wide enough to read each line (see screenshot below in step 11).

10. Scroll to the very bottom of the console window. You should see the last accessory you selected.
Important: This is NOT the internal name we are looking for but the definition file which contains said value!

11. Take a screenshot with the console window open (F12 for steam unless you changed it) e.g. Example Screenshot showing the Side Skirt accessory from the basic structure example code above.

12. Now navigate to the file and open it in Notepad++

Notice the file path in Notepad++'s title bar? "extracted_139" is where I extracted ETS2 v1.39 to.

13. Now that we have the file open, we can now see where the internal name value is. It is on line 3; however as you can see, it isn't coded as we saw it initially in the basic structure example above.

It is coded like this: accessory_addon_data : [accessory_item].[vehicle].[accessory]

For ListItem, MS2 requires only the [accessory].[accessory_item] values; in that order.

Therefore; for this Side Skirt accessory, we take "accessory_addon_data : sideskirt_01.scs.box.chs_f_r" and switch them around.

14. So the final internal name value for ListItem in this example is chs_f_r.sideskirt_01 (including the "." in the middle).


b) InternalName (vehicle)

You can find this value outside of game in the data.sii definition file. To obtain this value follow these simple steps:

For example, with the SCS Box trailer in the basic structure example above:

1. Navigate to the main vehicle definition folder (...\extracted_139\def\vehicle\trailer_owned\scs.box)

2. Open the file "data.sii" file in Notepad++

3. Line 3 is where we find the value; specifically after the vehicle. section.

4. It is important to include all characters; i.e. in this case vehicle.scs.box


For example, if we wanted to get the name for the default SCS Scania S 2016 truck:

1. Navigate to the main truck definition folder and open it's data.sii file (...\extracted_139\def\vehicle\truck\scania.s_2016)

2. We get the following line of code this time:

accessory_truck_data : vehicle.scania.s_2016

3. Therefore we would use the value: scania.s_2016


c) VehicleVariant - InternalName

You can find this value outside of game in the body definition files (for trailers) or cabin definition files (for trucks) . To obtain this value follow these simple steps:

For example, with the SCS Box trailer in the basic structure example above:

1. Navigate to ...\extracted_139\def\vehicle\trailer_owned\scs.box\body

2. For this trailer there are a total of 25 different body types. I won't go through them all but it is the same steps for each one.

So for the first one, we open up the file "curtain_78.sii":

3. For vehicle variant InternalName, MS2 requires only the [body_type].[vehicle].[body] values.

4. Therefore we switch these values around so we get the final value of body.curtain_78 (not forgetting the "." in the middle).


For example, if we wanted to get the cabin types for the default SCS Scania S 2016 truck:

1. Navigate to ...\extracted_139\def\vehicle\truck\scania.s_2016\cabin

You can ignore the sound files as we are only interested in the cabin types: "highline.sii", "highline_8x4.sii" and "normal.sii".

2. So for example if we look at highline_8x4.sii we get the following code:

accessory_cabin_data : highline_8x4.scania.s_2016.cabin

3. For trucks, highline_8x4.scania.s_2016.cabin is the final value and we do not need to change anything (not forgetting each ".").


Step 4) Putting it all together to complete the XML

So after adding all the accessories and all the variants to each of the above. We get the following completed files:

NOTE: These may not be present in the current version of MS2 and are for tutorial purposes only.

ETS2.scs.box.xml

and ...

ETS2.scania.s_2016.xml

This completes how to create a Vehicle XML template manually.