Author Topic: Nested directories and a MODS folder  (Read 2100 times)

0 Members and 1 Guest are viewing this topic.

Offline MP-Ryan

  • Makes General Discussion Make Sense.
  • Global Moderator
  • 210
  • Keyboard > Pen > Sword
    • Twitter
Nested directories and a MODS folder
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: [Select]
[multimod]
secondarylist = Mods\mediavps;

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: [Select]
[multimod]
secondrylist = Mods\fsport,Mods\mediavps;

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: [Select]
C:\StrcApps\FreeSpaceOpen\fred2_open_3_6_9.exe -fredhtl -jpgtga -mod Mods\wips\Warzone,Mods\mediavpsTo 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]
"In the beginning, the Universe was created.  This made a lot of people very angry and has widely been regarded as a bad move."  [Douglas Adams]

 

Offline Turey

  • Installer dude
  • 211
  • The diminutive form of Turambar.
    • FreeSpace Open Installer Homepage
Re: Nested directories and a MODS folder
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.
Creator of the FreeSpace Open Installer.
"Calm. The ****. Down." -Taristin
why would an SCP error be considered as news? :wtf: *smacks Cobra*It's a feature.

 

Offline MP-Ryan

  • Makes General Discussion Make Sense.
  • Global Moderator
  • 210
  • Keyboard > Pen > Sword
    • Twitter
Re: Nested directories and a MODS folder
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.

Good points, both, though I was actually going to suggest that this might be a good direction for the installer to move in eventually.
"In the beginning, the Universe was created.  This made a lot of people very angry and has widely been regarded as a bad move."  [Douglas Adams]

 

Offline ARSPR

  • Preys On Mantis
  • 29
Re: Nested directories and a MODS folder
I've just added info about nested directories in -mod flag help in Wiki.
IF YOU HAVE TROUBLES WITH FS2:
  • Please, please, please, READ and UNDERSTAND the sticky threads in FreeSpace & FreeSpace Open Support board.
    A lot of people are willing to help you, but, as anyone can understand, seeing the very same "issues" repeated again and again can become quite depressing. Please, spend a bit of time trying to solve the issue by yourself.
    (Lobo deserves a monument).
  • Then, if you aren't still able to solve your issue, feel free to ask for help in that same board.
    FYI, most of the troubles are caused by wrong mod installations which lead to either missing data or undesired cross-effects between them. Always follow the mod installation instructions and keep a clean FS2 installation as explained in the sticky threads. Two additional links about how the game handles game data:
  • If you think that you've discovered a bug, mantis it.
    Provide as much info as you can, and try to narrow it down. A lonely "FS2 doesn't work" is not a good report.

Whoever Hanlon was: Never attribute to malice that which can be adequately explained by stupidity.
Albert Einstein: Two things are infinite: the universe and human stupidity; and I'm not sure about the the universe.

Dell Dimension 9200 - Vista 32-bit Ultimate
Core 2 Quad Q6600 @2.4GHz - RAM 2 GB DDR2
nvidia 8800 GTX - Integrated Sigmatel Audio

 

Offline taylor

  • Super SCP/Linux Guru
  • Moderator
  • 212
    • http://www.icculus.org/~taylor
Re: Nested directories and a MODS folder
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.

 

Online jr2

  • The Mail Man
  • 212
  • It's prounounced jayartoo 0x6A7232
    • Steam
Re: Nested directories and a MODS folder
Cool.  :cool:  :pimp:

 

Offline RazorsKiss

  • 27
  • The Cutting Edge
    • RazorsKiss.net
Re: Nested directories and a MODS folder
Yes, very good :D

 

Offline MP-Ryan

  • Makes General Discussion Make Sense.
  • Global Moderator
  • 210
  • Keyboard > Pen > Sword
    • Twitter
Re: Nested directories and a MODS folder
I've just added info about nested directories in -mod flag help in Wiki.

Only problem with that entry that I can see is all your slashes are /, whereas in a Windows environment (that most users use), you need a \ for paths.

I added a line noting that.
« Last Edit: June 23, 2007, 01:17:00 pm by MP-Ryan »
"In the beginning, the Universe was created.  This made a lot of people very angry and has widely been regarded as a bad move."  [Douglas Adams]

 

Offline ARSPR

  • Preys On Mantis
  • 29
Re: Nested directories and a MODS folder
I've just added info about nested directories in -mod flag help in Wiki.

Only problem with that entry that I can see is all your slashes are /, whereas in a Windows environment (that most users use), you need a \ for paths.

I added a line noting that.

You didn't see it but it was noted in Additional notes. But it feels better suited where you've placed it. :p
IF YOU HAVE TROUBLES WITH FS2:
  • Please, please, please, READ and UNDERSTAND the sticky threads in FreeSpace & FreeSpace Open Support board.
    A lot of people are willing to help you, but, as anyone can understand, seeing the very same "issues" repeated again and again can become quite depressing. Please, spend a bit of time trying to solve the issue by yourself.
    (Lobo deserves a monument).
  • Then, if you aren't still able to solve your issue, feel free to ask for help in that same board.
    FYI, most of the troubles are caused by wrong mod installations which lead to either missing data or undesired cross-effects between them. Always follow the mod installation instructions and keep a clean FS2 installation as explained in the sticky threads. Two additional links about how the game handles game data:
  • If you think that you've discovered a bug, mantis it.
    Provide as much info as you can, and try to narrow it down. A lonely "FS2 doesn't work" is not a good report.

Whoever Hanlon was: Never attribute to malice that which can be adequately explained by stupidity.
Albert Einstein: Two things are infinite: the universe and human stupidity; and I'm not sure about the the universe.

Dell Dimension 9200 - Vista 32-bit Ultimate
Core 2 Quad Q6600 @2.4GHz - RAM 2 GB DDR2
nvidia 8800 GTX - Integrated Sigmatel Audio