Author: Socrates1984
Original Thread: [Tutorial] How to install mods and submods in Linux (Ubuntu)

(Medieval 2: Total War)

[Tutorial] How to install mods and submods in Linux (Ubuntu)
Contents


IntroductionThis is a tutorial on how to install mods and submods in Linux. I am using Ubuntu (16.04 LTS), but I guess the procedure isn't very different in other distros.

I have only ever installed mods for Kingdoms, but the procedure must be the same for the vanilla game, as long as the mod is mod-foldered.

The procedure to install mods in Linux is more or less unified. This means that most of the times you will have to practically disregard the developers' instructions on where to install the mod. Otherwise, of course, you have to pay close attention to all other things they instruct you to do.
There is only one difference in relation to submods, which will be covered in detail later (in Step 5).

This guide assumes a SteamOS installation. What changes in the CD version of the game is probably only the folder paths, but if anyone tries it out and has any feedback, please share and I will update this post to include the information.

Where applicable, this guide assumes you know how to download a package either through Ubuntu Software or through the Terminal, so that won't be covered here.

Up

1. DownloadFirst, keep in mind that you have to leave your PC in peace when downloading. This means not using the Internet, not playing games, not reading pdfs, not using the Office suite, not having other applications running, not doing anything in general. Just be absent and let it download.

Mod files
Spoiler Alert, click show to read: 
Download the associated mod files. Sometimes the downloaded files are installers (exe files), while other times they are compressed files (zip, rar, 7z and the like). This is important for many reasons, so keep a mental note.

pyRenamer
Spoiler Alert, click show to read: 
pyRenamer is a handy little application one can download from Ubuntu Software Center. It has many other uses, but most of them (except one) is irrelevant to the purpose of this tutorial. Its use will be explained in Step 3.

WINE
Spoiler Alert, click show to read: 
If you are interested in running some of the Windows programs or you are interested in playing some Med2TW mods, you probably already know what this is. If not, shame on you.
Spoiler Alert, click show to read: 
Okay, to elaborate, this is what WINE is.
This link is a bit more technical, but necessary nonetheless.
And if you are feeling lazy, How to install and configure WINE is the absolute must-read. Even if you don't open the other two links, this one you have to open and read carefully, because it explains what version of WINE to install and most importantly how to configure it with WINEtricks, our next prerequisite program.

Just to clarify, installing WINE this way is not required per se for installing mods, but assuming you didn't already have it installed, this is as good time as any to install it properly.

WINEtricks
Spoiler Alert, click show to read: 
This is the program to configure WINE. Otherwise WINE is more or less bare and in any case doesn't have full functionality and potential. Again, it is crucial to read the How to install and configure WINE link provided above, because, well, it worked great for me and I guess it will be the same for you.

About unzipping
Spoiler Alert, click show to read: 
In case you need to unzip the files that you downloaded, you don't need unzip, unrar, 7zip or any program like that, because the default Archive Manager does it all.

Up

2. Starting placementHow to run the installer or extract the compressed file
Spoiler Alert, click show to read: 
In case the downloaded file is an installer, you right click on it and select Open with Wine Windows Program Loader. Otherwise, if the downloaded file is a compressed file, you simply extract it by double clicking.

Now, we come to our first potential pitfall. You have to install or unzip the files in a different location. Yes, you follow precisely the mod's instructions except for the installation path.
Spoiler for Example for TATW and Thera
TATW's installation details instruct you to install the mod in the vanilla game folder, i.e. in .../Medieval II Total War. This means that the folder path in the installer should end with that folder. Don't do this.

Another example, with a zip file this time, is that of Thera. You are instructed to extract the contents of the file inside the mods folder, i.e. in .../Medieval II Total War/mods. Don't do this.
You install or unzip to a different folder, completely irrelevant to the whole of the Med2TW folder. I usually choose a folder in my /home/ folder that I created for this purpose only, but it can be any folder of your liking. Why you have to do this is explained in Step 5.

Up

