Skip to content

RecommendedProjectLayout

Christian Haas edited this page Dec 28, 2020 · 3 revisions

This page describes how a mod should ideally be structured in the file system and how it should be distributed. This applies for both "mods" and "missions" (as defined by "System Shock Enhanced Edition Source Port").

Folder/File structure

%APPDATA%\Nightdive Studios\System Shock EE\mods\fancy-intro
  fi-data\
    svfrintr.res
    svgaintr.res
    svgeintr.res
  mod.as
  fancy-intro.hacked-project

The resource files are stored in a sub-folder. The name of this sub-folder should be semi-unique. For example, use some abbreviation of the name of the mod. While the script in mod.as allows to use "any" name, by sticking to the original file names you can directly load the fi-data folder as the mod in the editor, without the need to rename all the files all the time. It is also necessary to put them into a separated directory, as together with the sub-folder name, they have a "unique" filename when loading them. Otherwise the engine would think you are referring to the original files.

This setup allows for keeping all the information, including the .hacked-project file under version control. Note that with a nested resource folder, the project file stores a relative path, making the package transferrable between computers.

mod.as would look like this:

...
void LoadMod(void)
{
    kStr scriptDir;    
    Sys.GetCvarValue("script_dir", scriptDir);

    DatapathAdd("mods", scriptDir);
}

void ChangeLanguage(void)
{
    kStr lang;
    Sys.GetCvarValue("language", lang);

    if (lang == "french")
    {
        RestabSetBase("svga_intro", "fi-data/svfrintr.res");
    }
    else if (lang == "german")
    {
        RestabSetBase("svga_intro", "fi-data/svgeintr.res");
    }
    else // default to english
    {
        RestabSetBase("svga_intro", "fi-data/svgaintr.res");
    }
}
...

Variation for a mission

The concept with the sub-folder stays the same for a mission. The mission.as file would have a line such as this:

void LoadMission(void)
{
    kStr scriptDir;    
    Sys.GetCvarValue("script_dir", scriptDir);
    DatapathAdd("savegame", scriptDir);

    DatapathAdd("res", scriptDir);
    RestabSetBase("mission", "fi-data/archive.dat");
    ...

Distribution package

Create a .zip file of the mod/mission folder (excluding the .hacked-project file), and add a README.txt to the root of the archive file. Example:

fancy-intro-v1.0.0.zip:

fancy-intro\mod.as
fancy-intro\fi-data\...
README.txt

The readme file should then contain instructions about copying the entire fancy-intro folder into the mods folder.

Clone this wiki locally