Civ4 Customasset Quick Change

ruff_hi

Live 4ever! Or die trying
Joined
Oct 24, 2005
Messages
9,134
Location
an Aussie in Boston
I’ve developed a few mods in my time, usually sticking them in the customasset folder. Its quick, its easy and they are in-play with all non-locked games. The one main problem is that I typically end up with lots of mods that I could run under customassets. If I download a mod that I want to test, I have to move my customasset based mod, swap in the new one and load up the game. I usually ended up with multiple customasset folders and keeping track of what was what did get difficult at times. I also got really bored with renaming the folders.

So, I developed a customasset folder naming convention. Then I wrote a silly little VB program to automate the renaming step. Lastly, I created different in-game color themes that enabled me to tell at a glance which mod was in my customasset folder. This is really useful when you are playing a Realms Beyond game and you don’t want your game to end up as a ‘shadow’ because you played a non-approved mod.

Folder Naming Convention

The customasset naming convention I use is fairly straight forward. I have created a dummy folder (customasset-current-XYZ) that describes which mod is currently in my customasset folder (in the example above, my customasset folder would hold the mod XYZ). The other possible mods are then stored in folders that also start with customasset (eg customasset-ABC).

I typically create an empty customassets (‘customasset-null’) for when I want to play the game with no customasset based mod.

Installation Instructions

This program can be installed anywhere. It will self create the ini file the first time you run it. The install can be found here.

Spoiler Other Stuff :

Link to zip file of a PDF that describes the mod and includes screenshots.
Version 1.0
No Know Bugs
No Know Issues
 
With my customassets set up as shown above, I can tell at a glance which mod is ‘active’ and I can also swap in another mod using the following steps:
  • Grab the name of the current mod from ‘customasset-current-XYZ’ (XYZ in this case)
  • Rename ‘customasset’ to ‘customasset-XYZ’
  • Grab the name of the mod I want to swap to (ie ABC from ‘customasset-ABC’)
  • Rename ‘customasset-current-XYZ’ to ‘customasset-current-ABC’
  • Rename ‘customasset-ABC’ to ‘customasset’

The actions outlined above are the basic steps that my VB program automates. It is a little bit more complicated than that as I also want to be able to handle the three different versions of Civ4. I also wanted to give the user the ability to put this VB program anywhere and to also have Civ4 installed anywhere.
To do this, the VB program (‘Civ4Customassets.exe’) has an ini file (‘Civ4Customassets.ini’) that is in the same folder at the ‘exe’ file. If it is not present, the exe file will create one for you but it asks for your windows user name and ‘guesses’ on your civ4 folders (you should check the ini file to see if it guessed correctly). You should follow steps 1 and 2 above to swap mods.

Step 1 – Select the Version of Civ4

After loading, the program will check which versions of Civ4 are loaded on the computer (Vanilla, Warlords, Beyond the Sword). If it only finds 1 version, it will skip Step 1 by automatically selecting that version. If it finds multiple versions, you will have to select which version of Civ4 you want to work with.

Step 2 – Swapping Mods

Once you have selected which version of Civ4 you are working with and assuming your have created your customasset folders with the naming convention above, the program will tell you which is your current mod and list the options that you might want to swap to. You can swap to any of the mods listed by double clicking that mod.

Command Line Options

You can also issue instructions to the program from the command line. If you include ‘[XYZ][ABC]’ in the command line, then the program will make mod ‘ABC’ the active customasset for Civ4 version ‘XYZ’ (‘Van’, ‘War’ or ‘BtS’). The program will check that the command line is valid, that the civ4 version ‘XYZ’ exists and that the customasset ‘ABC’ is not already active and exists.
 
Themes

As stated above, I have also linked theme files with my mods. I did this by creating various different theme files under the theme folder that have the mod name included in the file name (ie ‘Civ4Theme_Common-XYZ.thm’ would be associated with the mod stored in ‘customasset-XYZ’).

