[TUTORIAL] Getting Mods to work in Linux [Most of the steps are no longer needed]

flamesfault

Chieftain
Joined
Jun 16, 2014
Messages
5
I hope I have posted this in the right place. There are few guides already out there which cover the start of this tutorial but they don't mention a problem I have come across with some mods so I thought I might append a solution to the end of this guide.

Mods are disabled by default on Linux as they are not supported by the Aspyr release however it is not difficult to enable them.

First Enabling the mod menu:

Got to ~/.local/share/Steam/SteamApps/common/Sid Meier's Civilization V/steamassets/assets/ui/frontend/ and edit the file mainmenu.lua with your favorite text editor.

On line 41 (for me) you should find this:
Controls.ModsButton:SetHide( true ); -- MAC_PORT - rickb Comment this line out to re-enable mods. Happy modding!
simply add -- on the front so it becomes:
--Controls.ModsButton:SetHide( true ); -- MAC_PORT - rickb Comment this line out to re-enable
and save you should now be able to see the mods menu next time you launch Civilizations.

Installing the mods:

After downloading the mods you want you have to copy them to ~/.local/share/Aspyr/Sid Meier's Civilization 5/MODS and then extract them yourself - windows does this automatically but you have to do it manually on Linux. Note: .civ5mod are just a zip file so unzip or 7zip should work fine.

They should appear in the mods menu like usual so now you just have to enable them.

Getting mods off the Steam Workshop:

Steam does not automatically copy the mods over for you when you subscribe to mods in the workshop under Linux. It is probably easier to get the mods of the forums and install them as described above. However you can still get them from the workshop.

After subscribing to a mod (and giving sufficient time for it to download) navigate to ~/.local/share/Steam/userdata/ in that folder you should see a few more folders named with just random looking numbers. Look inside all the folders until you find another directory named ugc from there go to ugc/referenced/. Where you should find more randomly named directory's :). These are the folders containing the mods you have subscribed to on the workshop.

So check those directory's until you find the mod your after then copy the zip (.civ5mod) over to the mods folder and extract it as explained above.

Fixing Possible Errors:
Note: This part is slightly risky and a bit more complicated so I would only bother if you are having problems with a particular mod and you know what you are doing.

Some of mods including Really Advanced Setup (I haven't tested that many so I am not sure just how many) don't work properly or at all while still working perfectly fine on the mac version of Aspyr's release.

This could be to do with an case sensitive file systems (most people will likely have this on Linux) compared to an insensitive case file system on mac. This is always an issue but I have seen it cause problems when mods use overrides.

Anyway a possible solution is to put the Civ5 config folder in a case insensitive file system. I used a FAT file system and I will give some vague instructions on how to do so (note I am using Arch Linux).

First create an image with dd, 1GB should be sufficient.
dd if=/dev/zero of=civ5.img bs=1 count=0 seek=1G

Now lets setup the loop device:
The command: lsblk should show all the devices in use - if loop0 appears on the list then use loop1, if loop1 appears on the list too then use loop2 etc... for the following command:
sudo losetup /dev/loop0 civ5.img
lsblk should now show loopX in the list (X being the number that was free)

Now the mkfs.vfat command can be found in the package dosfstools (on both debian and arch linux).
sudo apt-get install dosfstools (for ubuntu/debian users)
Then run the command:
sudo mkfs.vfat /dev/loopX

After that is done we can mount the device and copy all the files from ~/.local/share/Aspyr/Sid Meier's Civilization 5/ to the mount piont. This can be done easily with a file manager (see below for the manual way to mount the loop device). You may want to back up your files somewhere else too and once they are copied over you should delete all the files ~/.local/share/Aspyr/Sid Meier's Civilization 5/ and umount the loop device from the temporary mount point: sudo umount /dev/loopX

The only thing left to do is to mount the loop device with user privileges to the config directory ~/.local/share/Aspyr/Sid Meier's Civilization 5/
for me I use this command, but it may be different for you depending on how your user accounts are setup
sudo mount -o gid=users,fmask=113,dmask=002 /dev/loopX /home/<your user name>/.local/share/Aspyr/Sid Meier's Civilization 5/

If you want to run civ5 again after rebooting you will fist have to run sudo losetup /dev/loopX civ5.img again then the above command. You could automate this but it is out of the scope of this tutorial.

End:

Feel free to contact me about running mods on Linux not that I am very experienced and also feel free to comment on or this tutorial (I am sure there are plenty of errors). I hope it is useful to someone.
 
Hey flamesfault, actually a coincidence, I had already started a thread, but in any case linking between the two shall prove useful.
http://forums.civfanatics.com/showthread.php?t=529259
I prefer converting everything to lower case, its pretty easy with a renaming utility, I'd use krename and just a few click and everything, including folders were renamed.
However there's still the modinfo reference to the files which need to be converted, thats where a script would suit best.

Besides that someone told me also about a ciopfs package that also creates a case insesitive file system, but that package doesn't seem to be in debian repos.
Talk to you later
 
Hi gfurst, yea I saw your post but that was first posted a few days after I posted this one. Anyway I think a script is a good idea it shouldn't be too difficult. Does anyone know if the modinfo file is the only one that we would have to change? As far as I can tell this is the case. Therefore a simple script (it might not be that simple, after looking at the modinfo) that goes over the mods directory editing *.modinfo and renaming all files (and directory's) to lower case should work okay. I have some programming skills mainly in C++ so that's not very helpful but I will make a script and upload it if people are interested?