3. Lower casesAs you probably already know, Linux is case sensitive. In order for the installation to work, all files and folders have to be lower case. There are two ways to accomplish this and they are explained in order from easiest to hardest.

The easiest way
Spoiler Alert, click show to read: 
The easiest way is using a convenient little program called pyRenamer. Despite having to download this package, this method is labeled as the easiest because you don't have to actually type anything. After having downloaded it, you have to do the following:
  1. Open it.
  2. In the Options menu select Files and Directories.
  3. Navigate to the folder.
  4. Tick the option Add files recursively. It might take some time.
  5. Go to the Substitutions tab, tick Capitalization and in the drop-down menu that appears select All downcase.
  6. Select Preview. It might take some time.
  7. Select Rename. You guessed it, it might take some time. There is no notification that the process has ended, so be sure to check when the little bar at the bottom of the screen has stopped moving.
  8. Exit and you're done.

Spoiler for pyRenamer picture
The standard way
Spoiler Alert, click show to read: 


  1. Open a Terminal. In Ubuntu this is done by pressing Ctrl + Alt + T
  2. Navigate to the folder where you placed the mod in Step 2. You can do this by using the cd command. So, an example could be:
    Code:
    cd ~/temporarymods/tatw
  3. Once you do that you will want to run this command:
    Code:
    find ./ -depth -exec rename 's/(.)/([/])/$1/\L$2/' {} \;

I have never managed to make this work, but it has reportedly worked for everyone else. It might take a very long time, so wait.
Whatever of the above options you choose to follow, don't forget to manually rename the mod folder itself, because it's not done automatically.

Up

4. Final placementYou now have the mod in a separate folder and all its files and folders are lower case. Now, it's time to move it.

Copy or cut it and paste it in the mods folder of your Medieval II Total War folder. So, here is an example of a correct placement:
Code:
.../Medieval II Total War/share/data/mods/
In any case, your mod should be next to americas, british_isles, crusades etc.

Up

5. Full permission and submodsThis step applies mainly if you are installing a submod. Do it anyway as you never know what might happen in the future with probable submods of the mod you just downloaded. If you do know what will happen in the future, please tell me if I will become rich.

Aaaanyway. There are sometimes some mod files that are read-only. In Linux this is interpreted as permissions. If you have limited permissions in the mod folder, then some of the files will not be overwritten, because you are not asked a question to overwrite them too or not. So, before overwriting your mod with the submod files and folders, as per Step 4, be sure to:
  1. Right click the mod folder, e.g. third_age_3, therav4 etc.
  2. Select Properties.
  3. Select the Permissions tab.
  4. Select Create and delete files for the Owner.

The reason why we installed the mod in a different folder is twofold: To give full permission to the mod folders and to avoid duplicate files. The latter would happen if you tried to lower case the submod after its placement in the mod. Trust me.

Up

6. Start through SteamThis one is easy. We are almost there, so just hang on there for a while longer.

  1. Open Steam.
  2. Go to Libraries>Games.
  3. Right click Medieval II Total War and go to Properties.
  4. Select Set Launch Options...
  5. Paste this line in the popup window:
    Code:
    --features.mod=mods/modname
  6. Replace the modname with the mod's name in the folders.
  7. Start the game through Steam.

Up

7. Secret Step
Spoiler Alert, click show to read: 
Spoiler Alert, click show to read: 
Spoiler Alert, click show to read: 
Enjoy!

Up

Useful Notes
  1. For me, it all started here.
  2. Feral Interactive gave the spark though.
  3. Mishkin has found a way to install TATW using the CD version of the game. I guess it works for other mods too, although I have never tested it.
  4. As always I will be happy to update this tutorial with any feedback that fits into it.
  5. A future update will include a way to make all files and folders lower cased by using a java script provided by Gigantus.

Up

Thanks
I have to first thank Gigantus for all his help with this project.
Withwnar and Ngugi had very good insights on how to avoid mishaps.
I had to not listen to Veteraan for not posting a new thread about this . Although, at that time he was right and he has been very supportive ever since.
I probably forget some of the good people that helped me around and I apologize.