General FreeSpace > FreeSpace & FreeSpace Open Support

Nested directories and a MODS folder

(1/2) > >>

MP-Ryan:
Since this isn't in the stickied topic above, I figured some people might be interested.

FSOpen allows for nested folders, which if you're a clutter/backup freak like me, is a very nice feature.  When I want to back up all my Mods, I simple have to copy one folder.  Additionally, since it's all nested, I know that as long as the command line is bare of mods references, there is nothing affecting my FS2 install to cause it to go haywire (which is great for testing purposes).  Here's how to set it up:

In your FreeSpace directory, create a folder titled Mods, or MODS (case isn't terribly important, just remember it has to be consistent).

Place all add-ons in the Mods folder, each with their own appropriately named folder.  Attached is a screenshot of my directory structure as an example.  My media VP files, for example, are located in Mods\mediavps.  Note that you can also include a data subdirectory for each mod, and the appropriate subfolders in that tree.  As such, I have the LS nebulae in Mods\mediavps\data\effects.

The file structure is easy, and the setup is only slightly more challenging for a basic user.  Now we have to set up the appropriate commandlines.  Fortunately, we have mod.ini files which make this rather simple.  You won't need a mod.ini file for something like the mediavps as they are always a secondary mod, but you will need it for user campaigns.  As such, the example I'm going to take is the FSPort.

If your FSPort is located in Mods\fsport, you need to open its mod.ini file and add or change the multimod line as follows:

--- Code: ---[multimod]
secondarylist = Mods\mediavps;
--- End code ---

Simple enough.  This is equally possible with a mod like Cardinal Spear, which uses the FSPort and the media VPs.  In this case, you would change it's mod.ini as follows [please note that the misspelled secondarylist works just as well as the correct spelling):

--- Code: ---[multimod]
secondrylist = Mods\fsport,Mods\mediavps;
--- End code ---

It is even possible to use multiple nested directories, as I will demonstrate with the FRED command lines.  It, too, accepts the nested format.  Here is an example of the flags for my FRED shortcut for Warzone SCP:

--- Code: ---C:\StrcApps\FreeSpaceOpen\fred2_open_3_6_9.exe -fredhtl -jpgtga -mod Mods\wips\Warzone,Mods\mediavps
--- End code ---
To make such a shortcut, right-click on your FRED executable and select "send to desktop as shortcut."  Then find the shortcut, right-click on it, and select Properties.  You then add the flags following the EXE path in the 'Target' field.  This shortcut can then be placed anywhere you please, even in the Start Menu.

Using this sort of structure, it is possible to confine ALL elements which are not part of your basic FS2 install to a single folder.  This not only makes testing and removal a breeze, but backing up all your non-standard files is now as simple as copying one folder.  The only drawback is that you must modify mod.ini files and FRED command lines, but anyone with even a basic knowledge of Windows is quite capable of doing this.

[attachment deleted by admin]

Turey:
Two things you didn't mention:
1. For people not on Windows, it's likely going to be a forward slash. Seems obvious, but it's worth mentioning.
2. This will interfere with the Installer and other programs that expect files to be in a certain place.

MP-Ryan:

--- Quote from: Turey on June 17, 2007, 11:14:04 pm ---Two things you didn't mention:
1. For people not on Windows, it's likely going to be a forward slash. Seems obvious, but it's worth mentioning.
2. This will interfere with the Installer and other programs that expect files to be in a certain place.

--- End quote ---

Good points, both, though I was actually going to suggest that this might be a good direction for the installer to move in eventually.

ARSPR:
I've just added info about nested directories in -mod flag help in Wiki.

taylor:
There is already a basic plan to build this into 3.7.  I coded it all up last summer, but since it breaks things, it was decided to just hold on to the changes and introduce them later on.

Basically the game would just default to always using "mods/" as the location under which any -mod will be found.  So "-mod mediavps" would actually access "mods/mediavps/".  The "mods" part would be transparent to the user and be what the game itself uses instead.  This keeps things clean by default, as well as helping to keep everyone using the same directory structure.

Navigation

[0] Message Index

[#] Next page

Go to full version