Tutorial: Customize the texture of mods easily


 

Hello friends:

In this tutorial, I will attempt to teach you how to customize many of the mods available for Transport Fever 2 by changing textures to your liking.

The reason behind this is that when I create a mod for a building and then make 5 or 6 variants, it always feels like there are hundreds of possibilities left unexplored. Moreover, the only limit is your own creativity. That’s why I hope this tutorial will empower you to personalize buildings. I guarantee that you’ll enjoy doing it and seeing the results.

Before we begin, it’s important to know that mods can be textured in various ways:

  1. Baked Textures: This method involves creating a UV map for all the textures and placing them in a single image.
  2. Procedural Textures: Each object can use a material, and each material can have an albedo texture, a metal_gloss_ao texture, and a normal texture. (This is the model we’ll be able to customize.) Typically, we’ll use in-game textures to save space in the mod. However, we can also use custom textures we’ve created or acquired elsewhere.

Make sure you have the Model Editor perfectly installed. By default, I have it installed in D:\Steam\userdata\969292575\1066780\local\staging_area. The drive letter (D) may vary if you’ve installed it on a different hard drive. Also, the Steam user number will be your own. If you have the game installed from GOG, for example, I’m not sure where it would be located, but there are likely tutorials on how and where to install it.

For image editing, I use GIMP, a free program similar to Photoshop. However, we’ll cover this in another tutorial.

Let’s get started… 🚂🏢


For this tutorial we are going to use the latest mod that I have created that you can download here.

The mod is called Kibri Apotheke. It is a model created by kibri of a building with a timber frame and a pharmacy. We are going to create 4 more variants by changing textures and in this case each building will have a different shop. (A model shop, a toy shop, a florist and a bookshop) we could do whatever we want.

Once the mod is downloaded, we unzip it and we will have the folder kibri_apotheke_1 that we would place in the mods folder. but in this case we are going to copy it to the folder D:\Steam\userdata\969292575\1066780\local\staging_area\

Now what we are going to do is make 4 copies of the mod but changing certain names so that when we modify something in one it does not affect the others.

When we open the folder kibri_apotheke_1 we see another folder called res, a file called mod.lua (which is like the presentation of the mod where the name, description and authors are and another file called image_00.tga which is the photo that we are going to see in the mod selection.

We open the res folder and we see 3 other folders:

Construction, models and textures




  • Open the “construction” folder, then navigate to the “asset” subfolder. You’ll find a file named “kibri_apotheke.con.” Make four copies of this file. Next, rename each copy as follows:

    • kibri_apotheke.con
    • kibri_apotheke2.con
    • kibri_apotheke3.con
    • kibri_apotheke4.con
    • kibri_apotheke5.con

    You can adjust the names as needed, but let’s keep it simple for now.

  • Open each of these copied files using Notepad (or any text editor). We’ll modify a few parameters, mainly changing names to differentiate them:

    • Locate the section that looks like this:

      Lua
      description = {
          name = _("kibri_apotheke"),
          description = _("kibri apotheke"),
          icon = "ui/construction/asset/kibri_apotheke.tga"
      },
      
    • Change it to:

      Lua
      description = {
          name = _("kibri_apotheke2"),
          description = _("kibri apotheke2"),
          icon = "ui/construction/asset/kibri_apotheke2.tga"
      },
      
    • Similarly, find this line:

      Lua
      result.models[#result.models + 1] = {
          id = "kibri_apotheke.mdl",
          transf = transf.scaleRotZYXTransl(
              vec3.new(scalingBuildingX, scalingBuildingY, scalingBuildingZ),
              transf.degToRad(0, 0, 0),
              vec3.new(0, 0, 0)
          )
      }
      
    • Replace it with:

      Lua
      result.models[#result.models + 1] = {
          id = "kibri_apotheke2.mdl",
          transf = transf.scaleRotZYXTransl(
              vec3.new(scalingBuildingX, scalingBuildingY, scalingBuildingZ),
              transf.degToRad(0, 0, 0),
              vec3.new(0, 0, 0)
          )
      }
      
    • Save the changes.

  • Repeat this process for each .con file, changing the “2” to “3,” “4,” or “5” as needed.

  • Now, let’s move to the “models” folder:

    • Inside, you’ll find three subfolders:
      • material
      • mesh
      • model
    1. Open the “material” folder, and you’ll find the folder named “kibri_apotheke.”

      • Make a copy of this folder and paste it four times.
      • Rename each copy as follows:
        • kibri_apotheke2
        • kibri_apotheke3
        • kibri_apotheke4
        • kibri_apotheke5
    2. Go back to the “models” folder and open the “model” subfolder.

      • Inside, you’ll find the file named “kibri_apotheke.mdl.”
      • Make four copies of this file.
      • Rename each copy as follows:
        • kibri_apotheke2.mdl
        • kibri_apotheke3.mdl
        • kibri_apotheke4.mdl
        • kibri_apotheke5.mdl
    3. Open the file “kibri_apotheke2.mdl” with Notepad (or any text editor).

      • In the file, go to the “Edit” menu and select “Replace.”

      • Replace all instances of:

        materials = { "kibri_apotheke
        

        with:

        materials = { "kibri_apotheke2
        
      • Save the changes.

    4. Repeat this process for the other .mdl files, changing the “2” to “3,” “4,” or “5” according to the file number.

      • Be extremely careful because in the LUA language, even a comma or a space can cause the mod to malfunction.
    5. Now we’re ready to modify the models in the editor.

      • Open the editor and select the mod you want to edit. In this case, it’s “kibri_apotheke_1.”

      • I’ve created a video tutorial for this: Watch the video tutorial

    Remember to proceed with caution, and have fun customizing your models! If you need further assistance, feel free to ask. 🏢🔧

    NOTE: If you only want to modify the existing models, you can skip the entire first process and simply edit the models in the editor.



    Comments