The Sims 4  /  Main  /  Development  /  Mod Information Files

Mod Information Files

Mod information files are how you signal to Main that your mod exists.


The File

To discover the mod information file, it must be placed anywhere inside The Sims 4's mod folder. Additionally, the file's name must contain 'NeonOcean-Mod' and the file's extension should be '.json'. The info file's name and file extension are not case sensitive.


The File's Contents

A mod information file must contain data, in the JSON format, that tells Main some relativity simple information about your mod. The root of the info file should be a JSON object (converts to a dictionary in python).

Example Mod Info File

{
"Namespace": "Alice.Example",
"Name": "Example",
"Author": "Alice",
"Version": "1.0.0",
"VersionDisplay": "2020.1.5",
"Rating": "Normal",
"LoadController": "NeonOcean.S4.Main",
"ScriptPaths": [
{
"Root": "Current",
"Path": "Alice.Example.Archive"
}
],
"RequiredMods": [
"NeonOcean.S4.Main"
],
"LoadBefore": [
"Alice.Example_2"
],
"LoadAfter": [
"NeonOcean.S4.Main"
],
"Compatibility": {
"NeonOcean.S4.Main": {
"LowestVersion": "2.0.0"
}
}
"BuildDate": "2020-06-16",
"BuildGameVersion": "1.63.136.1010"
}

Attributes

  • Namespace (Required attribute): A unique identifier for your mod. This is the name by which our system we will look up your mod. If your mod has code, its a good idea to use the path at which your code occupies for this attribute. This practice may even be required for use of certain features in Main.
  • Name (Required attribute): The display name of your mod.
  • Author (Required attribute): The author of your mod.
  • Version (Required attribute): The version number for your mod. These numbers must follow the semantic versioning specification. https://semver.org/
  • VersionDisplay (Optional attribute): What will be displayed to the user any time they might be shown this mod's version number. If this attribute doesn't exists we will just display the actual version number. This is useful if your mod uses some other weird versioning system.
  • Rating (Optional attribute): This attribute can have one of two values, Normal and NSFW. Allows you to indicate whether or not your mod has adult content.
  • LoadController (Optional attribute): The namespace of the mod that is in charge of loading this mod's python code, if it has any.
  • ScriptPaths (Optional attribute): An array of JSON objects that indicate to Main where your mod stores its python code. This attribute is necessary if you want main to handle your mod's loading.
    • Root (Required attribute): The root path at which we should start the search for the python code. This attribute have the value "Mods", "S4", and "Current", and is not case sensitive. For "Mods" we will start the search from the game's mods folder, for "S4" we will go from the game's user data folder, and for "Current" we start in the folder we found this mod info file in.
    • Path (Required attribute): The path at which the python code resides, relative to the root folder. If your mod is reliant on Main to function, I recommend you store your code in a zip folder, then change its extension from .zip to something else. This way you can make the game never load your mod if Main is not installed.
  • RequiredMods (Optional attribute): A list of mods, by their namespaces, that need to be installed in order for your mod to function. A load controller is required for this attribute to be used.
  • LoadBefore (Optional attribute): A list of mods, by their namespaces, to be loaded before your mod is. A load controller is required for this attribute to be used.
  • LoadAfter (Optional attribute): A list of mods, by their namespaces, to be loaded after your mod is. A load controller is required for this attribute to be used.
  • Compatibility (Optional attribute): An attribute that allows you to specify which versions of a another mod are too old or too new for your mod. This should be an array of JSON objects. A load controller is required for this attribute to be used.
    • LowestVersion (Optional attribute): The lowest possible version number the other mod can be.
    • HighestVersion (Optional attribute): The highest possible version number the other mod can be. This will generally not be used as the next incompatible version of another mod has probably not been released yet.
  • BuildDate (Optional attribute): The date at which your mod was built.
  • BuildGameVersion (Optional attribute): The version number the game was on when your mod was built.

Other Attributes

There are other attributes available to be added to your mod information file. You can find out more about them on other pages.


Mod Information Errors

Information on the issues within your mod information files will be written to a log file at '<Sims 4 user data path>\NeonOcean\Debug\Mods\NeonOcean.S4.Main\<Game start time>\Log.xml' each time the game starts.