About ciopfs it looks like it would work well but like you mentioned I haven't seen it on any repos so compiling it and getting it to work might be about as much of a hassle as the guide above.
 
Hi guys,

First of all, I want to thank you for sharing all these knowledge and advices. They are very useful.

I bought Civilization V (Vanilla) just a few days ago through Steam. I have Ubuntu 14.04 on my computer and tried to get some mods to work, following the flamesfaut's tutorial, without no success.

The mods menu appears after doing what the first section says, but I have other problems:

1) Seems that Steam does not download the subscribed mods and there is no "userdata" anywhere. So I have to download it from here.

2) The "get mods" button from the mods menu don't let me search for the downloaded files in my system. To make the game itself try to install them. That button just opens the Steam workshop in a new window from the Steam client interface and do not solve the problem that Steam does not download the mods (very annoying loop...).

3) I cannot neither install them manually... There is no "Aspyr" folder anywhere and there is no "MODS" folder in the game directory of my Steam library. I tried to create the MODS folder myself (in my Steam library, which is a different path from indicated by flamesfault. As I said, that one does not exist in my system...) and then place the mods there. I tried compressed and uncompressed but nothing happens .

Any suggestion, please?

---------------------------------

UPDATE (Jun 18, 2015):

Nevermind,

A couple of days after trying by last time. When I was determined to eliminate the subscriptions to the "mods" in the "Steam workshop" and disable the "mods" menu of the game, suddenly, appeared all the mods.

I've been playing for several days with some active mods and everything works fine. Finally I don't need to download the mods manually and the only step of the tutorial that it was not undone before this magical change is the first one to enable the mods menu.
 
Need to use the FAT 32 tricks to use Communitas. Some change to the procedure (debian wheezy, french UTF-8) :

Create the image directly with mkfs to avoid block errors :

Code:
sudo mkfs.vfat -C -F 32 civ5.img 1048576

Put img to loopX

Code:
sudo losetup /dev/loop0 civ5.img

mount in the folder, with user uid to avoid permission problems, iocharset to be non case-sensitive (UTF8 is), and double-quoted path to avoid dir not exist

Code:
sudo mount -o uid=<user name>,gid=users,fmask=113,dmask=002,iocharset=iso8859-1 /dev/loop0 "/home/<user name>/.local/share/Aspyr/Sid Meier's Civilization 5/"

Then just cp your files to the new created dir.
 
I don't know if it's bad manners to necromance this thread, but I also didn't want to create a new one, so I'll just ask here:

I am on Linux and Civilization V worked fine and it could install most of the mods without issue. But for some of them (I think the ones that change the .dll) the game would simply freeze adn crash, examples being: Artificial Unintelligence, Civ IV Diplomatic Features, and R.E.D. I think. Because of this, I started looking into what could be causing this, and I stumbled upon this thread:

https://steamcommunity.com/app/8930/discussions/0/540744299996631016/

In there the 5th post explains how one should be using ciopfs in some manner or other (which is not working, as it simply gives me a "fuse: bad mount point" error code for which I've found no solution), and now Civilization V won't even recognize the mods I'm subscribed to and show them to me in the "Mods" menu option. I even tried subscribing to other new ones and they still won't appear.

Is there any way I could fix all this mess and start playing with mods like Artificial Unintelligence on?
 
Top Bottom