Mod Folder Versions
Both theory and practice will be covered in this page. A full tutorial that shows step-by-step what to do, and explain why.
You will learn how to have separate files for each version of the game, increasing compatibility.
Different version, different files
In the previous article, we saw we need to create an About, Assemblies, Defs, and other folders inside our root Mod folder. Let's say we made our mod for 1.5 and it works perfectly, but what if 1.6 changes some tags in our ThingDefs? How can we handle different files for different versions?
That is, making folders for each version!
Making subfolders
- The
About
folder is only one, you must NOT put more About folders anywhere. - The main, primary use of 1.X version subfolders is to add our
Assemblies
.dll files,Defs
.xml files, andPatches
.xml files in their corresponding version subfolder. - While you can put
Textures
,Languages
,Sounds
folder inside 1.X version subfolders, you don't really need it. Why? Because even if these files (.png, .ogg, etc) are loaded, they can't cause any trouble by themselves.
Practice yourself
Instead of having the Defs, Assemblies, Patches folders (your mod may not need them all) and more in your root Main folder, make a subfolder with the version you are making the mod for and put these folders there.
"Common" subfolder
You can also make a subfolder named Common
which contents will be loaded for every single version.
Example: let's say we have a ThingDef that works perfectly for 1.5 and 1.6, but our code needs to be different for each version. In this case, we can have our ThingDef (one single file!) in a Common
subfolder, while we have different subfolders, each containing different versions of our code.
Avoid file duplication
Let's say we are on version 1.5, we made a 1.5 subfolder and a Common subfolder, each with a Defs subfolder. Naturally, the contents of both subfolders will be loaded. If we have a file with the exact same name in those folders, only one will be loaded! This is one of the (almost nonexistent) cases where file names do matter (do not confuse file name with defName).