Skip to content

Mod Workspace Structure

ShinyHobo edited this page Mar 12, 2024 · 17 revisions

Mod Workspace Structure

Image depicts the structure of the Mod Workspace for CommunityLibrary, showing a Localization, Mods, and Public main folder, and their contents.

The Multitool can package mods, but to do so effectively, you'll need to ensure you mod has a valid structure. Files that use a special extension pattern will automatically be converted (ie. example.loca.xml => example.loca and example.lsf.lsx => example.lsf). Note: auto-conversion does not work if example.lsf is in the same directory as example.lsf.lsx; it will be skipped.

Make sure you don't accidentally use too many prefixes! .lsf.lsx.lsx will not convert to .lsf but instead to .lsx!

At it's core, you'll want something like this:

ModFolder
   | -> Localization
      | -> LanguageName
         |->CustomLocalizationName.loca.xml
   | -> Mods
      | -> ModName
         | -> meta.lsx
   | -> Public
      | -> ModName
         | -> Folder1
            | -> File.lsx
         | -> Folder2
            | -> File.lsf.lsx
            | -> File2.lsx

Of course, seeing it in action may be easier to understand, so on the right, we've supplied an image of what this looks like.

Git

If using Git, ensure that the Repository folder is the parent folder of ModFolder:

MyProject
   | -> ModFolder
      | -> Localization
      | -> Mods
      | -> Public 
   | -> .git
   | -> Readme.md

Custom Subfolder Support

It's useful to note here, that while the game will not typically read files in custom subfolders, the Multitool will automatically merge files in subfolders within Public/ModName/Stats/Generated/Data into root-level files with the name of their Subfolder. In the example to the right, you can see that there's a subfolder, CL_Util, containing the files CL_IndestructibleSummon_AI_Ignore.txt and CL_RacialProficiency.txt. When the mod is packaged, these will be merged into Public/ModName/Stats/Generated/Data/__MM_CL_Util_Timestamp_.txt, becoming readable by the game.

Additionally, subfolders and extra files under other Public/ModName/ folders are now supported.

In this Community Library Branch, as an example, under Races we have Elves/ and Skeletons/, both containing a file prefixed with a description, and suffixed with .Races.lsx, which will be compiled back down to a single Public/ModName/Races/Races.lsx upon packaging.

This works for the following directories:

  • Races/
  • Progressions/
  • ProgressionDescriptions/
  • Origins/
  • ClassDescriptions/
  • ActionResourceDefinitions/
  • RootTemplates/
  • Lists/
  • CharacterCreation/
  • CharacterCreationPresets/

The important naming convention is this: Descriptor.Original Filename.lsx, ie. ExampleThing1.Races.lsx + ExampleThing2.Races.lsx = Races.lsx.

Files in subfolders below the following folders will be moved into their respective main directories. Duplicate files will be replaced to prevent UUID collisions:

  • MultiEffectInfos

Using a structure like this is recommended for improved code organization while making mods.

  翻译: