- Data search paths
SupCom allows you to specify arbitrary paths to find data, and gives you complete control over what paths to look for data and in what order they are to be searched. This is especially useful for total conversions of the game where you want to use the executable, but provide all your own assets. For the time being, until the mod manager is overhauled, it's also the best way to do directory shadowing (much cleaner than adding directories to the installed game path.) There are two methods you can specify search paths.
Command line switch /data [directories split by semicolons]
The data command line switch allows you to specify all the directories that will get searched for data. It's important to note that if you specify a data command line that it will
NOT append the original game directories. You need to add them yourself. The directories are specified as either fully qualified paths or paths relative to the executable. The directories are read in order that they are listed, so if you want to shadow a file, make sure you include its path first.
So for example, you have your mod in a directory c:\mymod, and you want to shadow the aitypes.lua file (found in
c:\mymod\lua\modules\ui\lobby), but use the rest of the SupCom data you could use a command line like this:
SupremeCommander.exe /data c:/mymod;../gamedata/*.scd;..
- The first path is just the direct path to our mod. The disk system will expect to find directories and files that correspond to the locations of different data file types.
- The second path shows how to map the scd files. When the disk systems sees *.scd it now knows that there will be files named for the top level directory structure of the data and that they are zip files containing the rest of the directory structure in them. For example, in your script, when you specify a path "/lua/modules/ui/lobby" and it's in an scd file, it would expect to find it in a file called lua.scd, and in the zip archive it would be in /modules/ui/lobby.
- The third path shows how we magically read in files when you extract them to the tld.
Command line switch /init [lua file]
Another way to specify data directories is with the /init command line. All that you need to provide is a fully qualified path and file name for a lua file which contains the table of paths. The default file is the SupComDataPath.lua which is found in the bin directory of your game install. The file itself should just be a simple table called "path" and will be structured as follows. Note that the array index denotes in what order the path will be sarched (smallest first.)
Code:
path = {
"c:/mymod",
"../gamedata.*.scd",
"..",
}
This will have exactly the same effect as the /data example.