Mod file directory redirector

I have written an utility that allows you to specify the directory in which you place any Saints Row IV mod files, instead of putting them in the usual SRIV program directory. This means that any loose mod files are neater as they aren't mixed up with the game files and modders can quickly switch between mods without having to move files around.

It works by hooking the steam_api.dll and intercepting any filing system calls. If the file name is a mod file then it gets redirected to your specified directory. You can set 2 levels of redirection. So you can have a shared base directory and a test directory.

You can specify the directory of the mod files by using the SRIV command line. i.e. in Steam select properties then Set Launch Options ...

The syntax is:

-loosebase:<path of the base directory file>

This sets the base directory for your mods. You can set it to -loosebase: if you wish to use the vanilla directory for the base i.e. the Saints Row root directory.

-loose:<path of the loose mod files directory>

This will set the directory for the second level of redirection. The game will look in this directory first. If the file doesn't exist then it will look in the base directory. Finally if the file is a vpp_pc file and it doesn't exist in the base folder it will look in the game's vanilla packfiles\pc\cache\ folder.

If you set the -loose directory but not the -loosebase directory, the game will use the -loose directory as the -loosebase directory.

-looselist:<file path of the mod file directory list file>

This will allow you to use a simple text file to tell the game which directories to look for mod files in. The text file is just a list of directories, with each directory on it's own line. The first directory in the list has the highest priority, with the priority decreasing as it goes down the list.

If you wish to include the vanilla directory in the search then type a single period "." for the directory and it will search the default Saints Row directory.

Using -looselist will override the -loose and -loosebase settings. However it will be overidden when using the -vanilla parameter.

If the file you specify doesn't exist or is blank then the game will act as if you used the -vanilla parameter. Adding this parameter will override all other parameters.

-vanilla

This will stop the game from loading any mod files including any in the vanilla game directory. Basically it will start the game completely unmodded.
{It won't work with any vpp_pc files that have been altered in the vanilla game's directory).

Adding this parameter will override all other parameters.

Please make sure you follow the installation instructions in the read me properly i.e. make sure you rename steam_api.dll to steam_old.dll before copying over the new steam_api.dll file.

I've included the source code with the utility if you are curious in how it works.

This is very much an experts only utility so if any of the above doesn't make sense it probably not for you.

I've created a GitHub repository for the project. This will contain the most up to date version of the source code and as such may not be stable. (It's basically the code I'm currently testing). Any stable releases I'll post to the forum.

The current version is version 3.
 

Attachments

  • SR4 Redirection 1b.7z
    43.9 KB · Views: 658
  • SR4 Redirection 3.7z
    68.5 KB · Views: 804
Last edited:
It will support any file that is normally placed in the Saints Row IV directory i.e str2_pc, xtbl, asm_pc etc ... it will also support \table\ files.

Supporting vpp_pc files is a bit more tricky as you probably don't want to duplicate all the existing vpp_pc files for each mod directory you have. So the utility will have to do something like look in your mod directory first and if the vpp_pc file doesn't exist then look for it in the default game directory.

It's not too difficult to program but I wanted to make sure there were no problems with the core program before doing anything more complex.
 
It will support any file that is normally placed in the Saints Row IV directory i.e str2_pc, xtbl, asm_pc etc ... it will also support \table\ files.

Supporting vpp_pc files is a bit more tricky as you probably don't want to duplicate all the existing vpp_pc files for each mod directory you have. So the utility will have to do something like look in your mod directory first and if the vpp_pc file doesn't exist then look for it in the default game directory.

It's not too difficult to program but I wanted to make sure there were no problems with the core program before doing anything more complex.

ah thats fair enuf, sounds like alot of work :p
and I still dont know if it supports cpeg/gpeg as I know theyr not normaly droped into SRIV root but I always drop them in ther to test before I repack them and they are what id find this most handy for :D
sorry for all the questions to lol
 
It doesn't change how the game processes the files just the directory it looks for them in.

So if putting the cpeg/gpeg files in the game's directory before installing this utility didn't work, it still won't work after you install this utility. If they did then they will still work when moved to the redirected directory.

(Usually cpeg/gpeg files have to be packed into a str2_pc file. I think there are a few situations where you can use them outside of a str2_pc file like the ones in the misc.vpp_pc file).
 
Why hasnt anyone thought of this before?!

Ill definitely be using this; verifying integrity if I mess up takes ages this will save me a hell of alot of effort

Great work Scanti, this mod is appreciated, keep it coming! :D
 
It doesn't change how the game processes the files just the directory it looks for them in.

So if putting the cpeg/gpeg files in the game's directory before installing this utility didn't work, it still won't work after you install this utility. If they did then they will still work when moved to the redirected directory.

(Usually cpeg/gpeg files have to be packed into a str2_pc file. I think there are a few situations where you can use them outside of a str2_pc file like the ones in the misc.vpp_pc file).

Im saying droping them in the root does work :p thats why I was asking does this work for them, all the cpegs iv come across work from root, I was told by voltion staff to do it that way to test
 
Why hasnt anyone thought of this before?!

I was sort of hoping Volition would add the feature themselves.

Im saying droping them in the root does work :p thats why I was asking does this work for them, all the cpegs iv come across work from root, I was told by voltion staff to do it that way to test

Ah I never knew that. In that case they should also work when put in the redirected directory. If they don't then let me know.
 
Back
Top