To create a custom theme file, either edit the file by hand (difficult) or use civscale to help you (much easier, but take a copy of the default file first) and rename the resulting theme file with a suitable name. The theme folder for vanilla Civ4 on my pc is ‘C:\Program Files\Firaxis Games\Sid Meier's Civilization 4\Resource\Themes\Civ4’.



WARNING: This component of the customasset swapping program is OPTIONAL. However, if you decide to use this component, you MUST copy the current ‘Civ4Theme_Common.thm’ file and rename it to ‘Civ4Theme_Common-Null.thm’.

My VB program would check if a linked theme existed and would copy that file to the theme file used by the game. If no linked theme file existed, it would use the original theme file (‘Civ4Theme_Common-Null.thm’).

I typically use color based themes so that I can quickly tell which mod I am running.

Theme I use when playing with a no Customasset mod.



Theme I use when playing with Ruffmod (or BUG) Customasset mod.



Theme I use when playing with Realms Beyond Customasset mod.

 
Can this be used to selectively run BTS with the Blue Marble mod for single player games and disable Blue Marble for multi-player games? (until a Firaxis fix is released that will permit Blue Marble to work in a multi-player game)
 
Can this be used to selectively run BTS with the Blue Marble mod for single player games and disable Blue Marble for multi-player games? (until a Firaxis fix is released that will permit Blue Marble to work in a multi-player game)
Yes ... assuming you have BM installed under a customasset and a null customasset. However, you have to set up the various customasset folders required.
 
Great program Ruff.:) Wonder why it took so long for someone think of it!

@KK - I don't think it would work because it does change some files in the Assets folder in the root BTS directory of the game.:(
 
hey - I have a new version of this available (command line options not added yet) and I was wondering if someone wanted to test it for me?
 

Attachments

  • Civ4CA_Installer.zip
    163.2 KB · Views: 132
Note: I've just moved to Vista only to find that it doesn't like writing files to the 'my prog' location - the location I was using to store stuff. Well, it appears that Vista writes this stuff to a different location ...

After reading a few items on the web ...

"The files in Program Files and your root C drive are not writiable by non-administrative programs because the files in these areas affect every user and the entire system.

Allowing unpriviliged programs write access to these areas would allow them to overwrite/replace well-known programs or system-wide configuration data used by windows or well-known programs, which is unacceptable for a program that does not prompt. "


Well - it works, but you will have to look for the XML data file under the user profile folder ... for me, that is ...

'C:\Users\<username>\AppData\Local\VirtualStore\Program Files\Civ4CustomAssets'

This isn't a biggie except that it breaks the 'theme' concept. I cannot rename / copy the themes under the 'my progs' install directory. So you will have to just stick with one theme. Does anyone have a suggestion for overcoming this?
 
The "proper" way to do it is to run your program as an Administrator. You can either right-click the icon and choose "Run as Administrator" instead of the normal double-click, or you can have it always run at Administrator level by right-clicking, bringing up Properties, and checking "Run this program as an administrator" on the Compatibility tab. Then when you do run the program, you'll get the standard UAC confirmation prompt but it will be able to modify the files in-place.

Another option is to remove the security restrictions; this is riskier but more convenient. On my Vista system, I got tired of some mods/scenarios (e.g. Age of Ice) requiring BTS to be run at Administrator level so I went and explicitly removed the Administrative protections from my Civ4 folder. To do that, you want to right-click the "Sid Meier's Civilization IV" folder in Program Files, go to the Security tab, and then Edit the permissions to allow Full Access for the Users group. Now I can screw up my Civ4 files any way I please without that annoying OS Nanny slapping my wrist. ;) Some people even go so far as to disable the UAC security system entirely, but I honestly don't mind it for most cases.
 
ah - good to know. I'll play with it because I really liked being able to change the theme on the fly.
 
no. Tried but it didn't work. I'll take another look.
 
Top Bottom